lucrae/django-cheat-sheet

Unclear writing in creating a view

Inatigerdream opened this issue · 0 comments

Unclear about some of this guide. After you say open urls.py you give some code. Then after that you say open urls.py and give MORE code and say to insert that. Where does the first code snippet go?

📺 Creating a view

**Still within the app directory, open (or create) urls.py

from django.urls import path
from . import views

urlpatterns = [
    path('', views.index, name='index'),
]

Now within the project directory, edit urls.py to include the following**

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

urlpatterns = [
    path('app/', include('app.urls')),
    path('admin/', admin.site.urls),
]