File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -16,14 +16,17 @@ def get_context_data(self, **kwargs):
1616 context = super (HomeListView , self ).get_context_data (** kwargs )
1717 return context
1818
19+
1920def about (request ):
2021 """Renders the about page."""
2122 return render (request , "hello/about.html" )
2223
24+
2325def contact (request ):
2426 """Renders the contact page."""
2527 return render (request , "hello/contact.html" )
2628
29+
2730def hello_there (request , name ):
2831 """Renders the hello_there page.
2932 Args:
@@ -33,15 +36,14 @@ def hello_there(request, name):
3336 request , "hello/hello_there.html" , {"name" : name , "date" : datetime .now ()}
3437 )
3538
39+
3640def log_message (request ):
41+ form = LogMessageForm (request .POST or None )
3742 if request .method == "POST" :
38- form = LogMessageForm (request .POST )
39-
4043 if form .is_valid ():
4144 message = form .save (commit = False )
4245 message .log_date = datetime .now ()
4346 message .save ()
4447 return redirect ("home" )
4548 else :
46- form = LogMessageForm ()
4749 return render (request , "hello/log_message.html" , {"form" : form })
You can’t perform that action at this time.
0 commit comments