我只是安装了apache和django。
django默认页面工作正常:
有效!
这是此服务器的默认网页。
网络服务器软件正在运行,但尚未添加任何内容。
但/ admin / site not:
未找到
在此服务器上找不到请求的URL / admin /。
Apache / 2.2.17(Ubuntu)服务器,位于69.162.92.53端口80
Apache conf(/etc/init.d/apache2/sites-avaliable/mysite.conf)文件:
<VirtualHost *:80>
WSGIScriptAlias / /var/www/mysite/mysite/wsgi.py
ServerName mysite.com.br
Alias /static /var/www/mysite/media/static/
<Directory /var/www/mysite/mysite>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
wsgi文件(/var/www/mysite/mysite/wsgi.py):
import os
import sys
sys.path.insert(0, '/var/www/mysite')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
Django mysite.settings(/var/www/mysite/mysite/settings.py):
...
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
)
...
Django mysite.urls(/var/www/mysite/mysite/urls.py):
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'mysite.views.home', name='home'),
# url(r'^mysite/', include('mysite.foo.urls')),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
)
这就是全部。我错过了什么吗?
谢谢!
答案 0 :(得分:1)
这是一个apache配置错误。
我相信你应该指着: -
<Directory /var/www/mysite>
Order allow,deny
Allow from all
</Directory>