Got a simple Django app, for some reason GET renders template as expected, but POST with exactly the same code does not error but also does not render either:
I've spent a lot of time looking for a reason for this and assume either I'm missing something stupid or a change in Django 2.2?
class MyView(View):
template_name = "index.html"
def get(self, request):
return render(request, self.template_name, context={'test':'get_test'})
def post(self, request):
return render(request, self.template_name, context={'test':'post_test')
urlpatterns = [
path('index/', MyView.as_view(), name='index'),
]
<h2>{{ test }}</h2>
Hopefully I haven't simplified the example beyond the point of making sense, but in the example I wish to simply render post_test following a POST which should render the entire page again.