What's new? | Help | Directory | Sign in
Google
                
Search
for
Updated Jun 01, 2008 by v.oostveen
Labels: Featured
InstallationInstructions  
Installing django-command-extensions

Download and installation

Download

Download the latest packaged version from http://code.google.com/p/django-command-extensions/ and unpack it. Inside is a script called setup.py. Enter this command:

python setup.py install

...and the package will install automatically.

Installation

You will need to add the extensions application to the INSTALLED_APPS setting of your Django project settings.py file.

INSTALLED_APPS = (
    ...
    'extensions',
)

This will make sure that Django finds the additional management commands provided by django-command-extensions.

The next time you invoke ./manage.py help you should be able to see all the newly available commands.

Some command's or option's require additional applications or python libraries, for example:

If the given application or python library is not installed on your system (or not in the python path) the executed command will raise an exception and inform you of the missing dependency.

Version Control (Subversion and Mercurial)

Alternatively, source code can be accessed by performing a Subversion checkout or a Mercurial clone.

Tracking the development version of django command extensions should be pretty stable and will keep you up-to-date with the latests fixes.

The following command will check the application's source code out to a directory called django-command-extensions:

Subversion:

svn checkout http://django-command-extensions.googlecode.com/svn/trunk/ django-command-extensions

Mercurial:

hg clone http://hgsvn.trbs.net/django-command-extensions

For more information about Mercurial see MercurialGateway wiki page

You should either install the resulting project with python setup.py install or put it the extensions directory into your PYTHONPATH. The most common way is to symlink (junction, if you're on Windows) the extensions directory inside a directory which is on your PYTHONPATH, such as your Python installation's site-packages directory.

ln -sf /full/path/to/django-command-extensions/extensions /usr/lib/python2.5/site-packages/extensions

You can verify that the application is available on your PYTHONPATH by opening a Python interpreter and entering the following commands:

>>> import extensions
>>> extensions.VERSION
(0, 2, 'pre')

Keep in mind that the current code in SVN trunk may be different from the packaged release, and may contain bugs and backwards-incompatible changes, as well as new goodies to play with.


Comment by treborhudson, May 29, 2008

And then what? How do you add to your project?

Comment by eric.fehse, May 31, 2008

I just checked out trunk via subversion, installed it with "python setup.py install", imported it, asked for the version tuple, and got (0, 2, 'pre') instead of (0, 3, 'pre'). Just wondering...

Comment by andybak, Jun 01, 2008

According to http://www.djangoproject.com/documentation/django-admin/ Django will auto-discover command that are placed in {appname}/management/command whereas you state that custom commands have to be added to INSTALLED_APPS. Why the difference?

Also - installation instructions that don't mention setup.py would be handy for people on shared hosting or those who don't like to mix up Django stuff with their site-packages (me for example ;)

Comment by v.oostveen, Jun 01, 2008

eric.fehse: sorry my bad... (0,3,'pre') is the version i bumped for my local development code.

andybak: i don't read the instructions as 'you need to add EVERY custom app to INSTALLED_APPS'... i thought it was pretty clear on that you need to add extensions to your INSTALLED_APPS and that after that the commands will be auto-discovered... If you feel it's unclear please post a revised piece of documentation here and I'll put it on the wiki.

Comment by andybak, Jun 01, 2008

For some reason it's just not working for me either: 1. added to my project as an app (as per your docs except dropped into the project folder rather than using setup.py to put it in the python path) or 2. added to my app as per the instructions in the Django docs. This is on the latest checkout of newforms-admin. The minute I get it working I will suggest some clarifications to the docs!

Comment by iacobs, Jun 14, 2008

hmm... is it supposed to work with 0.96? this may be a PEBKAC situation, but I tried both using setup.py and installing in the project tree as a regular app (i.e. first ran setup.py install, added to INSTALLED_APPS, didn't work, deleted the installed files, dropped extensions in the project root, modified entry in INSTALLED_APPS, didn't work)

Comment by jshaffer2112, Jun 20, 2008

Django 0.96 doesn't support command extensions.

Comment by karwas, Jul 18, 2008

Is it Django 0.96 or 0.96. ? Specifically, does extensions work with 0.96.2?


Sign in to add a comment