找不到我尝试过的网址的NoReverseMatch并且 {%url'/ feedback / form /'%}
我正在使用反馈应用程序。
#feedback\urls.py
from django.urls import path, include
from .views import request_feedback
urlpatterns = [
path('form/', request_feedback, name = 'get_feedback' ),
]
#feedback\views.py
def request_feedback(request):
if request.method == 'POST':
feedback_form = FeedBackForm(request.POST)
if feedback_form.is_valid():
feedback_form.save()
return redirect('')
else:
feedback_form = FeedBackForm()
return render(request, 'feedback/feedbackform.html', {'feedback_form':feedback_form})
#webapp\urls.py
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('feedback/', include("feedback.urls")),
path('user/',include("user.urls")),
]
我收到此错误 / feedback / form /
处的NoReverseMatch找不到与“”相反的字符。 ”不是有效的视图函数或模式名称
我正在使用python 3.7和Django 2
我确实缓解了这个问题