Skip to content
Snippets Groups Projects
Commit 1dc5f86f authored by zdenek.kubala's avatar zdenek.kubala
Browse files

Merge branch 'auth' into 'main'

enhanced views of sifrovacky

See merge request djz.88/sifrovacky!1
parents debc8a63 cb416e63
No related branches found
No related tags found
1 merge request!1enhanced views of sifrovacky
Showing
with 586 additions and 0 deletions
__pycache__
*.py[cod]
*$py.class
# Distribution / packaging
.Python build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
*.manifest
*.spec
# Log files
pip-log.txt
pip-delete-this-directory.txt
*.log
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
.pytest_cache/
nosetests.xml
coverage.xml
*.cover
.hypothesis/
# Translations
*.mo
*.pot
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
.python-version
# pyflow
__pypackages__/
# Environment
.env
.venv
env/
venv/
ENV/
# If you are using PyCharm #
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/gradle.xml
.idea/**/libraries
*.iws /out/
# Sublime Text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
*.sublime-workspace
*.sublime-project
# sftp configuration file
sftp-config.json
# Package control specific files Package
Control.last-run
Control.ca-list
Control.ca-bundle
Control.system-ca-bundle
GitHub.sublime-settings
# Visual Studio Code #
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history
db.sqlite3
"""
ASGI config for django_apps project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_apps.settings')
application = get_asgi_application()
"""
Django settings for django_apps project.
Generated by 'django-admin startproject' using Django 3.2.3.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-kog+-x*xtt5e7shmxa-ddldzdtz@u#*tj^s9jzm#%&ghy*a8x%'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
#'polls.apps.PollsConfig',
INSTALLED_APPS = [
'sifrovacka.apps.SifrovackaConfig',
'django_registration',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'django_apps.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'django_apps.wsgi.application'
# Database
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
# Password validation
# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/3.2/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.2/howto/static-files/
STATIC_URL = '/static/'
# Default primary key field type
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
# Custom settings AUTH
LOGIN_REDIRECT_URL = 'home'
LOGOUT_REDIRECT_URL = 'index'
"""django_apps URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
# path('polls/', include('polls.urls')),
path('sifrovacka/', include('sifrovacka.urls')),
path('admin/', admin.site.urls),
]
"""
WSGI config for django_apps project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_apps.settings')
application = get_wsgi_application()
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_apps.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()
appdirs==1.4.4
asgiref==3.3.4
asn1crypto==1.4.0
backcall==0.2.0
cffi==1.14.6
confusable-homoglyphs==3.2.0
cryptography==3.3.2
dbus-python==1.2.16
decorator==5.0.9
distlib==0.3.1
Django==3.2.3
django-registration==3.2
entrypoints==0.3
filelock==3.0.12
importlib-metadata==1.6.0
ipython==7.27.0
ipython-genutils==0.2.0
jedi==0.18.0
jeepney==0.6.0
keyring==22.0.1
keyrings.alt==4.0.2
Mako==1.1.3
Markdown==3.3.4
MarkupSafe==1.1.1
matplotlib-inline==0.1.2
more-itertools==4.2.0
parso==0.8.2
pexpect==4.8.0
pickleshare==0.7.5
prompt-toolkit==3.0.20
ptyprocess==0.7.0
pycairo==1.20.1
pycparser==2.20
pycrypto==2.6.1
pycryptodomex==3.9.7
Pygments==2.7.1
PyGObject==3.38.0
pytz==2021.1
pyxdg==0.27
PyYAML==5.3.1
SecretStorage==3.3.1
six==1.16.0
sqlparse==0.4.1
traitlets==5.0.5
typing-extensions==3.10.0.0
virtualenv==20.4.0+ds
wcwidth==0.2.5
xdg==5
zipp==1.0.0
from django.contrib import admin
# Register your models here.
from . import models
admin.site.register(models.Sifrovacka)
admin.site.register(models.Stages)
admin.site.register(models.Participants)
from django.apps import AppConfig
class SifrovackaConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'sifrovacka'
# Generated by Django 3.2.3 on 2021-08-12 06:56
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Sifrovacka',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('siftovacka_name', models.CharField(max_length=200)),
('pub_date', models.DateTimeField(verbose_name='date published')),
('startdate_sifrovacka', models.DateField()),
('enddate_sifrovacka', models.DateField()),
],
),
migrations.CreateModel(
name='Stages',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('stage_number', models.IntegerField()),
('choice_text', models.CharField(max_length=200)),
('votes', models.IntegerField(default=0)),
('startdate_stages', models.DateField()),
('enddate_stages', models.DateField()),
('sifrovacka', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='sifrovacka.sifrovacka')),
],
),
]
# Generated by Django 3.2.3 on 2021-08-12 07:14
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('sifrovacka', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='stages',
name='enddate_stages',
),
migrations.RemoveField(
model_name='stages',
name='startdate_stages',
),
migrations.RemoveField(
model_name='stages',
name='votes',
),
]
# Generated by Django 3.2.3 on 2021-08-12 07:33
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('sifrovacka', '0002_auto_20210812_0714'),
]
operations = [
migrations.RenameField(
model_name='sifrovacka',
old_name='siftovacka_name',
new_name='sifrovacka_name',
),
migrations.RenameField(
model_name='stages',
old_name='choice_text',
new_name='stage_name',
),
]
# Generated by Django 3.2.3 on 2021-08-12 12:09
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('sifrovacka', '0003_auto_20210812_0733'),
]
operations = [
migrations.CreateModel(
name='Participants',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('participate', models.BooleanField()),
('sifrovacka', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='sifrovacka.sifrovacka')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]
# Generated by Django 3.2.3 on 2021-08-30 10:41
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('sifrovacka', '0004_participants'),
]
operations = [
migrations.RenameField(
model_name='participants',
old_name='participate',
new_name='is_active',
),
]
# Generated by Django 3.2.3 on 2021-08-30 10:43
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('sifrovacka', '0005_rename_participate_participants_is_active'),
]
operations = [
migrations.RenameField(
model_name='participants',
old_name='is_active',
new_name='Inactive',
),
]
# Generated by Django 3.2.3 on 2021-08-30 10:52
from django.conf import settings
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('sifrovacka', '0006_rename_is_active_participants_inactive'),
]
operations = [
migrations.AlterUniqueTogether(
name='participants',
unique_together={('user', 'sifrovacka')},
),
]
# Generated by Django 3.2.3 on 2021-08-31 10:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sifrovacka', '0007_alter_participants_unique_together'),
]
operations = [
migrations.AlterField(
model_name='participants',
name='Inactive',
field=models.BooleanField(blank=True),
),
migrations.AlterUniqueTogether(
name='stages',
unique_together={('stage_number', 'sifrovacka')},
),
]
# Generated by Django 3.2.3 on 2021-08-31 11:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sifrovacka', '0008_auto_20210831_1055'),
]
operations = [
migrations.AlterField(
model_name='participants',
name='Inactive',
field=models.BooleanField(default=False),
),
]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment