Django HTML5 Boilerplate
This is a starting template for Django website projects using (a slightly modified version of) HTML5 Boilerplate.
- A Django project skeleton
- A slightly now less modified version of the HTML5 Boilerplate
- django.contrib.staticfiles url conf set up for serving static media
settings_local.py.extemplate file that allows you to set environment-specific settings
- Requirements files for pip (details below)
How to use the template
Start by creating your virtual environment (I'm using Doug Hellman's virtualenvwrapper):
Replace 'projectname' with your desired environment name.
I've included two separate requirements files:
requirements_min.txtcontains the minimum requirements to get this up and running
requirements_plus.txtcontains a few extra Python packages that I use in most of my projects (South, PIL, etc.)
Install one of the requirements files:
pip install -r <requirements_min.txt or requirements_plus.txt>
When you're finished installing requirements, you'll need to set up your settings_local.py file:
# set path cd <path-to-project>/ # Rename the project folder mv projectname <project_name> # copy settings_local.py cp settings_local.py.ex settings_local.py # Edit settings_local.py vim settings_local.py
After you configure your local settings (database, etc.) you're ready to run
python manage.py syncdb
Once that's completed you can boot up the dev server:
python manage.py runserver
Then open up your browser and go to http://127.0.0.1:8000 -- if all went well you should see the "It works!" page.
A note about humans and robots
HTML5 Boilerplate includes humans.txt and robots.txt files. I had thought about including a method for serving those files with this project but decided that the most appropriate way to do so was not through Django but through your web server (be it, Apache, nginx or what have you). They are included for your convenience in the
config/ folder, but it's up to you to ensure that they're served properly.