This repository provides a starting template for projects using Django and Django REST Framework (DRF) with a dotenv
setup. It includes configurations for multiple databases, media, and static URLs. Additionally, the .gitignore
file is pre-configured to exclude unnecessary files from version control.
- Django & DRF Setup: A boilerplate setup for Django and Django REST Framework.
- Dotenv Configuration: Environment variables management using
python-dotenv
. - Multiple Database Configurations: Template supports multiple database setups.
- Media and Static URL Configurations: Basic configurations for handling media and static files.
- Git Ignore:
.gitignore
is set up to avoid tracking unnecessary files.
git clone https://github.com/johnmathewdino/https-github.com-johnmathewdino-Django-DRF-Starting-Template.git
cd django-drf-starting-template
- Create a virtual environment using
venv
orvirtualenv
.
pyhton -m venv venv
- Activate the virtual environment.
# Windows
venv\Scripts\activate
# Linux/Mac
source venv/bin/activate
- Install the dependencies.
pip install -r requirements.txt
- Rename the
.env.example
file to.env
.
mv .env.example .env
- Open the
.env
file and update the environment variables.
# DATABASE
DB_NAME=
DB_USER=
DB_PASSWORD=
DB_HOST=
DB_PORT=
# EMAIL
EMAIL_HOST=
EMAIL_HOST_USER=
EMAIL_HOST_PASSWORD=
Run the following commands to set up your database schema:
python manage.py makemigrations
python manage.py migrate
Create a superuser to access the Django admin panel:
python manage.py createsuperuser
Follow the prompts to create a superuser account.
python manage.py runserver