Made with bytes - Web Development and Consultancy, London UK

Introducing Django startproject plus.

Mon 1 April 2013

The custom template functionality on Django's startproject command is great, but unfortunately it doesn't support passing extra variables to the context. This is not very helpful with more complex template setups.

So I created a wrapper around Django's startproject command. It supersets the command by adding support for passing extra context to the template.

Because this command is a drop-in replacement it can be invoked with the same flags that startproject supports.

This issue has been brought up to the django-devs mailing list. But it has ended up as a documentation amend unless there is more demand for this.

Since I have a need for this I decided to create this simple script, which I bundled as a package to make it easier to use.

The source code is available on github: https://github.com/alfredo/django-startproject-plus. Please do report any issues you find with it.

Installation

This package requires Django 1.5.x installed and it is available in pypi:

# pip install django-startproject-plus

Usage

This is a drop in replacement for the django-admin.py startup, with an extra_context flag:

# django-startproject.py myproject --extra_context='{"some": "json"}'

Things to do:

Support django-admin.py startapp.