Я попытался установить ROOT_URLCONF
в settings.py в моем проекте (называемом регистрацией) на множество строк: ROOT_URLCONF = 'registration.urls'
, ROOT_URLCONF = 'foo.urls'
, ROOT_URLCONF = 'monkey.urls'
, ROOT_URLCONF = 'registration.registration.urls'
.Почему Django игнорирует настройку 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.
Почему? Вот файл, который я использую для настройки Passenger (пассажир_wsgi.py). Этот файл находится в «/ 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/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 и возвращая тот же вывод, каждый раз, когда я получить доступ к моей домашней странице?