As I put in my second post. Static serving is not working (by default) when you turn debugging off unless you provide --insecure option on manage.py runserver command. That is by design. Though with you should see improperly configured exception raised if you try to use forcefully static serving view (url is not even added when debug is false thus you should just see 404 errors if you use recommended staticfiles configuration pattern).
Read carefully implications of using staticfiles app and how it replaces runserver command: https://docs.djangoproject.com/en/1.4/ref/contrib/staticfiles/#runserver HTH. On Mon, Sep 10, 2012 at 3:57 PM, Karambir Singh Nain <akaram...@gmail.com>wrote: > Yeah. during, debug=true, it is serving fine from static_root. But not > when debug is false. > > > On Monday, September 10, 2012 2:01:03 AM UTC+5:30, Jani Tiainen wrote: > >> I suppose that your frontend webserver is serving files from url /static/ >> from path that STATIC_ROOT points to? >> >> On Sun, Sep 9, 2012 at 10:23 PM, Karambir Singh Nain >> <akar...@gmail.com>wrote: >> >>> I have a fairly simple django project having some views, templates and >>> static files like css and images. My settings file include : >>> >>> STATIC_ROOT = '/home/karambir/Codes/**projects/cdi/cdi/static' >>> STATIC_URL = '/static/' >>> STATICFILES_DIRS = ( >>> '/home/karambir/Codes/**projects/cdi/cdi/data', >>> ) >>> TEMPLATE_DIRS = ( >>> '/home/karambir/Codes/**projects/cdi/cdi/templates' >>> ) >>> >>> So I serve static files with {{ STATIC_URL }} in the templates. And it >>> is working fine when DEBUG is TRUE but every static file breaks when debug >>> is set to false. Then I tried with django admin, it was also broken. So I >>> run a ./manage.py collectstatic command. And then admin css works fine but >>> my own files still not. I saw in the url of the loaded html page and it >>> shows correct url and it is not loading. >>> How can I know what is the main problem. What changes takes place when >>> debug is set to false? >>> (I'm running django1.4) >>> >>> Thanks >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Django users" group. >>> To view this discussion on the web visit https://groups.google.com/d/** >>> msg/django-users/-/**fWCsL9PUI1EJ<https://groups.google.com/d/msg/django-users/-/fWCsL9PUI1EJ> >>> . >>> To post to this group, send email to django...@googlegroups.com. >>> To unsubscribe from this group, send email to django-users...@** >>> googlegroups.com. >>> >>> For more options, visit this group at http://groups.google.com/** >>> group/django-users?hl=en<http://groups.google.com/group/django-users?hl=en> >>> . >>> >> >> >> >> -- >> Jani Tiainen >> >> - Well planned is half done, and a half done has been sufficient before... >> >> -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/W-IOauTb9dQJ. > > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- Jani Tiainen - Well planned is half done, and a half done has been sufficient before... -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.