Base template first try
This commit is contained in:
parent
d9da12f26d
commit
3855520a70
2
.gitignore
vendored
2
.gitignore
vendored
@ -10,6 +10,7 @@ media
|
|||||||
*.bak
|
*.bak
|
||||||
|
|
||||||
# If you are using PyCharm #
|
# If you are using PyCharm #
|
||||||
|
.idea/
|
||||||
# User-specific stuff
|
# User-specific stuff
|
||||||
.idea/**/workspace.xml
|
.idea/**/workspace.xml
|
||||||
.idea/**/tasks.xml
|
.idea/**/tasks.xml
|
||||||
@ -104,6 +105,7 @@ venv/
|
|||||||
ENV/
|
ENV/
|
||||||
env.bak/
|
env.bak/
|
||||||
venv.bak/
|
venv.bak/
|
||||||
|
soita-venv/
|
||||||
|
|
||||||
# mkdocs documentation
|
# mkdocs documentation
|
||||||
/site
|
/site
|
||||||
|
@ -36,6 +36,7 @@ DEBUG = get_secret("DEBUG")
|
|||||||
|
|
||||||
ALLOWED_HOSTS = get_secret("ALLOWED_HOSTS")
|
ALLOWED_HOSTS = get_secret("ALLOWED_HOSTS")
|
||||||
|
|
||||||
|
APPEND_SLASH = False
|
||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
|
|
||||||
|
16
config/templates/base.html
Normal file
16
config/templates/base.html
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
|
||||||
|
<title>SOITA | {% block title %}{% endblock %}</title>
|
||||||
|
<meta name="description" content="{% block description %}{% endblock %}">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
{% block content %}
|
||||||
|
{% endblock %}
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
|
|
15
config/templates/index.html
Normal file
15
config/templates/index.html
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block title %}Home{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h1>Welcome in SOITA/h1>
|
||||||
|
{% if user.is_authenticated %}
|
||||||
|
<p>Username: {{user.username}}</p>
|
||||||
|
<p>Name: {{user.first_name}} {{user.last_name}}</p>
|
||||||
|
<p>Email: {{user.email}}</p>
|
||||||
|
{% else %}
|
||||||
|
Guest nr 123
|
||||||
|
{% endif %}
|
||||||
|
{% endblock %}
|
||||||
|
|
@ -16,8 +16,10 @@ Including another URLconf
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.urls import include
|
from django.urls import include
|
||||||
from django.urls import path
|
from django.urls import path
|
||||||
|
from .views import index
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
|
path('', index),
|
||||||
path('users/', include("users.urls")),
|
path('users/', include("users.urls")),
|
||||||
path('questions/', include("questions.urls")),
|
path('questions/', include("questions.urls")),
|
||||||
path('answers/', include("answers.urls")),
|
path('answers/', include("answers.urls")),
|
||||||
|
10
config/views.py
Normal file
10
config/views.py
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
from django.shortcuts import render, redirect
|
||||||
|
from django.template import loader
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def index(request):
|
||||||
|
# context = {
|
||||||
|
# 'latest_question_list': latest_question_list,
|
||||||
|
# }
|
||||||
|
return render(request, 'index.html')
|
16
templates/base.html
Normal file
16
templates/base.html
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
|
||||||
|
<title>SOITA | {% block title %}{% endblock %}</title>
|
||||||
|
<meta name="description" content="{% block description %}{% endblock %}">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
{% block content %}
|
||||||
|
{% endblock %}
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
|
|
15
templates/index.html
Normal file
15
templates/index.html
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block title %}Home{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h1>Welcome in SOITA/h1>
|
||||||
|
{% if user.is_authenticated %}
|
||||||
|
<p>Username: {{user.username}}</p>
|
||||||
|
<p>Name: {{user.first_name}} {{user.last_name}}</p>
|
||||||
|
<p>Email: {{user.email}}</p>
|
||||||
|
{% else %}
|
||||||
|
Guest nr 123
|
||||||
|
{% endif %}
|
||||||
|
{% endblock %}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user