[Answer]-Django – Serving Media/Admin files in production with Apache/Webfaction

1👍

If you configured your Apache to serve the static files from the respective root folders, you also have to run manage.py collectstatic (see docs).

To test static and media files I usually have this in my urls.py:

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

Leave a comment