我正在尝试部署位于home / doga / hendnd /的django项目,并且只是在localhost上运行它(将是一个可访问LAN的项目)。我的主要问题是我可以很好地使用该网站,但/ admin /文件夹给我Internal Server Error
错误。
无论如何这里是我的etc / apache2 / sites-available / default file
<VirtualHost *:80>
ServerName /
ServerAlias */
DocumentRoot /home/doga/headend/
LogLevel warn
WSGIScriptAlias / /home/doga/headend/apache/django.wsgi
Alias /media /home/doga/headend/media/statics
Alias /admin_media /usr/lib/python2.4/site-packages/django/contrib/admin/media
</VirtualHost>
这是我的家/ doga / headend / apache / django.wsgi文件
import os, sys
import django.core.handlers.wsgi
sys.path.append('/home/doga/')
sys.path.append('/home/doga/headend')
os.environ['DJANGO_SETTINGS_MODULE'] = 'headend.settings'
application = django.core.handlers.wsgi.WSGIHandler()
最后我的主要url.py
from django.conf.urls.defaults import *
from django.conf import settings
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Example:
# (r'^headend/', include('headend.foo.urls')),
# Uncomment the admin/doc line below and add 'django.contrib.admindocs'
# to INSTALLED_APPS to enable admin documentation:
(r'^table/(?P<pid>.*)/$', 'main.views.table_view'),
(r'^graph/(?P<pid>.*)/$', 'main.views.graph_view'),
(r'^graph/$', 'main.views.platform_graph_view'),
(r'^table/$', 'main.views.platform_view'),
(r'^csv/$', 'main.views.csv_view'),
(r'^recent/$', 'main.views.recent_view'),
(r'^$', 'main.views.main_view'),
(r'^cs/(?P<number>.*)/$', 'main.views.ch_view'),
#(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
(r'^admin/', include(admin.site.urls)),
#(r'^$', 'main.views.main_view'),
#(r'^media/(?P<path>.*)$', 'django.views.static.serve',
# {'document_root': '/home/uluc/headendmedia/statics'}),
)
答案 0 :(得分:0)
我认为你不应该将DocumentRoot
设置为/home/doga/headend
。这不会访问您的所有源代码吗?
Apache日志为内部服务器错误提供了哪些详细信息?