Hi.
Try putting your (r'^static/(?P<path>.*)$',
'django.views.static.serve', {'document_root': 'static'}), line of
urlconf in if clause.
It works for me.
This way you avoid confusion between your server and your django
urlconf.
The full solution requires you to import settings. The code should
look something like that:

from django.conf import settings

# here the contents of your urlconf

if settings.DEBUG:
    urlpatterns += patterns('',
   (r'^static/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': '/your/path/to/static'}),
    )


On 24 Sie, 16:57, Shamail Tayyab <pleoma...@gmail.com> wrote:
> Hi,
>
>    I am facing an issue where I cannot get the admin interface working
> properly when running mod_python. Although when running it using
> development server, its works fine.
>
> Problem:
>   Admin interface is missing the static contents, like css, the
> interface comes though.
>
> Related info:
>   OS: Ubuntu 10.04.
>
>   urls.py - related info
>
>  10 urlpatterns = patterns('',
>  11       (r'^admin$', include(admin.site.urls)),
>  12       (r'^simpleadmin$', adminview ),
>  13       (r'^static/(?P<path>.*)$', 'django.views.static.serve',
> {'document_root': 'static'}),
>
>   virtual host configuration:
>   <Location "/">
>       SetHandler python-program
>       PythonHandler django.core.handlers.modpython
>       SetEnv DJANGO_SETTINGS_MODULE chatty.settings
>       PythonPath "['/usr/local/test', '/usr/local/test/chatty'] +
> sys.path"
>       PythonDebug On
>                 AuthType basic
>                 AuthName 'Developers access'
>                 AuthUserFile /etc/cgi-password2
>                 Require valid-user
>    </Location>
>    <Location "/static/">
>        SetHandler None
>    </Location>
>     <Directory "/usr/local/test/chatty/static/">
>         Options Indexes MultiViews FollowSymLinks
>         AllowOverride all
>     </Directory>
>
> Test cases:
>   On accessing something likehttp://www.host.com/media/css/base.css
> it gives 404 Not Found.
>
> Thanks and Regards
>
> --
> Shamail Tayyab
> Blog:http://shamail.in/blog

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to