setting debug to false

32 views
Skip to first unread message

Nenad Cikic

unread,
Jun 8, 2012, 12:53:31 PM6/8/12
to django...@googlegroups.com
Hello,
is there any known reason why I can not see my static files when setting debug to false in the settings.py?
Just setting debug to True all is OK.

Thanks
Nenad

Javier Guerra Giraldez

unread,
Jun 8, 2012, 3:18:03 PM6/8/12
to django...@googlegroups.com
On Fri, Jun 8, 2012 at 11:53 AM, Nenad Cikic <nenad...@gmail.com> wrote:
> is there any known reason why I can not see my static files when setting
> debug to false in the settings.py?
> Just setting debug to True all is OK.

you need to run the collectstatic management command
(https://docs.djangoproject.com/en/1.4/ref/contrib/staticfiles/#django-admin-collectstatic)



--
Javier

Nenad Cikic

unread,
Jun 8, 2012, 11:27:53 PM6/8/12
to django...@googlegroups.com
Yes, I know about that, but I just wanted to test with runserver and debug=False (I have done my 404.html and with debug=True it does not shows up)
Isn't the collectstatic command when you want to pass to deployment server?
Thanks
Nenad

Nenad Cikic

unread,
Jun 8, 2012, 11:45:17 PM6/8/12
to django...@googlegroups.com
I have managed to solve using the
http://stackoverflow.com/questions/6363728/why-cant-i-get-my-static-dir-to-work-with-django-1-3
by adding to url
url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT } ),

where I have first collected to STATIC_ROOT with collectstatic
Whn it will come to deployment, we will see what happens.
Thanks
Nenad
Reply all
Reply to author
Forward
0 new messages