working on views #1
@@ -0,0 +1,32 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>{% block title %}{% endblock %}</title>
|
||||||
|
{% load bootstrap5 %}
|
||||||
|
{% bootstrap_css %}
|
||||||
|
{% bootstrap_javascript %}
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1 class="display-1">Welcome to my website!</h1>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="list-group">
|
||||||
|
{% if thislist %}
|
||||||
|
<ul>
|
||||||
|
{% for question in thislist %}
|
||||||
|
<a href="#" class="list-group-item">{{ question }}</a>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% else %}
|
||||||
|
<p>No polls are available.</p>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
{% endblock %}
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>My Website</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Welcome to my website!</h1>
|
||||||
|
{% if thislist %}
|
||||||
|
<ul>
|
||||||
|
{% for question in thislist %}
|
||||||
|
<h1>{{ question }}</h1>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% else %}
|
||||||
|
<p>No polls are available.</p>
|
||||||
|
{% endif %}
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
from django.shortcuts import render
|
||||||
|
|
||||||
|
def home(request):
|
||||||
|
thislist = ["apple", "banana", "cherry"]
|
||||||
|
return render(request, 'home.html',{'thislist': thislist})
|
||||||
|
|
||||||
|
def about(request):
|
||||||
|
thislist = ["apple", "banana", "cherry"]
|
||||||
|
return render(request, 'about.html',{'thislist': thislist})
|
||||||
@@ -25,7 +25,7 @@ SECRET_KEY = 'django-insecure-71%)_#e#o9-dl2o^6mfud-*rw+4+8vy-nd*bzeier&(34ap-p9
|
|||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
|
|
||||||
ALLOWED_HOSTS = ['reverse.tryton.geeraert.eu','192.168.4.100','django.tryton.geeraert.eu']
|
ALLOWED_HOSTS = ['reverse.tryton.geeraert.eu','192.168.4.100','django.tryton.geeraert.eu','localhost']
|
||||||
|
|
||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
@@ -37,6 +37,7 @@ INSTALLED_APPS = [
|
|||||||
'django.contrib.sessions',
|
'django.contrib.sessions',
|
||||||
'django.contrib.messages',
|
'django.contrib.messages',
|
||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
|
'bootstrap5',
|
||||||
]
|
]
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
@@ -54,7 +55,8 @@ ROOT_URLCONF = 'django_code.urls'
|
|||||||
TEMPLATES = [
|
TEMPLATES = [
|
||||||
{
|
{
|
||||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||||
'DIRS': ["/code/django_code/templates"],
|
#'DIRS': ["/code/django_code/templates","/code/django_code/dashboard/templates/"],
|
||||||
|
'DIRS': [BASE_DIR / "templates","django_code/dashboard/templates/"],
|
||||||
'APP_DIRS': True,
|
'APP_DIRS': True,
|
||||||
'OPTIONS': {
|
'OPTIONS': {
|
||||||
'context_processors': [
|
'context_processors': [
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ from django.urls import path
|
|||||||
from random_simpsons import apps as random_simpsons
|
from random_simpsons import apps as random_simpsons
|
||||||
from paperless_django import apps as paperless_django
|
from paperless_django import apps as paperless_django
|
||||||
from onenote import apps as onenote
|
from onenote import apps as onenote
|
||||||
from dashboard import apps as dashboard
|
from dashboard import apps as dashboardapp
|
||||||
|
from dashboard import views as dashboardview
|
||||||
from kubernetes_connection import apps as kubernetes_connection
|
from kubernetes_connection import apps as kubernetes_connection
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
@@ -39,7 +40,9 @@ urlpatterns = [
|
|||||||
path('onenote/hello/', onenote.hello),
|
path('onenote/hello/', onenote.hello),
|
||||||
|
|
||||||
################### onenote ###################
|
################### onenote ###################
|
||||||
path('dashboard/hello/', dashboard.hello),
|
path('dashboard/hello/', dashboardapp.hello),
|
||||||
|
path('dashboard/view/about', dashboardview.about),
|
||||||
|
path('dashboard/view/home', dashboardview.home),
|
||||||
|
|
||||||
|
|
||||||
################## kubernetes_connection#####
|
################## kubernetes_connection#####
|
||||||
|
|||||||
Reference in New Issue
Block a user