Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot import name 'AppStaticStorage' #30

Open
AncientSwordRage opened this issue Feb 18, 2015 · 0 comments
Open

Cannot import name 'AppStaticStorage' #30

AncientSwordRage opened this issue Feb 18, 2015 · 0 comments

Comments

@AncientSwordRage
Copy link

I have an djangular app called characters and I'm trying to understand how to do url routing in django/angular works.

I've added the finders:

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    'djangular.finders.NamespacedAngularAppDirectoriesFinder'
)

But I'm getting A server error occurred. Please contact the administrator. when I try to access http://localhost:8000/static/characters/index.html/ and then the traceback below

[18/Feb/2015 16:19:21] "GET /static/characters/index.html/ HTTP/1.1" 500 59
Traceback (most recent call last):
  File "C:\Python34\lib\wsgiref\handlers.py", line 137, in run
    self.result = application(self.environ, self.start_response)
  File "C:\Python34\lib\site-packages\django\contrib\staticfiles\handlers.py", line 65, in __call__
    return super(StaticFilesHandler, self).__call__(environ, start_response)
  File "C:\Python34\lib\site-packages\django\core\handlers\wsgi.py", line 187, in __call__
    response = self.get_response(request)
  File "C:\Python34\lib\site-packages\django\contrib\staticfiles\handlers.py", line 55, in get_response
    return self.serve(request)
  File "C:\Python34\lib\site-packages\django\contrib\staticfiles\handlers.py", line 48, in serve
    return serve(request, self.file_path(request.path), insecure=True)
  File "C:\Python34\lib\site-packages\django\contrib\staticfiles\views.py", line 33, in serve
    absolute_path = finders.find(normalized_path)
  File "C:\Python34\lib\site-packages\django\contrib\staticfiles\finders.py", line 248, in find
    for finder in get_finders():
  File "C:\Python34\lib\site-packages\django\contrib\staticfiles\finders.py", line 263, in get_finders
    yield get_finder(finder_path)
  File "C:\Python34\lib\functools.py", line 434, in wrapper
    result = user_function(*args, **kwds)
  File "C:\Python34\lib\site-packages\django\contrib\staticfiles\finders.py", line 272, in get_finder
    Finder = import_string(import_path)
  File "C:\Python34\lib\site-packages\django\utils\module_loading.py", line 26, in import_string
    module = import_module(module_path)
  File "C:\Python34\lib\importlib\__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1471, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "C:\Python34\lib\site-packages\djangular\finders.py", line 1, in <module>
    from . import storage
  File "C:\Python34\lib\site-packages\djangular\storage.py", line 3, in <module>
    from django.contrib.staticfiles.storage import AppStaticStorage
ImportError: cannot import name 'AppStaticStorage'

Any idea what I've done wrong?

In fact even running .\manage.py findstatic causes the same traceback!

@AncientSwordRage AncientSwordRage changed the title Cannot import name 'AppStaticStorage': default routing doesn't work Cannot import name 'AppStaticStorage' Feb 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant