Django Project Template

screenshot of Django Project Template

`startproject` Template for Django projects

Overview:

This article provides an overview of a Django project, specifically mentioning the version of Django and Python it uses. It also mentions the requirement of having a virtual environment setup. The article explains how to set up the project and its database, as well as how to run the development server. It also mentions that the project template is based on the recommended layout from the "Two Scoops of Django" book.

Features:

  • Python 3.7 compatibility.
  • Use of virtualenv for isolated environment.
  • Project layout based on the "Two Scoops of Django" book.
  • PostgreSQL as the database engine.
  • Development server for local testing.
  • Lightweight Django project template.

Setting up the project:

  1. Install Python 3.7 if not already installed.
  2. Install virtualenv by running pip3 install virtualenv in the command line.
  3. Create a Python virtual environment for the project.

Development requirements:

  1. Install the development requirements by running the command pip install -r requirements/dev.txt.

Production requirements:

  1. Install the production requirements by running the command pip install -r requirements/production.txt.

Running the project:

  1. Ensure that PostgreSQL is running.
  2. Make sure the database and its associated user with proper permissions are set up.
  3. Start the development server by running python manage.py runserver in the command line.

About the project template:

  • The project template follows the layout recommended in the "Two Scoops of Django" book.
  • It also incorporates the author's personal experience with Django.
  • For a more comprehensive setup, consider using Cookiecutter templates like cookiecutter-django or the author's django-cookiecutter-template.
  • To use this template with the startproject django admin command, follow the provided instructions.

Summary:

This article provides an overview of a Django project and its installation process. It highlights the key features of the project, such as Python 3.7 compatibility and the use of virtualenv. The article also explains how to set up the project, run the development server, and provides additional resources for a more comprehensive project setup.