Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Ole Gabor Husebø
rodtrad
Commits
ab6a4c72
Commit
ab6a4c72
authored
Feb 18, 2020
by
Sander Høyland
Browse files
Basic django-struktur og noen sider
parent
6dadfd65
Changes
3
Hide whitespace changes
Inline
Side-by-side
.idea/58.iml
View file @
ab6a4c72
<?xml version="1.0" encoding="UTF-8"?>
<module
type=
"PYTHON_MODULE"
version=
"4"
>
<component
name=
"NewModuleRootManager"
>
<content
url=
"file://$MODULE_DIR$"
>
<excludeFolder
url=
"file://$MODULE_DIR$/venv"
/>
</content>
<content
url=
"file://$MODULE_DIR$"
/>
<orderEntry
type=
"jdk"
jdkName=
"Python 3.8 (venv)"
jdkType=
"Python SDK"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
</component>
<component
name=
"TestRunnerService"
>
<option
name=
"PROJECT_TEST_RUNNER"
value=
"Unittests"
/>
</component>
</module>
\ No newline at end of file
rodTraa/startpage/templates/startpage/home.html
View file @
ab6a4c72
...
...
@@ -4,6 +4,10 @@
<title>
Home page
</title>
</head>
<body>
<h1>
Start page of the application
</h1>
{% for post in posts %}
<h1>
{{post.title}}
</h1>
<p>
By {{post.author}} on {{post.date_posted}}
</p>
<p>
{{post.content}}
</p>
{% endfor %}
</body>
</html>
\ No newline at end of file
rodTraa/startpage/views.py
View file @
ab6a4c72
from
django.shortcuts
import
render
from
django.http
import
HttpResponse
def
home
(
request
):
return
render
(
request
,
'startpage/home.html'
)
context
=
{
'posts'
:
posts
}
return
render
(
request
,
'startpage/home.html'
,
context
)
def
login
(
request
):
return
render
(
request
,
'startpage/login.html'
)
posts
=
[
{
'author'
:
'Sander Høyland'
,
'title'
:
'Strikkeoppdatering 1'
,
'content'
:
'Startet på et nytt pannebånd!'
,
'date-posted'
:
'10.02.2020'
},
{
'author'
:
'Sander Høyland'
,
'title'
:
'Strikkeoppdatering 2'
,
'content'
:
'Ferdig med pannebåndet!'
,
'date-posted'
:
'18.02.2020'
}
]
Write
Preview
Supports
Markdown
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