|
InstallationInstructions
Installing django-command-extensions
Download and installationDownloadDownload 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. InstallationYou will need to add the django_extensions application to the INSTALLED_APPS setting of your Django project settings.py file. INSTALLED_APPS = (
...
'django_extensions',
)This will make sure that Django finds the additional management commands provided by django-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/django_extensions /usr/lib/python2.5/site-packages/django_extensions You can verify that the application is available on your PYTHONPATH by opening a Python interpreter and entering the following commands: >>> import django_extensions >>> django_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. |
Sign in to add a comment
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...
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 ;)
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.
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!
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)
Django 0.96 doesn't support command extensions.
Is it Django 0.96 or 0.96. ? Specifically, does extensions work with 0.96.2?
@karwas, sorry for the confusion, most of the extensions will work with Django <1.0 but svn should be compatible with Django 1.0 and thus might break on earlier version.
We are planning to introduce a versioning system which will follow Django releases. Where django_extionsions 1.x will be fully compatible with Django 1.x and so on....
btw please post problems you have with django_extensions as an issue so it's easier to track for us. thanks :-)
It looks like the import is just called 'extensions' not 'django_extensions' in the zip download in case anyone else uses that.
INSTALLED_APPS = (
)to
INSTALLED_APPS = (
)So I guess the moral of the story is download from SVN not the packaged zip.
I have been trying to get django-command-extensions (with a specific interest in dumpscript) to work with Django 0.96. I don’t have a lot of experience with Django, however the instructions seem straightforward enough. Am I just plain out of luck without moving to Django 1.0?
This page is wrong! the packaged file has a lot of bugs - get the trunk from svn.
bennydaon is correct. Getting the trunk works. The tarball does not.
I see that it is 'extensions' and not 'django_extensions' in the tgz download as well. A note should be made on this wiki page.
how the heck do I get this to work? Downloaded the tarball and the SVN version, tried both 'extensions' and 'django_extensions' in INSTALLED_APPS, and I still don't see any of the new commands
I downloaded the latest trunk but have had no luck getting it to work with Django 1.0.2 or 1.1.
I can import the package in python and using ">>>django_extensions.VERSION" I can see the version number. However, when I type "python manage.py help", I do not see any of the extra commands.
I see only these:
Available subcommands:
Am I missing something really obvious?
Lee, I think you might be. Make sure 'django_extensions' isn't after your models. On my setup moving it up the list of INSTALLED_APPS made all the difference.
I can't see the commands on linux. It works fine under Windows. Both places, the django_extension directory is a sibling of the django directory.
If I drop into the shell (/dir/<app>/manage.py shell) and import django_extensions and then print django_extensions.VERSION, everything works. I even tried moving the line above my models.
Nothing works on linux..
version of Python on Windows - 2.6.2 version of Python on Linux - 2.5 version of django on both - 1.1
any ideas?
Found the problem, I had another <app> directory in the original <app> directory like so: <app>/<app>. I guess the 2nd dir got there due to a screwed up svn command.
Still doesn't work for me. Moved 'django_extensions' up, tried 'extensions' instead of 'django_extensions' - still no luck. I'm on OSX Leopard, Python 2.6, Django 1.1
@lee.kevin you can checkout the source code and create a symbolic link to django_extensions directory under your site-packages folder. It's very easy in OSX.
if you don't know what's your site-packages folder you can quickly learn by typing: