Django Cookiecutter to create a project

Cookiecutter is a cli tool creating projects from templates.
Cookiecutter Django is a good starting point to structure an enterprise level django project.


I’ll demo it in CentOS 7.6

  1. Download and unzip file
  1. Install cookiecutter globally.
pip3 install cookiecutter
  1. In my projects folder, initialize my django project with cookiecutter django
cookiecutter /root/sw/cookiecutter-django
  1. Follow the prompts to configure my project zanhu
  1. Finish the project initialization. Cookiecutter will generate a number of files

Sync Files

I use Pycharm’s remote ssh interpreter to run Pycharm in Windows10 but deploy the app to CentOS7.
I will first sync files from CentOS to local Win.

  1. Config Pycharm Django Debug/Run

Don’t forget the log

  1. Enable Django Support

Configure Django Project

We still need to remove and edit some files/folders for our own django project.

  1. Remove all the files under docs folder, as I’ll use markdown not rst files

  2. I’ve already configured my server environment, so no need for utility folder

  3. Update base and local requirements file

  1. On CentOS, install the requirements via pipenv
pipenv install -r requirements/local.txt
  1. Now we should have a reasonable starting point for the new django project

   Reprint policy

《Django Cookiecutter to create a project》 by Isaac Zhou is licensed under a Creative Commons Attribution 4.0 International License