Commit c6235d2f authored by Andreas Fischer's avatar Andreas Fischer
Browse files

Prepared template engine exercise

parent eaea9904
<!DOCTYPE html>
<html lang="en">
<head>
<title>APT Django exercise</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>
</head>
<body>
<div class="jumbotron text-center">
<h1>University</h1>
</div>
<nav class="navbar navbar-expand-sm bg-dark navbar-dark">
<a class="navbar-brand" href="/">Overview</a>
<div class="collapse navbar-collapse" id="collapsibleNavbar">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="/professors">Professors</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/students">Students</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/exams">Exams</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/admin">Admin</a>
</li>
</ul>
</div>
</nav>
<div class="container">
<h2>[[ Instead of this text, there should be the main content of the page ]]</h2>
</div>
</body>
</html>
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('professors', views.professors, name='professors'),
path('students', views.students, name='students'),
path('exams', views.exams, name='exams'),
]
from django.shortcuts import render
from .models import *
# Create your views here.
def index(request):
context = {}
return render(request, 'university/index.html', context)
def professors(request):
context = {}
return render(request, 'university/professors.html', context)
def students(request):
context = {}
return render(request, 'university/students.html', context)
def exams(request):
context = {}
return render(request, 'university/exams.html', context)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment