django 1.2 can not use 1.1+
akumria opened this issue · comments
It is not clear to me whether or not Django 1.2 is supposed to be able to use django-staticfiles 1.1+
The changelog for v1.1 says:
"Updated list of supported Django versions: 1.2.X, 1.3.X and 1.4.X"
However with Django 1.2.7 and django-staticfiles v1.1.2, configured with:
in settings.py
STATIC_ROOT = os.path.join(ROOT_PATH, '..', 'docroot')
STATIC_URL = '/static-new/'
STATICFILES_DIRS = (
os.path.join(ROOT_PATH, 'static'),
)
Running collectstatic returns:
% python film/manage.py collectstatic -h
Traceback (most recent call last):
File "film/manage.py", line 11, in <module>
execute_manager(settings)
File "/home/anand/Work/<company>/<org>-env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/home/anand/Work/<company>/<org>-env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/anand/Work/<company>/<org>-env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 261, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/home/anand/Work/<company>/<org>-env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 68, in load_command_class
return module.Command()
File "/home/anand/Work/<company>/<org>/film/apps/staticfiles/management/commands/collectstatic.py", line 54, in __init__
self.storage.path('')
File "/home/anand/Work/<company>/<org>-env/local/lib/python2.7/site-packages/django/utils/functional.py", line 276, in __getattr__
self._setup()
File "/home/anand/Work/<company>/<org>/film/../film/apps/staticfiles/storage.py", line 262, in _setup
self._wrapped = get_storage_class(settings.STATICFILES_STORAGE)()
File "/home/anand/Work/<company>/<org>-env/local/lib/python2.7/site-packages/django/utils/functional.py", line 277, in __getattr__
return getattr(self._wrapped, name)
AttributeError: 'Settings' object has no attribute 'STATICFILES_STORAGE'
This is because their is no default settings.py file within the staticfile app (as in v1.0.1).
Using staticfiles 1.0.1 and the collectstatic command works fine.
I'm not sure what's going on here, but the latest staticfiles does run on Django 1.2.
The tests pass: https://ci.enn.io/job/django-staticfiles/TOXENV=py26-1.2.X/
Your assumption about the settings.py in the app is wrong as the newer django-staticfiles has been using django-appconf, and defined the STATICFILES_STORAGE
setting here: https://github.com/jezdez/django-staticfiles/blob/develop/staticfiles/conf.py#L21
If you can show me a test case or an easy to use example project to show how this breaks for you, I'd be happy to try to fix it. But from my perspective staticfiles just works fine on 1.2.X.
Closing for now as I can't reproduce the problem.