Django - Base Project
This simple Django project includes environment based settings and pre-configured logging following the best design patterns.
Getting started
These instructions will get you a copy of this project up and running on your machine for development and testing purposes.
System Requirements
- python - 3.7
Project dependencies
- django - 3.0
- django-configurations - 2.2
- dj-database-url - 0.5.0
- python-decouple - 3.3
Project setup
Create a virtual environment and after activating run the following command to install required python packages:
pip install -r requirements.txt
Set environment variables required to run the project
export $(cat ./env/development.env)
Override environment variables if required
export DATABASE_URL=postgres://USER:PASSWORD@HOST:PORT/NAME
export LOGGING_LEVEL=DEBUG
Apply migrations to synchronize the database state with the current set of models and migrations.
python manage.py migrate
Collect all static files from each application
python manage.py collectstatic --no-input
Create superuser who can login to the admin site
python manage.py createsuperuser
Run the project
$ python manage.py runserver