Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

collectstatic command is not available in Django 1.6a1

Tags:

django

I have installed django in my virtualenv like this:

git clone git://github.com/django/django.git django-trunk
pip install -e django-trunk/

in my settings file have this:

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.admindocs',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.sites',
    'django.contrib.flatpages',
    'south',
    'djcelery',
    'gunicorn',
    'sorl.thumbnail',
    'template_utils',
    'compressor',
    'tagging',
    'ckeditor',
    'mptt',
)


STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    'compressor.finders.CompressorFinder',
)

When I try to do

python manage.py collectstatic

I get this error:

Unknown command: 'collectstatic'

If I do

python manage.py --version

I get

1.6a1

Why isn't collectstatic available?

Edit:

When I run

python manage.py --help

I get this:

Usage: manage.py subcommand [options] [args]

Options:
  -v VERBOSITY, --verbosity=VERBOSITY
                        Verbosity level; 0=minimal output, 1=normal output,
                        2=verbose output, 3=very verbose output
  --settings=SETTINGS   The Python path to a settings module, e.g.
                        "myproject.settings.main". If this isn't provided, the
                        DJANGO_SETTINGS_MODULE environment variable will be
                        used.
  --pythonpath=PYTHONPATH
                        A directory to add to the Python path, e.g.
                        "/home/djangoprojects/myproject".
  --traceback           Raise on exception
  --version             show program's version number and exit
  -h, --help            show this help message and exit

Type 'manage.py help <subcommand>' for help on a specific subcommand.

Available subcommands:

[django]
    check
    cleanup
    compilemessages
    createcachetable
    dbshell
    diffsettings
    dumpdata
    flush
    inspectdb
    loaddata
    makemessages
    runfcgi
    runserver
    shell
    sql
    sqlall
    sqlclear
    sqlcustom
    sqldropindexes
    sqlflush
    sqlindexes
    sqlinitialdata
    sqlsequencereset
    startapp
    startproject
    syncdb
    test
    testserver
    validate
like image 667
Tomas Jacobsen Avatar asked Jun 27 '13 08:06

Tomas Jacobsen


1 Answers

It's possible that Django is loading the wrong settings file. See this question for details: Django: Can't run custom commands

Try raising an exception at the top of your settings.py file; that will let you know if the file is even being loaded.

like image 58
georgebrock Avatar answered Nov 12 '22 21:11

georgebrock