On Dec 23, 10:38 am, "[email protected]"
<[email protected]> wrote:
> Hello,
>
> I am having some trouble serving static files with the development
> server. I have read the docs and various blogs out there and nothing
> seems to work. I am going nuts over this :) I have tried tweaking the
> values in my settings.py but I reverted them back to their defaults.
> Below is the info for my project.
>
> myProject/
> templates/
> appX/
> admin/
> media/
> appX/
> css/
> img/
> admin/
> css/
> img/
>
> settings.py
> BASE_PATH=os.path.dirname(__FILE__)
> MEDIA_ROOT=BASE_PATH+/media
> MEDIA_URL=/media/
> ADMIN_MEDIA_PREFIX
>
> In, myProject/templates/base.html I link the css as, "/media/appX/css/
> default.css"
>
> urls.py
>
> (r'^site_media/(?P<path>.*)$', 'django.views.static.serve',
> {'document_root': '/webapps/myProj/media' }),
Your MEDIA_URL is /media/ but urls.py is hooked into /site_media/.
Change your URL config to the following:
(r'^media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': '/webapps/myProj/media' }),
-Rajesh D
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---