Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

datadesk/django-project-template

Repository files navigation

     _  _                                    _        _     _                  _      _
  __| |(_)__ _ _ _  __ _ ___   _ __ _ _ ___ (_)___ __| |_  | |_ ___ _ __  _ __| |__ _| |_ ___
 / _` || / _` | ' \/ _` / _ \ | '_ \ '_/ _ \| / -_) _|  _| |  _/ -_) '  \| '_ \ / _` |  _/ -_)
 \__,_|/ \__,_|_||_\__, \___/ | .__/_| \___// \___\__|\__|  \__\___|_|_|_| .__/_\__,_|\__\___|
     |__/          |___/      |_|         |__/                           |_|

A custom template for initializing a new Django project the Data Desk way.

Uses the built-in Django startproject templating system. Includes a number of small modifications favored by the Los Angeles Times Data Desk. Assumes you already have experience hacking around on Django and PostGIS.

Still experimental, so don't get your hopes up.

Build Status Coverage Status

Features

Requirements

Getting started

Create a virtual enviroment to work inside.

$ virtualenv my-environment

Jump in and turn it on.

$ cd my-environment
$ . bin/activate

Install Django.

$ pip install "django"

Create a new Git repository.

$ git init repo

Download and install a project in there using this template.

$ django-admin.py startproject --extension=py,.gitignore --template=https://github.com/datadesk/django-project-template/archive/master.zip project repo

Now that the template has landed, jump in and install the project's Python dependencies.

$ cd repo
$ pip install -r requirements.txt

Generate a secret key.

$ fab makesecret

Copy the key. Open the settings file and drop it near the top. While you're there, you can also customize any of the other top level configuration options.

$ vim project/settings.py

Create a PostGIS database to connect with. This may vary depending on your PostGIS configuration.

The command below assumes you have it running and want to make the database with a user named postgres. Please modify it to suit your needs. If you don't have PostGIS installed, try following the GeoDjango installation instructions.

$ createdb -U postgres -E UTF8 -T template_postgis mydatabasename

Make a copy of the development settings template.

$ cp project/settings_dev.template project/settings_dev.py

Open it and put in the credentials for the database you just made.

$ vim project/settings_dev.py

Sync the database.

$ python manage.py syncdb

Fire up the test server.

$ fab rs

Get to work. Once you have something worth saving you can replace this README with a description of your new project.