Compare commits

...

4 Commits

Author SHA1 Message Date
a67575f713 praktikum Sechs bearbeitung 2019-11-26 14:20:45 +01:00
1b4eb2d70f first commit 2019-11-26 14:06:02 +01:00
c86cae2216 praktikum6 2019-11-19 15:31:28 +01:00
73437a9a7a praktikum Sechs bearbeitung 2019-11-19 15:28:55 +01:00
33 changed files with 155 additions and 18 deletions

90
.gitignore vendored Executable file
View File

@ -0,0 +1,90 @@
### OSX ###
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.cache
nosetests.xml
coverage.xml
# Translations
*.mo
*.pot
# Sphinx documentation
docs/_build/
# PyBuilder
target/
### Django ###
*.log
*.pot
*.pyc
**__pycache__/
local_settings.py
.env
**/db.sqlite3
# PyCharm
**/.idea/

2
.idea/misc.xml generated
View File

@ -3,5 +3,5 @@
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (news)" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (Django)" project-jdk-type="Python SDK" />
</project>

2
.idea/news.iml generated
View File

@ -16,7 +16,7 @@
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="Python 3.7 (Django)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TemplatesService">

Binary file not shown.

0
news/__init__.py Normal file → Executable file
View File

1
news/settings.py Normal file → Executable file
View File

@ -37,6 +37,7 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'posts.apps.PostsConfig',
]
MIDDLEWARE = [

0
news/urls.py Normal file → Executable file
View File

0
news/wsgi.py Normal file → Executable file
View File

0
posts/__init__.py Normal file → Executable file
View File

0
posts/admin.py Normal file → Executable file
View File

0
posts/apps.py Normal file → Executable file
View File

View File

@ -0,0 +1,24 @@
# Generated by Django 2.2.7 on 2019-11-19 13:28
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Notice',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('notice_title', models.CharField(max_length=80)),
('notice_text', models.CharField(max_length=400)),
('pub_start', models.DateTimeField()),
('pub_end', models.DateTimeField()),
],
),
]

0
posts/migrations/__init__.py Normal file → Executable file
View File

5
posts/models.py Normal file → Executable file
View File

@ -1,3 +1,8 @@
from django.db import models
# Create your models here.
class Notice(models.Model):
notice_title = models.CharField(max_length=80)
notice_text = models.CharField(max_length=400)
pub_start = models.DateTimeField()
pub_end = models.DateTimeField()

0
posts/tests.py Normal file → Executable file
View File

0
posts/urls.py Normal file → Executable file
View File

9
posts/views.py Normal file → Executable file
View File

@ -1,6 +1,13 @@
from django.shortcuts import render
from .models import Notice
from django.utils import timezone
def index (request):
return render(request, 'posts/index.html')
notices = Notice.objects.all()
notices = notices.filter(pub_start__lte=timezone.now())
notices = notices.filter(pub_end__gte=timezone.now())
context = { "notices" : notices }
return render(request, 'posts/index.html', context)

0
templates/base.html Normal file → Executable file
View File

14
templates/posts/index.html Normal file → Executable file
View File

@ -1,11 +1,22 @@
{% extends 'base.html' %}
{% block title %}
Index
News
{% endblock %}
{% block content %}
<div class="container">
{% for notice in notices %}
<h3>{{ notice.notice_title }}</h3>
<p>{{ notice.notice_text }}</p>
{% endfor %}
</div>
{% endblock %}
<!DOCTYPE html>
<html>
@ -37,4 +48,3 @@
</body>
</html>
<h1> Index der Polls-Applikation</h1>
{% endblock %}

View File

