jeudi 30 juillet 2015

More Django static 404 issues - paired with ember

I've seen lots of different posts regarding the Django static file issues. Unfortunately, none of them seem to help me. My django admin css is fine, however static files are giving my a 404 error. Here is a description of what my problem:

In settings.py:

STATIC_URL = '/static/'
STATIC_ROOT = '/Users/me/develop/ember/myproj/static/'

In urls.py:

urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
    ...
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

My project directory:

> static
  > myproj
    > app
      > templates
        > ember.hbs
    > img
      > test.jpg

Inside my ember.hbs I reference the test.jpg, but I get a 404 error. It's weird because I can actually pull up the image using:
file:///Users/me/develop/ember/proj/static/myproj/img/test.jpg

I have no idea what to do to fix this, I've tried using the STATICFILES_DIRS method mentioned here: http://ift.tt/1EF8GkR but nothing seems to be working.

Thanks in advance!




Aucun commentaire:

Enregistrer un commentaire