I am using the following in my urls.py:
(r'^media_/(?P<path>.*)$', 'django.views.static.serve',
{'document_root':
os.path.join(os.path.dirname(__file__), 'media').replace('\\','/')}),
Notice the '_' after 'media.
This allows me to access my media folder using for example:
http://127.0.0.1:8000/media_/css/css2.css
However, if i change it to:
(r'^media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root':
os.path.join(os.path.dirname(__file__), 'media').replace('\\','/')}),
Notice no '_' after 'media'.
I get the following error, trying to access 'http://127.0.0.1:8000/
media/css/css2.css' I get:
Page not found: C:\Python24\lib\site-packages\django/contrib/admin/
media\css/css2.css
So apparently when accessing 'media' it gets sent to '/contrib/admin/
media' instead of my media folder.
I also hace this in urls.py:
(r'^admin/', include('django.contrib.admin.urls')),
thanks,
Rodrigo
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---