<?xml version="1.0" encoding="UTF-8"?> | |||||
<project version="4"> | |||||
<component name="DataSourceManagerImpl" format="xml" multifile-model="true"> | |||||
<data-source source="LOCAL" name="db" uuid="94a4927f-b35a-45fd-a978-43c8801f2dcf"> | |||||
<driver-ref>sqlite.xerial</driver-ref> | |||||
<synchronize>true</synchronize> | |||||
<jdbc-driver>org.sqlite.JDBC</jdbc-driver> | |||||
<jdbc-url>jdbc:sqlite:C:\JONKA\Uni\7. Semester (Medizintechnik OHM Nürnberg)\Repo_fuer_mEIM_Semester7\Django_Project\db.sqlite3</jdbc-url> | |||||
<driver-properties> | |||||
<property name="enable_load_extension" value="true" /> | |||||
</driver-properties> | |||||
<libraries> | |||||
<library> | |||||
<url>file://$APPLICATION_CONFIG_DIR$/jdbc-drivers/Xerial SQLiteJDBC/3.25.1/license.txt</url> | |||||
</library> | |||||
<library> | |||||
<url>file://$APPLICATION_CONFIG_DIR$/jdbc-drivers/Xerial SQLiteJDBC/3.25.1/sqlite-jdbc-3.25.1.jar</url> | |||||
</library> | |||||
</libraries> | |||||
</data-source> | |||||
</component> | |||||
</project> |
# Application definition | # Application definition | ||||
INSTALLED_APPS = [ | INSTALLED_APPS = [ | ||||
'posts.apps.PostsConfig', | |||||
'django.contrib.admin', | 'django.contrib.admin', | ||||
'django.contrib.auth', | 'django.contrib.auth', | ||||
'django.contrib.contenttypes', | 'django.contrib.contenttypes', |
from django.db import models | from django.db import models | ||||
# Create your models here. | |||||
class Notice(models.Model): | |||||
#def __init__(self): | |||||
#self.id = super().id | |||||
notice_title = models.CharField(max_length = 80) | |||||
notice_text = models.CharField(max_length = 400) | |||||
pub_start = models.DateTimeField() | |||||
pub_end = models.DateTimeField() |
# Create your views here. | # Create your views here. | ||||
def index(request): | def index(request): | ||||
return render(request, 'posts/index.html') | |||||
#return render(request, 'posts/index.html') | |||||
#context = # hier muss Datenbank ausgelesen werden: | |||||
# for curr_msg in Notice.objects.all(): | |||||
# if (curr_msg.pub_start > datetime.now() and curr_msg.pub_end < date...... | |||||
# context += | |||||
return render(request, 'posts/allMessages.html') |
<head> | <head> | ||||
<meta charset="UTF-8"> | <meta charset="UTF-8"> | ||||
<title>{% block title %} Pla {% endblock %}</title> | <title>{% block title %} Pla {% endblock %}</title> | ||||
<!-- Bootstrap CSS --> | |||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous"> | |||||
</head> | </head> | ||||
<body> | <body> | ||||
<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> | |||||
<nav class="navbar navbar-expand-md navbar-fixed-top navbar-dark bg-primary"> | |||||
<a class="navbar-brand">Navigationsleiste</a> | |||||
<ul class="navbar-nav"> | |||||
<li class="nav-item"> | |||||
<a class="nav-link" href="https://www.google.com">Hier geht's zu Google</a> | |||||
</li> | |||||
<li class="nav-item"> | |||||
<a class="nav-link" href="https://www.th-nuernberg.de/fakultaeten/efi">Hier geht's zur Efi-Homepage</a> | |||||
</li> | |||||
<li class="nav-item"> | |||||
<a class="nav-link" href="#">Random link to click</a> <!-- href="#" means that link is clickable --> | |||||
</li> | |||||
</ul> | |||||
</nav> | |||||
{% block content %} zzz {% endblock %} | {% block content %} zzz {% endblock %} | ||||
</body> | </body> |
<!DOCTYPE html> | |||||
<html lang="en"> | |||||
<head> | |||||
<meta charset="UTF-8"> | |||||
<title>Messages</title> | |||||
</head> | |||||
<body> | |||||
</body> | |||||
</html> |
{% endblock %} | {% endblock %} | ||||
{% block content %} | {% block content %} | ||||
Content der geerbten HTML-Seite | |||||
<div class="jumbotron"> | |||||
<h1 class="display-4">Text als Jumbotron :-)</h1> | |||||
<p class="lead">Hier kommt noch zusätzlicher text, der den/das Jombotron näher erklärt</p> | |||||
</div> | |||||
<img src="https://www.th-nuernberg.de/fileadmin/global/Bilderpool_KOM/Standorte/Standortbild/171958_8_3_W.jpg"> | |||||
{% endblock %} | {% endblock %} |