@ -37,7 +37,7 @@ deactivate () {
# unset irrelevant variables
deactivate nondestructive
VIRTUAL_ENV="/Users/colovicam63900/Desktop/mysite/venv"
VIRTUAL_ENV="/Users/herrerahuezoul67409/PycharmProjects/Django/venv"
export VIRTUAL_ENV
_OLD_VIRTUAL_PATH="$PATH"

View File

@ -8,7 +8,7 @@ alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PA
# Unset irrelevant variables.
deactivate nondestructive
setenv VIRTUAL_ENV "/Users/colovicam63900/Desktop/mysite/venv"
setenv VIRTUAL_ENV "/Users/herrerahuezoul67409/PycharmProjects/Django/venv"
set _OLD_VIRTUAL_PATH="$PATH"
setenv PATH "$VIRTUAL_ENV/bin:$PATH"

View File

@ -29,7 +29,7 @@ end
# unset irrelevant variables
deactivate nondestructive
set -gx VIRTUAL_ENV "/Users/colovicam63900/Desktop/mysite/venv"
set -gx VIRTUAL_ENV "/Users/herrerahuezoul67409/PycharmProjects/Django/venv"
set -gx _OLD_VIRTUAL_PATH $PATH
set -gx PATH "$VIRTUAL_ENV/bin" $PATH

View File

@ -1,4 +1,4 @@
#!/Users/colovicam63900/Desktop/mysite/venv/bin/python
#!/Users/herrerahuezoul67409/PycharmProjects/Django/venv/bin/python
# -*- coding: utf-8 -*-
import re

View File

@ -1,4 +1,4 @@
#!/Users/colovicam63900/Desktop/mysite/venv/bin/python
#!/Users/herrerahuezoul67409/PycharmProjects/Django/venv/bin/python
from django.core import management
if __name__ == "__main__":

View File

@ -1,4 +1,4 @@
#!/Users/colovicam63900/Desktop/mysite/venv/bin/python
#!/Users/herrerahuezoul67409/PycharmProjects/Django/venv/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==39.1.0','console_scripts','easy_install'
__requires__ = 'setuptools==39.1.0'
import re

View File

@ -1,4 +1,4 @@
#!/Users/colovicam63900/Desktop/mysite/venv/bin/python
#!/Users/herrerahuezoul67409/PycharmProjects/Django/venv/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==39.1.0','console_scripts','easy_install-3.7'
__requires__ = 'setuptools==39.1.0'
import re

View File

@ -1,4 +1,4 @@
#!/Users/colovicam63900/Desktop/mysite/venv/bin/python
#!/Users/herrerahuezoul67409/PycharmProjects/Django/venv/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==10.0.1','console_scripts','pip'
__requires__ = 'pip==10.0.1'
import re

View File

@ -1,4 +1,4 @@
#!/Users/colovicam63900/Desktop/mysite/venv/bin/python
#!/Users/herrerahuezoul67409/PycharmProjects/Django/venv/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==10.0.1','console_scripts','pip3'
__requires__ = 'pip==10.0.1'
import re

View File

@ -1,4 +1,4 @@
#!/Users/colovicam63900/Desktop/mysite/venv/bin/python
#!/Users/herrerahuezoul67409/PycharmProjects/Django/venv/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==10.0.1','console_scripts','pip3.7'
__requires__ = 'pip==10.0.1'
import re

View File

@ -1,4 +1,4 @@
#!/Users/colovicam63900/Desktop/mysite/venv/bin/python
#!/Users/herrerahuezoul67409/PycharmProjects/Django/venv/bin/python
# -*- coding: utf-8 -*-
import re

View File

@ -26,7 +26,7 @@ sqlparse-0.3.0.dist-info/WHEEL,sha256=HX-v9-noUkyUoxyZ1PMSuS7auUxDAR4VBdoYLqD0xw
sqlparse-0.3.0.dist-info/entry_points.txt,sha256=S2WxhPln7zXybKRE73ekBicXHh7_BX-KYGFZZaGGqp8,54
sqlparse-0.3.0.dist-info/top_level.txt,sha256=eRYisOR7d8EtLKXuWUUAAMOhODItOqrkpxkAGD8CISo,9
sqlparse-0.3.0.dist-info/RECORD,,
../../../bin/sqlformat,sha256=7AaJs39h263DC_lmnA7xmCchMGfKQN82n6LnsyjirRI,256
../../../bin/sqlformat,sha256=ok4bpX4qeThrS0hEgCdScLnCrSVUhqu3CQhFQVMp6K0,269
sqlparse-0.3.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
sqlparse/filters/__pycache__/output.cpython-37.pyc,,
sqlparse/filters/__pycache__/aligned_indent.cpython-37.pyc,,

View File

@ -1 +1 @@
{"last_check":"2019-11-05T13:22:52Z","pypi_version":"19.3.1"}
{"last_check":"2019-11-19T13:10:17Z","pypi_version":"19.3.1"}