Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install django-cherrydev

How to install django-cherrydev

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install django-cherrydev
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.1 Available View build log
Windows (64-bit)
0.1 Available View build log
Mac OS X (10.5+)
0.1 Available View build log
Linux (32-bit)
0.1 Available View build log
Linux (64-bit)
0.1 Available View build log
 
Author
License
MIT
Dependencies
Imports
Lastest release
version 0.1 on Jan 5th, 2011

Description

This utility is a substitute for Django's runserver command. It was inspired by Gunicorn's gunicorn_django command which makes it so easy to serve Django projects without having to create extra WSGI scripts.

I chose to use CherryPy as it is pure Python (thus cross-platform) and quite efficient in its own right. It also had the functionality I desired to be able to serve static media without fuss while developing Django applications.

To be clear, this utility will automatically serve your static media (as well as admin media) without needing to modify your settings.py or maintain a development version of your settings.

To do this, it modifies your settings.MEDIA_URL and settings.ADMIN_MEDIA_PREFIX on the fly before loading Django, which is also the reason that it is not provided as a custom management command.

Requirements and Installation

In its present incarnation, this utility requires Python 2.7 and CherryPy 3.1 or above. Also, it is assumed you have Django installed.

Installation is as simple as pip install django-cherrydev. This will also install CherryPy if it isn't already available.

Source

You can install the latest development version from the hg repository with pip install -e hg+http://code.db-init.com/django-cherrydev or from a tarball with pip install django-cherrydev==dev.

Usage

Django-CherryDev provides a single script, cherrydev, which uses CherryPy to serve your Django project and media files. To use it, simply CD into your Django project directory and run cherrydev:

$ cd myproject
$ cherrydev
Arguments
usage: cherrydev [-h] [--noreload] [-b ADDRESS] [--nomedia] [-m MEDIA_ADDR]
[--noadmin] [-a ADMIN_ADDR] [-l LINK_DIR] [SETTINGS_PATH]
positional arguments:
SETTINGS_PATH By default SETTINGS_PATH will look for settings.py in
the current directory.
optional arguments:
-h, --help show this help message and exit
--noreload Tells CherryPy to NOT use the auto-reloader.
-b ADDRESS, --bind ADDRESS
 The socket to bind. A string of the form: 'HOST', 'HOST:PORT'. An IP is a valid HOST. (default: '127.0.0.1:8000')
Media:

By default, CherryPy will be used to serve your media. If your MEDIA_URL includes a host component, it will be changed to an alternate port on localhost. If your ADMIN_MEDIA_PREFIX includes a host component that does not match that of MEDIA_URL, it will also be changed to its own alternate port.

--nomedia Tells CherryPy to NOT host media.
-m MEDIA_ADDR, --media MEDIA_ADDR
 The socket to bind media. A string of the form: 'HOST', 'HOST:PORT'. An IP is a valid HOST. (default: '127.0.0.1:8001')
--noadmin Tells CherryPy to NOT host admin media.
-a ADMIN_ADDR, --admin ADMIN_ADDR
 The socket to bind admin. A string of the form: 'HOST', 'HOST:PORT'. An IP is a valid HOST. (default: '127.0.0.1:8002')
-l LINK_DIR, --link LINK_DIR
 An additional directory to be linked to MEDIA_URL. May be used multiple times. A string of the form: 'PATH=DIRECTORY'. (e.g. 'app=../myapp/media')

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.