Commit 228ef982 authored by James Esguerra's avatar James Esguerra

Handled POST request of HomeForm

parent 9e1c35a8
...@@ -4,5 +4,11 @@ from .forms import HomeForm ...@@ -4,5 +4,11 @@ from .forms import HomeForm
def ShowHome(request): def ShowHome(request):
if request.method == 'POST':
form = HomeForm(request.POST)
if form.is_valid():
name = form.cleaned_data['name']
return render(request, 'home2.html', {'name': name})
form = HomeForm() form = HomeForm()
return render(request, 'home.html', {'form': form}) return render(request, 'home.html', {'form': form})
{% extends 'base.html' %}
{% block title %} Your Bujo {% endblock %}
{% block header %} Your Bullet Journal {% endblock %}
{% block content %}
<h1> Hello, {{ name }}! Today is going to be a great day! </h1>
{% endblock %}
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