Code Monkey home page Code Monkey logo

django-project-template's Introduction

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

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.

django-project-template's People

Contributors

anthonyjpesce avatar hcharley avatar palewire avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-project-template's Issues

Admin views not working on my install

I probably missed something obvious. I'm on Django 1.8.7

[08/Dec/2015 14:13:38] "GET /admin/login/?next=/admin/ HTTP/1.1" 500 94349
[08/Dec/2015 14:13:40] "GET /login HTTP/1.1" 404 12618
Internal Server Error: /admin/login/
Traceback (most recent call last):
  File "/Users/cbodkin/.virtualenvs/newsletters.latimes.com/lib/python2.7/site-packages/django/core/handlers/base.py", line 223, in get_response
    response = middleware_method(request, response)
  File "/Users/cbodkin/.virtualenvs/newsletters.latimes.com/lib/python2.7/site-packages/debug_toolbar/middleware.py", line 129, in process_response
    panel.generate_stats(request, response)
  File "/Users/cbodkin/.virtualenvs/newsletters.latimes.com/lib/python2.7/site-packages/debug_toolbar/panels/profiling.py", line 170, in generate_stats
    root = FunctionCall(self.stats, self.stats.get_root_func(), depth=0)
  File "/Users/cbodkin/.virtualenvs/newsletters.latimes.com/lib/python2.7/site-packages/debug_toolbar/panels/profiling.py", line 51, in __init__
    self.stats = statobj.stats[func][:4]
KeyError: None

Couple of install oddities

I had to remove the dot on line 7 before createserver in the fabfile init.
This:
from .createserver import .createserver
To this:
from .createserver import createserver

And change line 27 from:
from env import *
To this:
from fabric.api import env

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.