My Django app is running fine on my server when running it under "python manage.py runserver....." but when I run it under nginx/fastcgi I get a 404.
Here is the error message:
Page not found (404)
Request Method: GET
Request URL: blah.youtrain.me/admin/ (I removed the http due to StackOverflow constraints for new account)
Using the URLconf defined in youtrainme.urls, Django tried these URL patterns, in this order:
^admin/doc/
^admin/
The current URL, , didn't match any of these.
No matter what page on my app I go to under nginx, it always displays the same error message: "The current URL, , didn't match any of these."
Under nginx, if I just go to blah.youtrain.me the Request URL above changes to: blah.youtrain.me// <--- note the trailing slash. However, under runserver, there is no trailing slash in the Request URL line. This might give some insight?
Any help would be greatly appreciated! :)
Here is my nginx config for this site:
server
{
listen 80;
server_name blah.youtrain.me;
access_log /home/ytmadmin/public_html/blah.youtrain.me/log/access.log;
error_log /home/ytmadmin/public_html/blah.youtrain.me/log/error.log debug;
# rewrite rule - files
location ~* .+.>(xml|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|swf)
{
access_log off;
expires 30d;
break;
}
# python requests
location /
{
fastcgi_pass 127.0.0.1:8010;
fastcgi_pass_header Authorization;
fastcgi_intercept_errors off;
include /usr/local/nginx/conf/fastcgi_params;
}
}
And my urls.py
from django.conf.urls.defaults import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^$', 'main.views.index'),
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
(r'^admin/', include(admin.site.urls)),
)