I forgot to say that my problem is different from http://docs.djangoproject.com/en/dev/howto/deployment/modpython/#id3 , as I want to use my custom css and js that lives in myproj/myapp/ static but not those that live ni django/contrib/admin/media. What is more, I wouldn't want to change anything in django directory source code.
Thanks. On Oct 29, 11:55 am, anonymous <[EMAIL PROTECTED]> wrote: > The custom admin templates I've put into my application templates/ > admin folder are ignored when I'm using apache2 (http:// > myapp.mydomain.org) but are running when I'm using runserver (http:// > localhost:8000). > On the contrary, custom admin css and js are running when using > apache2 but aren't when using runserver. > How could I fix this? > > My configurations: > > myproj/urls.py > ------------------- > from django.contrib import admin > from settings import MEDIA_ROOT > admin.autodiscover() > urlpatterns = patterns('', > (r'^static/(?P<path>.*)$', 'django.views.static.serve', > {'document_root': MEDIA_ROOT , 'show_indexes': True}), > (r'^myapp/', include('myproj.myapp.urls')), > (r'^(.*)', admin.site.root), > ) > > myproj/settings.py > ------------------- > ... > MEDIA_ROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), > "static/") > MEDIA_URL = 'http://myapp.mydomain.org/static/' > ADMIN_MEDIA_PREFIX = '/static/' > ... > > The templates directory: > ------------------- > myproj/templates/admin > myproj/templates/admin/myapp > myproj/templates/myapp > > The apache2 virtual domain: > ------------------- > <VirtualHost *:80> > ServerName myapp.mydomain.org > DocumentRoot "/home/user/myproj" > <Directory "/home/user/myproj"> > Order allow,deny > Allow from all > Options All > </Directory> > <Location "/"> > SetHandler python-program > PythonHandler django.core.handlers.modpython > SetEnv DJANGO_SETTINGS_MODULE myproj.settings > PythonPath "['/home/user','/home/user/myproj']+sys.path+['/home/ > user/myproj/django']" > PythonDebug On > PythonAutoReload Off > </Location> > Alias /static /home/user/myproj/static/ > <Location "/static"> > SetHandler None > </Location> > <LocationMatch "\.(jpg|gif|png)$"> > SetHandler None > </LocationMatch> > </VirtualHost> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---