0

I'm new on python and also try to learn a Django version 2.0.6 , so when i try to write the code with the documentation of Django here:

here

If faced a problem, specifically when I want to run the code, could help me to solve that issue please. enter image description here

1- code (urls.py)folder polls:

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

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

]

2- code (urls.py) folder mysite:

    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) folder mysite:

from django.http import HttpResponse

def index(request):
    return  HttpResponse("Hi world, you are walcome")
imxitiz
  • 3,920
  • 3
  • 9
  • 33

0 Answers0