Compare commits
4 Commits
325e5d8891
...
a67575f713
Author | SHA1 | Date | |
---|---|---|---|
a67575f713 | |||
1b4eb2d70f | |||
c86cae2216 | |||
73437a9a7a |
90
.gitignore
vendored
Executable file
90
.gitignore
vendored
Executable 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
2
.idea/misc.xml
generated
@ -3,5 +3,5 @@
|
|||||||
<component name="JavaScriptSettings">
|
<component name="JavaScriptSettings">
|
||||||
<option name="languageLevel" value="ES6" />
|
<option name="languageLevel" value="ES6" />
|
||||||
</component>
|
</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>
|
</project>
|
2
.idea/news.iml
generated
2
.idea/news.iml
generated
@ -16,7 +16,7 @@
|
|||||||
<content url="file://$MODULE_DIR$">
|
<content url="file://$MODULE_DIR$">
|
||||||
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="jdk" jdkName="Python 3.7 (Django)" jdkType="Python SDK" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
</component>
|
</component>
|
||||||
<component name="TemplatesService">
|
<component name="TemplatesService">
|
||||||
|
BIN
db.sqlite3
BIN
db.sqlite3
Binary file not shown.
0
news/__init__.py
Normal file → Executable file
0
news/__init__.py
Normal file → Executable file
1
news/settings.py
Normal file → Executable file
1
news/settings.py
Normal file → Executable file
@ -37,6 +37,7 @@ INSTALLED_APPS = [
|
|||||||
'django.contrib.sessions',
|
'django.contrib.sessions',
|
||||||
'django.contrib.messages',
|
'django.contrib.messages',
|
||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
|
'posts.apps.PostsConfig',
|
||||||
]
|
]
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
|
0
news/urls.py
Normal file → Executable file
0
news/urls.py
Normal file → Executable file
0
news/wsgi.py
Normal file → Executable file
0
news/wsgi.py
Normal file → Executable file
0
posts/__init__.py
Normal file → Executable file
0
posts/__init__.py
Normal file → Executable file
0
posts/admin.py
Normal file → Executable file
0
posts/admin.py
Normal file → Executable file
0
posts/apps.py
Normal file → Executable file
0
posts/apps.py
Normal file → Executable file
24
posts/migrations/0001_initial.py
Executable file
24
posts/migrations/0001_initial.py
Executable 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
0
posts/migrations/__init__.py
Normal file → Executable file
5
posts/models.py
Normal file → Executable file
5
posts/models.py
Normal file → Executable file
@ -1,3 +1,8 @@
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
# Create your models here.
|
# 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
0
posts/tests.py
Normal file → Executable file
0
posts/urls.py
Normal file → Executable file
0
posts/urls.py
Normal file → Executable file
9
posts/views.py
Normal file → Executable file
9
posts/views.py
Normal file → Executable file
@ -1,6 +1,13 @@
|
|||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
|
from .models import Notice
|
||||||
|
from django.utils import timezone
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def index (request):
|
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
0
templates/base.html
Normal file → Executable file
14
templates/posts/index.html
Normal file → Executable file
14
templates/posts/index.html
Normal file → Executable file
@ -1,11 +1,22 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
{% block title %}
|
{% block title %}
|
||||||
Index
|
News
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
|
||||||
|
{% for notice in notices %}
|
||||||
|
<h3>{{ notice.notice_title }}</h3>
|
||||||
|
<p>{{ notice.notice_text }}</p>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
@ -37,4 +48,3 @@
|
|||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
<h1> Index der Polls-Applikation</h1>
|
<h1> Index der Polls-Applikation</h1>
|
||||||
{% endblock %}
|
|
@ -37,7 +37,7 @@ deactivate () {
|
|||||||
# unset irrelevant variables
|
# unset irrelevant variables
|
||||||
deactivate nondestructive
|
deactivate nondestructive
|
||||||
|
|
||||||
VIRTUAL_ENV="/Users/colovicam63900/Desktop/mysite/venv"
|
VIRTUAL_ENV="/Users/herrerahuezoul67409/PycharmProjects/Django/venv"
|
||||||
export VIRTUAL_ENV
|
export VIRTUAL_ENV
|
||||||
|
|
||||||
_OLD_VIRTUAL_PATH="$PATH"
|
_OLD_VIRTUAL_PATH="$PATH"
|
||||||
|
@ -8,7 +8,7 @@ alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PA
|
|||||||
# Unset irrelevant variables.
|
# Unset irrelevant variables.
|
||||||
deactivate nondestructive
|
deactivate nondestructive
|
||||||
|
|
||||||
setenv VIRTUAL_ENV "/Users/colovicam63900/Desktop/mysite/venv"
|
setenv VIRTUAL_ENV "/Users/herrerahuezoul67409/PycharmProjects/Django/venv"
|
||||||
|
|
||||||
set _OLD_VIRTUAL_PATH="$PATH"
|
set _OLD_VIRTUAL_PATH="$PATH"
|
||||||
setenv PATH "$VIRTUAL_ENV/bin:$PATH"
|
setenv PATH "$VIRTUAL_ENV/bin:$PATH"
|
||||||
|
@ -29,7 +29,7 @@ end
|
|||||||
# unset irrelevant variables
|
# unset irrelevant variables
|
||||||
deactivate nondestructive
|
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 _OLD_VIRTUAL_PATH $PATH
|
||||||
set -gx PATH "$VIRTUAL_ENV/bin" $PATH
|
set -gx PATH "$VIRTUAL_ENV/bin" $PATH
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/Users/colovicam63900/Desktop/mysite/venv/bin/python
|
#!/Users/herrerahuezoul67409/PycharmProjects/Django/venv/bin/python
|
||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import re
|
import re
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/Users/colovicam63900/Desktop/mysite/venv/bin/python
|
#!/Users/herrerahuezoul67409/PycharmProjects/Django/venv/bin/python
|
||||||
from django.core import management
|
from django.core import management
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
@ -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'
|
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==39.1.0','console_scripts','easy_install'
|
||||||
__requires__ = 'setuptools==39.1.0'
|
__requires__ = 'setuptools==39.1.0'
|
||||||
import re
|
import re
|
||||||
|
@ -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'
|
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==39.1.0','console_scripts','easy_install-3.7'
|
||||||
__requires__ = 'setuptools==39.1.0'
|
__requires__ = 'setuptools==39.1.0'
|
||||||
import re
|
import re
|
||||||
|
@ -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'
|
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==10.0.1','console_scripts','pip'
|
||||||
__requires__ = 'pip==10.0.1'
|
__requires__ = 'pip==10.0.1'
|
||||||
import re
|
import re
|
||||||
|
@ -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'
|
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==10.0.1','console_scripts','pip3'
|
||||||
__requires__ = 'pip==10.0.1'
|
__requires__ = 'pip==10.0.1'
|
||||||
import re
|
import re
|
||||||
|
@ -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'
|
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==10.0.1','console_scripts','pip3.7'
|
||||||
__requires__ = 'pip==10.0.1'
|
__requires__ = 'pip==10.0.1'
|
||||||
import re
|
import re
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/Users/colovicam63900/Desktop/mysite/venv/bin/python
|
#!/Users/herrerahuezoul67409/PycharmProjects/Django/venv/bin/python
|
||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import re
|
import re
|
||||||
|
Binary file not shown.
@ -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/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/top_level.txt,sha256=eRYisOR7d8EtLKXuWUUAAMOhODItOqrkpxkAGD8CISo,9
|
||||||
sqlparse-0.3.0.dist-info/RECORD,,
|
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-0.3.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
||||||
sqlparse/filters/__pycache__/output.cpython-37.pyc,,
|
sqlparse/filters/__pycache__/output.cpython-37.pyc,,
|
||||||
sqlparse/filters/__pycache__/aligned_indent.cpython-37.pyc,,
|
sqlparse/filters/__pycache__/aligned_indent.cpython-37.pyc,,
|
||||||
|
@ -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"}
|
Loading…
x
Reference in New Issue
Block a user