当我在 urls.py app_name = 'user_homeview' 中写入时,header.html 中发生错误我如何解决此错误你能告诉我我无法解决错误但请告诉我..在下面的 html 文件中写入 href="{ %url 'userprofile' i.user %}" 在 urls.py 中写入 app_name='' 后出现错误,请告诉我如何解决
head.html
{% for i in userpofile %}
<img src="{{i.userImage.url}}" href="{%url 'userprofile' i.user %}" class="align-self-start img-responsi img-circle tm-border " alt="...">
<a href="{%url 'userprofile' i.user %}" >{{i.user}}</a> 
{% endfor %}
urls.py
app_name = 'user_homeview'
urlpatterns = [
path('', views.user_home,name='e'),
path("user/follow/<str:username>", views.follow, name="follow"),
path('postWrite', views.postWrite ,name='post'),
path('post', views.post ,name='post'),
path('like_dislike', views.likePost ,name='like_dislike_post'),
path('slug/comment', views.comment ,name='comment'),
path("delete/<int:ID>",views.delpost,name="delpost" ),
path("search/", Search_User.as_view(), name="search_user"),
path("<str:username>",views.userProfile,name="userprofile" ),
path("<str:username>/edit", EditProfile.as_view(), name="editprofile"),