This project is a starter template designed to streamline the development of Django applications with integrated Tailwind CSS and Alpine.js. It includes a basic setup with one pre-configured Django app named client
, which serves as an example to demonstrate how to define models and integrate frontend technologies.
The starter template provides a robust foundation for building modern web applications using Django, Tailwind CSS, and Alpine.js. The template aims to simplify the initial setup and configuration, allowing developers to focus on building their application's unique features.
A live demo of the project is available at https://startproject-django-demo.onrender.com/.
The project is hosted on a free instance web service on Render. As a result, it may be idle sometimes, causing the initial load to be slow. However, once the application is loaded, it should work normally.
client
, showcasing a basic model and how to integrate the frontend technologies.The client
app includes a simple model to demonstrate how to define and use models in Django. Here's an example of the Client
model:
from django.db import models
class Client(models.Model):
name = models.CharField(max_length=100)
email = models.EmailField(unique=True)
phone = models.CharField(max_length=15)
address = models.TextField()
def __str__(self):
return self.name
Ensure you have the following installed on your machine:
Follow these steps to set up the project locally:
git clone [email protected]:igortosic-easymind/easymind-startproject-django-tailwindcss-alpinejs.git
cd easymind-startproject-django-tailwindcss-alpinejs
pyenv exec python3 -m venv .venv
For macOS and Linux:
source .venv/bin/activate
For Windows:
.venv\Scripts\activate
pip3 install -r requirements.txt
To create a superuser, run the following command:
python3 manage.py createsuperuser
npm install
npm run build
python3 manage.py collectstatic
python3 manage.py runserver
Additional Commands Deactivate the Virtual Environment: When you are done working on the project, you can deactivate the virtual environment by simply running:
deactivate
In the settings.py
file, the default database settings for SQLite3 are commented out. There are settings for PostgreSQL which also require a .env
file for local development. You can choose which one you want to use based on your preference.
To use SQLite3, uncomment the relevant lines in the settings.py
file.
To use PostgreSQL, ensure you have a .env
file with the necessary database configuration. The DATABASE_URL_EXT
variable should be set in the .env
file to configure the PostgreSQL connection.
If you wish to contribute to the project, please follow these steps:
git checkout -b feature-branch
git commit -am 'Add new feature'
git push origin feature-branch
License This project is licensed under the free License. See the LICENSE file for more details.