This Django template includes:
- JET admin interface
- Python slugify package
- Django Tailwind (node.js and npm required)
- Python dotenv package
- Basic templating structure
- Basic account functionality (login and logout)
- Create virtual environment:
python -m venv .venv - Activate the environment:
- Linux/macOS:
source .venv/bin/activate- Windows:
.venv\Scripts\activate - Install packages:
pip install -r requirements.txt - Install tailwind dependencies:
python manage.py tailwind install - Migrate:
python manage.py migrate
In order to use the dotenv package, you will need to create a .env file in the root of your project. You can change the location of the file by modifying this line in the settings.py file:
# Load environment variables from .env
load_dotenv(os.path.join(BASE_DIR, '.env'))By default, the project settings gets DEBUG and SECRET_KEY values from .env file.
To run the development server, just run these two commands in separate terminals:
python manage.py tailwind start
and
python manage.py runserver
To run the development server in Docker, use the following command:
docker-compose -f docker/dev/docker-compose.yaml up
This will run 3 services:
- MySQL database
- Tailwind compiler
- Django web server