Setting up Django

It has been a long time since I’ve done a Django project. Here are my notes on how to get started. I already have my machine setup with the dev environment ready to go by running my installer.

mkvirtualenv <project name>
pip install django
mkdir <project name> startproject project
mv project/ project/project <project name>

At this point, I should have a fully functioning app. I am creating an example project for myself with code-camp-api. After this, I went through and removed all the comments that came for free in the scaffolding. After this, I created a requirements.txt and a requirements directory. The directory contains a file for each environments dependencies as they may differ. The requirements.txt points to the requirements/production.txt.

After this I created a settings directory and moved the file to settings/ Then I created a settings/ and a settings/ In addition to this, I also had to modify the and the I have the always point to the settings file as I will only use the to deploy to production. The on the other hand, will take the environment as the first parameter after ./ (ie ./ test test).

At this point, I still have a functioning app that is now ready for multiple environments.

comments powered by Disqus