我尝试在环境中设置<代码>ROOT_URLCONF。 py in my project ( known Registration) to a range of strings: ROOT_URLCONF = 登记:urls
,ROOT_URLCONF = foo.urls
,ROOT_URLCONF = mon.urls
,ROOT_URLCONF = 登记。
不管怎样,我还是把这一产出放在我的主页上:
Page not found (404)
Request Method: GET
Request URL: http://78.198.124.245/
Directory indexes are not allowed here.
You re seeing this error because you have DEBUG = True in your Django settings file.
Why is that? Here is the file I am using to configure Passenger (passenger_wsgi.py). This file is located in "/home/david/registration/registration/."
import os, sys
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "registration.settings")
# This application object is used by any WSGI server configured to use this
# file. This includes Django s development server, if the WSGI_APPLICATION
# setting points here.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
sys.path.append(os.getcwd())
sys.path.append("/home/david/registration/registration")
sys.path.append("/home/david/registration/registration/app")
/home/david/ Registration/urls.py就是如此。
from django.conf.urls import patterns, include, url, http
def myFunction(request):
return http.HttpResponse("A mapped URL")
urlpatterns = patterns( ,
(r ^$ , myFunction )
)
为什么我的Django申请完全无视我的ROOT_URLCONF,每当我进入我的主页时,就确定并归还同样的产出?