I decided I wanted to update my Django 1.2 project to Django 1.3 to take advantage of the new static files mechanisms. I deleted my old version of Django, and followed the documentation's instructions for installing the development version from svn.
The changes seem to have taken. That is, python -c "import django; print django.get_version()" yields "1.3 alpha 1 SVN-14686". Yet, I can't seem to take advantage of 1.3 features in my old project. If I do "python manage.py collectstatic --help" I get "Unknown command: 'collectstatic'".
I tried creating a fresh project and doing the same thing, and the collectstatic command worked. I dug into django.core.management, but can't really make a lot of sense of it. The docstring for get_commands() mentions:
The dictionary is cached on the first call and reused on subsequent calls.
Maybe this is totally irrelevant, but I wonder if my problem has something to do with caching (that is, an old version of the command dictionary is cached, which doesn't have the new 1.3 commands?). Any thoughts?
The site could be temporarily unavailable or too busy. Try again in a few moments. If you are unable to load any pages, check your computer's network connection. If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.
Go to Settings -> Project Interpreter . Double-click the Django package. Activate the check box Specify version and select the version you want.
It is your tool for executing many Django-specific tasks -- starting a new app within a project, running the development server, running your tests... It is also an extension point where you can access custom commands you write yourself that are specific to your apps.
In order to use a management command, you need to add the application that provides it to INSTALLED_APPS
in settings.py. From the docs:
First, you’ll need to make sure that
django.contrib.staticfiles
is in yourINSTALLED_APPS
.
That should make the command available.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With