python3.7 urls.py 里怎么写?!
请问老师,python3.7版urls.py文件里已经用path代替url, from django.urls import path, 那么下面2句话用path怎么写呢?谢谢。
url(r'^$', IndexView.as_view(), name='index'),
url(r'^address/(\d+)$', AddressAPI.as_view(), name='address'),
********************* urls.py ********************************
from django.conf.urls import url
from django.contrib import admin
from courses.views import IndexView, AddressAPI
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^$', IndexView.as_view(), name='index'),
url(r'^address/(\d+)$', AddressAPI.as_view(), name='address'),
]