我在创建新应用程序(模拟器管理(时遇到此错误:
包含的 urlconf '
以下是相关文件:
urls.py
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.emulatorsMgmt.as_view(),name='emulatorsMgmt'),
]
views.py:
from django.shortcuts import render
from django.views.generic import View
# Create your views here.
class emulatorsMgmt(View):
def get(self, request):
return render(request, 'hello.html')
hello.html 存在于模板/模拟器管理文件夹中。此外,我在中央项目的 urls.py 中进行了以下添加:
url(r'^emulatorsMgmt/', include('apps.emulatorsMgmt'))
我还在我的 setting.py 目录中添加了该应用程序。 我想知道我哪里出错了。任何帮助将不胜感激!
您错误地将应用程序 url 包含在根 urlconf 中。我认为应该是:
url(r'^emulatorsMgmt/', include('apps.emulatorsMgmt.urls'))