Base template first try
This commit is contained in:
parent
d9da12f26d
commit
3855520a70
6
.gitignore
vendored
6
.gitignore
vendored
@ -9,7 +9,8 @@ media
|
||||
# Backup files #
|
||||
*.bak
|
||||
|
||||
# If you are using PyCharm #
|
||||
# If you are using PyCharm #
|
||||
.idea/
|
||||
# User-specific stuff
|
||||
.idea/**/workspace.xml
|
||||
.idea/**/tasks.xml
|
||||
@ -103,7 +104,8 @@ env/
|
||||
venv/
|
||||
ENV/
|
||||
env.bak/
|
||||
venv.bak/
|
||||
venv.bak/
|
||||
soita-venv/
|
||||
|
||||
# mkdocs documentation
|
||||
/site
|
||||
|
@ -36,6 +36,7 @@ DEBUG = get_secret("DEBUG")
|
||||
|
||||
ALLOWED_HOSTS = get_secret("ALLOWED_HOSTS")
|
||||
|
||||
APPEND_SLASH = False
|
||||
|
||||
# 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.urls import include
|
||||
from django.urls import path
|
||||
from .views import index
|
||||
|
||||
urlpatterns = [
|
||||
path('', index),
|
||||
path('users/', include("users.urls")),
|
||||
path('questions/', include("questions.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