Saturday, 14 September 2013

Django on Azure not loading static files

Django on Azure not loading static files

I followed the tutorial below to create a django project on azure:
http://www.windowsazure.com/en-us/develop/python/tutorials/web-sites-with-django/
Everything worked fine until I tried to install the
django_admin_bootstrapped app. Now all static requests return 404 error. I
don't if the new app caused the problem or just exposed it.
I have this:
STATIC_ROOT = ''
# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'
# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
#os.path.join(PROJECT_DIR,
'site-packages/django_admin_bootstrapped/static'),
)
I read quite a bit online and some people say you have to configure your
server to serve static files. I don't have direct access to the server,
it's an azure website and I deploy through git. And like I said, the admin
and everything used to work before I tried to install these apps that
bootstrap the admin. Now even when the app is not under INSTALLED_APPS I
don't get any css or js files.
Thanks!

No comments:

Post a Comment