Debug set on False and not load styles and pictures

75 views Asked by At

I have a problem with static css files. I added to your application (in django 1.8) Page 404 - 404 page template and code in a file urls.py:

handler404 = 'django.views.defaults.page_not_found'

My STATIC_ROOT:

STATIC_ROOT = os.path.join(BASE_DIR, 'public_assets') 

In settings.py file, I have the code:

Debug = False
ALLOWED_HOSTS = ['*',]
ALLOWED_HOSTS = ['localhost', '127.0.0.1',] - also doesn't work

After starting website, do not load styles and pictures.

1

There are 1 answers

1
Ravi Kumar On

Not sure this will work are not

if not settings.DEBUG:
    urlpatterns += patterns('',
                 (r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT, 'show_indexes':True}),
            )

add above at the end of root urls.py and run collectstatic