-
[Python] Django urls.py, views.py 초기 세팅Python/Django 2021. 11. 30. 17:21
# urls.py of project foler from django.contrib import admin from django.urls import path, include from first_app import views urlpatterns = [ path('admin/', admin.site.urls), path('', include('first_app.urls')), ]
# urls.py of app folder from django.urls import path from . import views urlpatterns = [ path('', views.index, name='index'), ]
'Python > Django' 카테고리의 다른 글
[Python] Django html 상속 extends (0) 2021.12.01 [Python] Django superuser (admin) 계정 만들기 (0) 2021.12.01 [Python] TypeError: __init__() missing 1 required positional argument: 'on_delete' (0) 2021.11.30 [Python] settings.py에 static folder 연결해서 html에서 사용하기 (0) 2021.11.20 [Python] views에서 html로 context 넘겨서 사용하기 (0) 2021.11.20