Reputation: 14783
I'm just crushing my head about how to setup my URL settings in order they serve the static files correctly.
For development my URL settings look like this.
(r'^static/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.STATIC_ROOT, 'show_indexes': True}),
But I assume I have to change this setting because django.views.static.serve is intended to be used only for development. At least this was stated in the docs for Django 1.1. Whereas no disclaimer to be found in the docs for Django 1.4, which I'm currently using.
I'm using django-storages with s3 to serve the static files.
Upvotes: 0
Views: 777
Reputation: 884
you don't need to add anything to your urls.py file as your files are served from S3.
use the django builtin view for your development server and for production, just set the rights paths for STATIC_URL and STATIC_ROOT in your settings.py file.
STATIC_URL = 'http://s3.amazonaws.com/yourbucket/'
Upvotes: 3
Reputation: 3373
I would use django cumulus It has great documentation, i've used it successfully to serve static files from amazon and rackspace cdn
Cumulus docs will show you exactly what to do in your settings file for static config
If you don't want to - set your static URL to your amazon bucket in my case i'm using rackspace so my static url looks like: STATIC_URL = '//csk3ls.r93.d2.rackcdn.com/'
Upvotes: 1