URLs not working on Nginx + Django. Everything goes to the welcome page
I know there are other answers concerning this topic, and I've been through them all and couldn't solve my problem!
Basically I have the same problem described here. No matter what I put after / in the URL, I always get the welcome page.
Here's the 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)),
)
and here's the Nginx config file:
server {
listen 80;
listen [::]:80 default ipv6only=on;
server_name glic.bauleo.com.br;
access_log /home/gli开发者_JAVA技巧c.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;
}
}
Also, here's the INSTALLED_APPS I forgot
You can go to http://glic.bauleo.com.br to test it. I've spent 5 hours reading articles and posts and trying to fix this but I couldn't find the solution. BTW, I'm running Ubuntu 10.10 x86 on a VPS.
Thanks in advance!
EDIT: Forgot to post the 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',
)
most probably you do not have anything in INSTALLED_APPS
in settings.py
at least there are no 'django.contrib.admin' and 'glic' apps.
精彩评论