Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
BuJo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jose Luis Bautista
BuJo
Commits
013cca61
Commit
013cca61
authored
Mar 30, 2021
by
Jose Luis Bautista
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Home page name feature implemented
parent
0ea1e560
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
7 deletions
+17
-7
views.cpython-39.pyc
BauJo/BauJo/__pycache__/views.cpython-39.pyc
+0
-0
home.html
BauJo/BauJo/templates/home.html
+1
-1
views.py
BauJo/BauJo/views.py
+16
-6
No files found.
BauJo/BauJo/__pycache__/views.cpython-39.pyc
View file @
013cca61
No preview for this file type
BauJo/BauJo/templates/home.html
View file @
013cca61
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
<h1>
Hello! What is your name?
</h1>
<h1>
Hello! What is your name?
</h1>
<form
method =
"POST"
>
<form
url =
"home"
method =
"POST"
>
{% csrf_token %}
{% csrf_token %}
{{ form }}
{{ form }}
<input
type=
"submit"
name=
"submit"
id =
"submit"
value =
"Submit Name"
>
<input
type=
"submit"
name=
"submit"
id =
"submit"
value =
"Submit Name"
>
...
...
BauJo/BauJo/views.py
View file @
013cca61
...
@@ -4,14 +4,24 @@ from django.views import View
...
@@ -4,14 +4,24 @@ from django.views import View
from
datetime
import
datetime
from
datetime
import
datetime
from
.forms
import
home
,
profile
,
key
,
this_week
,
today
from
.forms
import
home
,
profile
,
key
,
this_week
,
today
name
=
None
form
=
None
def
page_home
(
request
):
def
page_home
(
request
):
if
request
.
method
==
'POST'
:
global
name
form
=
home
(
request
.
POST
)
global
form
if
form
.
is_valid
():
return
render
(
request
,
'home.html'
,
{
'form'
:
form
,
'name'
:
form
.
cleaned_data
[
'name'
]})
if
name
==
None
:
if
request
.
method
==
'POST'
:
form
=
home
(
request
.
POST
)
if
form
.
is_valid
():
name
=
form
.
cleaned_data
[
'name'
]
return
render
(
request
,
'home.html'
,
{
'form'
:
form
,
'name'
:
name
})
else
:
form
=
home
()
return
render
(
request
,
'home.html'
,
{
'form'
:
form
})
else
:
else
:
form
=
home
()
return
render
(
request
,
'home.html'
,
{
'form'
:
form
,
'name'
:
name
})
return
render
(
request
,
'home.html'
,
{
'form'
:
form
})
def
page_profile
(
request
):
def
page_profile
(
request
):
return
render
(
request
,
'profile.html'
)
return
render
(
request
,
'profile.html'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment