Project template for a quick start with the Django framework.
Source code: | https://gitlab.com/pascalpepe/django-quickstart |
---|---|
Issue tracker: | https://gitlab.com/pascalpepe/django-quickstart/issues |
This repository provides yet another project template that aims at taking care of the necessary boilerplate when starting a new Django project. It is obviously more opinionated than the one included in Django, but hopefully not too much.
By using this template, you will start with a project for which:
- Django settings are split into environment-specific modules.
- Sensitive settings (e.g. secret key, database password) are loaded from environment variables.
- A custom user model is already set up. It behaves identically to the default user model, but this makes it easier to customize it mid-project if needed. For more information, refer to the official documentation on using a custom user model when starting a project.
- PostgreSQL is set as the default database engine in production.
- The paths to project-level templates and static files are set.
- Error pages can be browsed during development.
- Emails are sent with the console backend during development.
Additionally, this project template relies on some commonly used tools for testing and linting:
- Tests are automated with tox.
- Code coverage is measured with coverage.py.
- Linting is performed with flake8.
- django-debug-toolbar is installed and already set up during development.
- A minimal configuration file for GitLab CI is provided.
Install Django 2.2 (preferably within a Python virtual environment). See the compatibility table below for more information on the supported versions of Django and Python.
Get the project template:
git clone https://gitlab.com/pascalpepe/django-quickstart.git
Start a new Django project (replace the project
name
and its optional destinationdirectory
as you see fit):django-admin startproject name [directory] --template ./django-quickstart/project_template/ --extension py,rst,txt
For more information, refer to the official documentation on using the startproject command.
Install requirements:
pip install -r requirements/dev.txt
Initialize the database:
python manage.py makemigrations python manage.py migrate
Run the development server and visit http://localhost:8000:
python manage.py runserver
This project aims at supporting the latest LTS version of Django.
Django | Python |
---|---|
2.2 LTS | 3.5, 3.6, 3.7, 3.8 (added in 2.2.8) |
For each version of Python, it is recommended that you install the latest micro release (A.B.C) available on your system.
For Django, the latest LTS micro release (2.2.x) is recommended.
All changes in this repository are logged in the file CHANGELOG.rst.
This project is licensed under the MIT License.
This project redistributes open source software. See the NOTICE file for more information.