我的问题是如何让我的 Django 管理站点在 Apache 下被格式化(非常漂亮),就像它在 runserver 下的方式一样?我可以打开它并登录它,但它的格式并不完全正确。
我的 urls.py 文件没有什么特别之处
from django.conf.urls.defaults import *
from django.contrib import admin
from amr.views import hello
admin.autodiscover()
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
('^hello/$', hello),
# Example:
# (r'^amr/', include('amr.foo.urls')),
# Uncomment the admin/doc line below to enable admin documentation:
# (r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
(r'^admin/', include(admin.site.urls)),
)
这是我的 apache 配置。
<Location />
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE settings
PythonOption django.root /home/amr/django/amr
PythonPath "['/home/amr/django', '/home/amr/django/amr', '/usr/local/lib
/site-packages/django'] + sys.path"
PythonDebug On
</Location>