Cookiecutter is a cli tool creating projects from templates.
Cookiecutter Django is a good starting point to structure an enterprise level django project.
Install
I’ll demo it in CentOS 7.6
- Download and unzip file
- Install cookiecutter globally.
pip3 install cookiecutter
- In my projects folder, initialize my django project with cookiecutter django
cookiecutter /root/sw/cookiecutter-django
- Follow the prompts to configure my project
zanhu
- 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.
- Config Pycharm Django Debug/Run
Don’t forget the log
- Enable Django Support
Configure Django Project
We still need to remove and edit some files/folders for our own django project.
Remove all the files under
docs
folder, as I’ll use markdown notrst
filesI’ve already configured my server environment, so no need for
utility
folderUpdate base and local requirements file
- On CentOS, install the requirements via pipenv
pipenv install -r requirements/local.txt
- Now we should have a reasonable starting point for the new django project