打扰了各位
到配置 url.py 的时候,我的url.py 的内容还是
from django.contrib import admin from django.urls import path from . import views urlpatterns = [ path('admin/', admin.site.urls), path('', views.index), ]
和老师显示的不一样,浏览器会报错
请教下如何修改
到配置 url.py 的时候,我的url.py 的内容还是
from django.contrib import admin from django.urls import path from . import views urlpatterns = [ path('admin/', admin.site.urls), path('', views.index), ]
和老师显示的不一样,浏览器会报错
请教下如何修改
2019-07-19
from django.contrib import admin from django.urls import path from django.conf.urls import url,include from . import views app_name = '[blog]' urlpatterns = [ # path('admin/', admin.site.urls), path('index/', views.index), path('article/<int:article_id>/', views.article_page, name='article_page'), path('edit/', views.edit_page(),name='edit_page'), path('index/action', views.edit_action,name='edit_action'), ]
#我用的python3.7和django2.2.7版本 from django.urls import path from . import views urlpatterns = [ path("index/", views.index), path("article/<article_id>", views.article_page, name="article_page"), path("edit/<article_id>", views.edit_page, name="edit_page"), path("edit/action/", views.edit_action, name="edit_action"), ]
举报