#django_starter
A user-friendly Django 1.7 Starter Template with an organized file structure for team development (like during Hackathons) and optional Heroku deployment.
- Mandatory:
- Optional:
- If you would like to use git, you will need:
- If you would like to use a virtual envrionment (highly recommended), you will need:
- Installed Python and Virtualenv in a unix-style environment.
- If you would like Heroku Deployment, you will also need:
- The Heroku Toolbelt, as described in Getting Started with Python.
- An installed version of Postgres to test locally.
- Clone it
git clone [email protected]:potay/django-starter.git
- Run
cd django_starter
- Setup the project:
- If you would like all the features:
- Run
python setup.py [PROJECT_NAME]
- Run
- If you would not like to use heroku:
- Run
python setup.py [PROJECT_NAME] --noheroku
- Run
- If you would not like to use git:
- Run
python setup.py [PROJECT_NAME] --nogit
- Run
- If you would not like to use virtual environment (really not recommended for safety and security):
- Run
python setup.py [PROJECT_NAME] --novenv
- Run
- You can combine the flags:
python setup.py [PROJECT_NAME] --novenv --noheroku
...
- Delete setup.py file
- Replace this file with your readme.
- Start making awesome django web apps!
- Run the local test server:
python runserver.py
- Create new apps:
python createapp.py [APP_NAME]
In this Django structure, all static and template files are stored in the root folder and not in their respective apps. This allows the frontend and backend process to be developed separately while still maintaining interdependence. Furthermore, this allows the namespace and structure of the template and static files to be more explicit and clear. All local development files, such as the database or log files, will be stored in the tmp
folder and not be committed to git. The settings are now stored in multiple files for different environments, namely the production and development environment, where the development environment inherits from the product environment but makes the necessary changes for local development.
django_starter/ - Main Project Folder
apps/ - Contains all django apps
settings/ - Contains production and development settings files
prefixed_storage.py - For storages plugin, if need be
...
static/ - Contains all static files
templates/ - Contains all the dynamic template files
tests/ - Contains all the testing files
tmp/ - Contains local development environment files (e.g. database files, log files, etc.)
createapp.py - Run 'python createapp.py [APP_NAME]' to create an app following the file structure
manage.py - Standard django management file
runserver.py - Run 'python runserver.py' to run a local test server. Does relevant checks and updates db first.
setup.py - Run python setup.py [PROJECT_NAME] after cloning starter template to setup the web app
requirements.txt - Contains all pip requirements
Procfile - For heroku deployment