바뀜
→config/urls.py 수정
urlpatterns = [
urlpatterns = [
path('주소/', 뷰), # 해당 주소로 들어가면 뷰를 실행한다.(뷰는 위에서 import해와야 한다.)
path('주소/', 뷰), # 해당 주소로 들어가면 뷰를 실행한다.(뷰는 위에서 import해와야 한다.) 뷰 함수를 불러올 때 ()는 생략한다.
path('', a) # http://도메인 으로 접속하면 a함수와 연결된다.
path('', a) # http://도메인 으로 접속하면 a함수와 연결된다.
path('test/', test) # http://도메인/test/ 로 접속하면 test 함수와 연결된다.
path('test/', test) # http://도메인/test/ 로 접속하면 test 함수와 연결된다.
앱으로 넘겨줄 url을 <code>path('앱이름/', include('앱이름.urls')),</code> 형태로 고치면 앱이름 주소와 매칭되는 모든 URL을 앱이름.urls로 넘긴다. [http://xn--hq1bm8jm9l/%EC%95%B1%EC%9D%B4%EB%A6%84/ http://도메인/앱이름/] 으로 시작되는 모든 주소를 앱의 urls.py로 넘겨준다는 의미이다.(#이후경로 매핑을 위해 주소 뒤에 /를 붙여준다.)<syntaxhighlight lang="python">
앱으로 넘겨줄 url을 <code>path('앱이름/', include('앱이름.urls')),</code> 형태로 고치면 앱이름 주소와 매칭되는 모든 URL을 앱이름.urls로 넘긴다. [http://xn--hq1bm8jm9l/%EC%95%B1%EC%9D%B4%EB%A6%84/ http://도메인/앱이름/] 으로 시작되는 모든 주소를 앱의 urls.py로 넘겨준다는 의미이다.(#이후경로 매핑을 위해 주소 뒤에 /를 붙여준다.)<syntaxhighlight lang="python">
from django.urls import path, include
from django.urls import path, include
urlpatterns = [
urlpatterns = [
path('주소/', include('앱이름.urls')),
path('주소/', include('앱이름.urls')),
past(.....)
past(.....)