我知道有关于这个主题的其他答案,我已经完成了所有这些并且无法解决我的问题!
基本上我有同样的问题here。无论我在URL之后放什么,我总是得到欢迎页面。
这是urls.py
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^lists/$', 'glic.lists.index'),
(r'^admin/', include(admin.site.urls)),
)
这是Nginx配置文件:
server {
listen 80;
listen [::]:80 default ipv6only=on;
server_name glic.bauleo.com.br;
access_log /home/glic.bauleo.com.br/log/access.log;
error_log /home/glic.bauleo.com.br/log/error.log;
location /admin_media {
alias /usr/local/lib/python2.6/dist-packages/django/contrib/admin/media/;
}
location /media {
alias /home/glic.bauleo.com.br/web/;
}
location / {
fastcgi_pass 127.0.0.1:8080;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
}
}
另外,这是我忘记的INSTALLED_APPS
您可以前往http://glic.bauleo.com.br进行测试。我花了5个小时阅读文章和帖子并尝试解决这个问题,但我找不到解决方案。 顺便说一句,我在VPS上运行Ubuntu 10.10 x86。
提前致谢!
编辑: 忘了发布INSTALLED_APPS:
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.admin',
'django.contrib.admindocs',
'lists',
)
答案 0 :(得分:1)
INSTALLED_APPS
settings.py
中很可能没有任何内容
至少没有'django.contrib.admin'和'glic'应用。