Django 2.0.6 manage.py runserver错误

时间:2018-06-08 06:11:28

标签: django-2.0

我是python的新手,也尝试学习Django版本2.0.6,所以当我尝试用Django的文档编写代码时:here

如果遇到问题,特别是当我想运行代码时,请帮我解决这个问题。 enter image description here

1- code(urls.py)文件夹轮询: enter image description here

    from django.urls import path
    from . import views
urlpatterns = [

    path('',views.index, name= 'index'),

]

2- code(urls.py)文件夹mysite: enter image description here

    from django.contrib import admin
    from django.urls import include,path

urlpatterns = [
    path('admin/', admin.site.urls),
    path('polls/',include('polls.Urls'))

]

3- code(views.py)文件夹mysite: enter image description here

    from django.http import HttpResponse

def index(request):
    return  HttpResponse("Hi world, you are walcome")

0 个答案:

没有答案