Django Starter Template
Description
Django Starter is a simple Skeleton to start with a Django project.
Features
- Easy Installation
- Standard Project Structure
- Example Landing Page using Bootstrap 5
- Caching Support
- Setup script
- Dockerized
- Management Commands
- I18N Support
Installation
Requirements
(click each one for install guide)
- Python 3.8.x
- pip or poetry
- git
- docker (optional)
- docker-compose (optional)
Setup Process
Installation Methods
1. Using Traditional Approach
-
Clone the git:
git clone https://github.com/NumanIbnMazid/django_starter.git
-
Go into the new directory:
cd django_starter
-
Install the required dependencies.
-
Install Dependencies Using Pip
-
Run
pip install -r requirements.txt
, this will install all the required dependencies.Please choose to (w)ipe if asked for this:
The plan is to install the git repository https://github.com/xxxx What to do? (i)gnore, (w)ipe, (b)ackup
-
-
Install Dependencies Using Poetry
- Run
poetry install
, this will install all the required dependencies.
- Run
![N:B: Replace `python` with `poetry run python` if using poetry. For example: `poetry run python manage.py runserver`]
-
-
Create a
.env
file and provide required environment variables using the template.env.example
or runpython utils/generate_env.py
to automatically generate the.env
file. -
Run
python manage.py makemigrations
andpython manage.py migrate
, this will create the database tables -
Run
python manage.py collectstatic
, this will collect all static files -
Run
python manage.py runserver
this should start the project on port 8000. -
Open the app on browser by navigating the url
http://127.0.0.1:8000
- Optional: Create Django Superuser with management command
python manage.py initiate_admin
- Optional: Configure site information with management command
python manage.py initiate_site
2. Using Docker
- Clone the git:
git clone https://github.com/NumanIbnMazid/django_starter.git
- Go into the new directory:
cd django_starter
- Create a
.env
file and provide required environment variables using the template.env.example
. Django SECRET_KEY can be generated from djecrety.ir - Run command
docker-compose up
to start the project. - Open the app on browser by navigating the url
http://localhost:8000