django2.1.7,python3.7点击提交没有反应
edit_page:(<from action="/blog/edit_action/" method="post">这地方对吗)
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Edit Page</title> </head> <body> <from action="/blog/edit_action/" method="post"> <label>文章标题 <input type="text" name="title"/> </label> <br/> <label>文章内容 <input type="text" name="content"/> </label> <br/> <input type="submit" value="提交"> </from> </body> </html>
blog/urls:
from django.urls import path from . import views app_name = 'blog' urlpatterns = [ path('', views.index, name='index'), path('article_page/<int:article_id>/', views.article_page, name='article_page'), path('edit/', views.edit_page, name='edit_page'), path('edit/action/', views.edit_action, name='edit_action'), ]
view.py:完全是按照视频中来的,但是
from django.shortcuts import render from django.http import HttpResponse from . import models
第二段一直是灰色不关联状态……