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)
- Install dependencies:
poetry install - Install tailwind dependencies:
poetry run python manage.py tailwind install - Migrate:
poetry run 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:
poetry run python manage.py tailwind start
and
poetry run python manage.py runserver
Alternatively, you can use Docker to run the development server:
docker-compose -f docker/dev/docker-compose.dev.yaml up
To run the production server we recommend using Docker. You will need to set up the following environment variables:
DEBUG: Set toFalseSECRET_KEY: A random secret keyALLOWED_HOSTS: A comma-separated list of allowed hostsCSRF_TRUSTED_ORIGINS: A comma-separated list of trusted origins
You can set these variables in the .env file.
Then run the following command to start the production server:
docker-compose -f docker-compose.prod.yaml up