Django startproject template with batteries
- Django 4.2.x
- django-click
- Docker
- Docker Compose
- environs[django]
- psycopg2-binary
- whitenoise
- inertia-django, django-vite
- django-allauth (local only, but add your own additional providers)
- django-test-plus
- model-bakery
- pre-commit
- pytest
- pytest-cov
- pytest-django
🏠 Homepage
Note: This assumes you've already installed Django>=4.2.7 and Python>=3.10 on your machine or in your venv and have activated it.
If you have not, you can install it with the following command (Ubuntu or Debian):
$ wget -O https://github.com/iamdadmin/django-startproject/blob/main/venv-build.sh && chmod +x venv-build.sh && ./venv-build.sh
$ source .venv/bin/activate
$ pip install django>=4.2.7
By convention, we recommend naming your project 'project' or 'config' - see here for more details.
We are going to use project in this example, but you can use any name you want.
$ mkdir mysite && cd mysite
$ django-admin startproject \
--extension=ini,py,toml,yaml,yml \
--template=https://github.com/iamdadmin/django-startproject/archive/main.zip \
project .
Note this is assuming compose v2 as a plugin, you'll need to adjust the command to 'docker-compose' if you haven't set up this way.
# Build web docker
$ docker compose build
# Run Migrations
$ docker compose run --rm web python manage.py migrate
# Create a Superuser in Django
$ docker compose run --rm web python manage.py createsuperuser
# Run Django on http://localhost:8000/
$ docker compose up
# Run Django in background mode
$ docker compose up -d
# Stop all running containers
$ docker compose down
# Run Tests
$ docker compose run --rm web pytest
# Re-build PIP requirements
$ docker compose run --rm web pip-compile requirements/requirements.in
This is a fork of django-startproject by Jeff Triplett
👤 Jeff Triplett
- Website: https://jefftriplett.com
- Twitter: @webology
- Github: @jefftriplett
If my fork isn't useful for you, consider using or making your own fork of Jeff's project and leave a star if it helped you.
Contributions, issues and feature requests are welcome!
Feel free to check issues page.