update: modified name of url to distinguish forum app templates

parent b3eb273a
......@@ -9,7 +9,7 @@
<div style = "position: relative; left:80px; top:30px;">
<form method="POST" action ="{% url 'forum:add' %}" enctype="multipart/form-data">
{% csrf_token %}
{{ user_form.as_p }}
{{ post_form.as_p }}
<button class="button" type="Save Post">Save Post</button>
<button onclick="location.href = '/forum'">Return to Forum Posts</button>
</form>
......
......@@ -5,6 +5,6 @@ app_name = "forum"
urlpatterns = [
path('', views.index, name="index"),
path('posts/<int:post_id>/details/', views.detail, name="detail"),
path('posts/add/', views.add, name="add"),
path('posts/add/', views.add, name="post_add"),
# path('welcome', views.welcome, name='welcome')
]
\ No newline at end of file
......@@ -29,4 +29,4 @@ def add(request):
return redirect("/forum")
else:
post_form = PostForm()
return render(request, "forum/add.html", {"post_form": post_form})
\ No newline at end of file
return render(request, "forum/post_add.html", {"post_form": post_form})
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment