A template for Django REST Framework projects

I made a project template for Django 1.7 + Django REST framework + PostgreSQL containing things I use and find useful. Part of it is based on Two Scoops of Django template. You can see the repo on Github.


It contains the following things:

There are also goodies on dev and test environments:


You will need Postgres installed and the following libs (for ubuntu/debian, for others systems look in your package managers).

$ sudo apt-get install libpq-dev python-dev

Create your virtualenv (and virtualenvwrapper in the example case), I will use the name myproject but use your own name.

$ mkdir myproject && cd myproject
$ mkvrirtualenv myproject
$ pip install django
$ django-admin.py startproject myproject --template=https://github.com/Keats/django-drf-template/archive/master.zip
$ cd myproject
$ pip install -r requirements/local.txt
$ python myproject/manage.py migrate

If you want, you can also add a pre-commit flake8 hook to ensure that commit respects it.

$ flake8 --install-hook

By default it will not stop commits because of warning, a quick look at .git/hooks/pre-commit shows that putting an environment variable of FLAKE8_STRICT will stop them.

And you should be almost good to go. There are a few hardcoded temporary settings that you will want to replace, look for the string 'Ann Onymous' and you should find them. They are in the Sphinx folder and in the base settings file if you're lazy.

Once again, PRs are welcome if there's a bug or want to share something you use all the time that I don't necessarily know about !