Skip to content

Project template for a quick start with the Django framework.

License

Notifications You must be signed in to change notification settings

pascalpepe/django-quickstart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quick Start with Django

Django 2.2

Python 3.5, 3.6, 3.7, 3.8

MIT License

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

Overview

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:

Quick usage guide

  1. 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.
  2. Get the project template:

    git clone https://gitlab.com/pascalpepe/django-quickstart.git
  3. Start a new Django project (replace the project name and its optional destination directory 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.

  4. Install requirements:

    pip install -r requirements/dev.txt
  5. Initialize the database:

    python manage.py makemigrations
    python manage.py migrate
  6. Run the development server and visit http://localhost:8000:

    python manage.py runserver

Supported versions of Django and Python

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.

Changelog

All changes in this repository are logged in the file CHANGELOG.rst.

License

This project is licensed under the MIT License.

This project redistributes open source software. See the NOTICE file for more information.