Browse Source

4ter prakt termin

master
Janko Hartwig 6 years ago
parent
commit
21f17ec603
5 changed files with 45 additions and 2 deletions
  1. 1
    1
      djp/.idea/djp.iml
  2. 1
    0
      djp/polls/urls.py
  3. 4
    1
      djp/polls/views.py
  4. 25
    0
      djp/templates/base.html
  5. 14
    0
      djp/templates/polls/index.html

+ 1
- 1
djp/.idea/djp.iml View File

<option name="TEMPLATE_CONFIGURATION" value="Django" /> <option name="TEMPLATE_CONFIGURATION" value="Django" />
<option name="TEMPLATE_FOLDERS"> <option name="TEMPLATE_FOLDERS">
<list> <list>
<option value="$MODULE_DIR$/../djp\templates" />
<option value="$MODULE_DIR$/templates" />
</list> </list>
</option> </option>
</component> </component>

+ 1
- 0
djp/polls/urls.py View File

from django.conf.urls import url from django.conf.urls import url


from . import views from . import views

urlpatterns = [ urlpatterns = [
url(r'^$', views.index, name='index'), url(r'^$', views.index, name='index'),
] ]

+ 4
- 1
djp/polls/views.py View File

from django.http import HttpResponse from django.http import HttpResponse
from django.shortcuts import render
import time


def index(request): def index(request):
return HttpResponse('lalala')
context = {'now' : time.strftime('%H:%M:%S', time.localtime())}
return render(request, 'polls/index.html', context)


# Create your views here. # Create your views here.

+ 25
- 0
djp/templates/base.html View File

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{% block title %} Platzhalter {% endblock %}</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>

</head>
<body>

{% block navigation %}
<nav class="navbar navbar-light bg-light">
<a class="navbar-brand" href="https://www.google.de">go to Google</a>
<a class="navbar-brand" href="https://www.th-nuernberg.de/">go to TH Ohm Homepage</a>
</nav>
{% endblock %}

{% block content %} Platzhalter {% endblock %}


</body>
</html>

+ 14
- 0
djp/templates/polls/index.html View File

{% extends 'base.html' %}

{% block title %}
Index
{% endblock %}

{% block content %}
<div class="jumbotron jumbotron-fluid">
<div class="container">
<h1>Index der Polls-Applikation</h1>
</div>
</div>

{% endblock %}

Loading…
Cancel
Save