Skip to content
Snippets Groups Projects
Commit 09cd9623 authored by jan.bednarik's avatar jan.bednarik
Browse files

Install app pirates

parent 00e2ca2e
Branches
No related tags found
1 merge request!1SSO
...@@ -4,4 +4,4 @@ line_length = 88 ...@@ -4,4 +4,4 @@ line_length = 88
multi_line_output = 3 multi_line_output = 3
default_sectiont = "THIRDPARTY" default_sectiont = "THIRDPARTY"
include_trailing_comma = true include_trailing_comma = true
known_third_party = django,environ,wagtail known_third_party = django,environ,pirates,wagtail
""" import os.path
Django settings for majak project. from os.path import join
Generated by 'django-admin startproject' using Django 3.0.5.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
import environ import environ
...@@ -21,15 +9,12 @@ PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) ...@@ -21,15 +9,12 @@ PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
BASE_DIR = os.path.dirname(PROJECT_DIR) BASE_DIR = os.path.dirname(PROJECT_DIR)
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
# Application definition # Application definition
INSTALLED_APPS = [ INSTALLED_APPS = [
"search", "search",
"senator", "senator",
"pirates",
"wagtail.contrib.forms", "wagtail.contrib.forms",
"wagtail.contrib.redirects", "wagtail.contrib.redirects",
"wagtail.contrib.modeladmin", "wagtail.contrib.modeladmin",
...@@ -72,7 +57,7 @@ ROOT_URLCONF = "majak.urls" ...@@ -72,7 +57,7 @@ ROOT_URLCONF = "majak.urls"
TEMPLATES = [ TEMPLATES = [
{ {
"BACKEND": "django.template.backends.django.DjangoTemplates", "BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [os.path.join(PROJECT_DIR, "templates"),], "DIRS": [join(PROJECT_DIR, "templates"),],
"APP_DIRS": True, "APP_DIRS": True,
"OPTIONS": { "OPTIONS": {
"context_processors": [ "context_processors": [
...@@ -128,19 +113,17 @@ STATICFILES_FINDERS = [ ...@@ -128,19 +113,17 @@ STATICFILES_FINDERS = [
"django.contrib.staticfiles.finders.AppDirectoriesFinder", "django.contrib.staticfiles.finders.AppDirectoriesFinder",
] ]
STATICFILES_DIRS = [ STATICFILES_DIRS = [join(PROJECT_DIR, "static")]
os.path.join(PROJECT_DIR, "static"),
]
# ManifestStaticFilesStorage is recommended in production, to prevent outdated # ManifestStaticFilesStorage is recommended in production, to prevent outdated
# Javascript / CSS assets being served from cache (e.g. after a Wagtail upgrade). # Javascript / CSS assets being served from cache (e.g. after a Wagtail upgrade).
# See https://docs.djangoproject.com/en/3.0/ref/contrib/staticfiles/#manifeststaticfilesstorage # See https://docs.djangoproject.com/en/3.0/ref/contrib/staticfiles/#manifeststaticfilesstorage
STATICFILES_STORAGE = "django.contrib.staticfiles.storage.ManifestStaticFilesStorage" STATICFILES_STORAGE = "django.contrib.staticfiles.storage.ManifestStaticFilesStorage"
STATIC_ROOT = os.path.join(BASE_DIR, "static_files") STATIC_ROOT = join(BASE_DIR, "static_files")
STATIC_URL = "/static/" STATIC_URL = "/static/"
MEDIA_ROOT = os.path.join(BASE_DIR, "media_files") MEDIA_ROOT = join(BASE_DIR, "media_files")
MEDIA_URL = "/media/" MEDIA_URL = "/media/"
...@@ -155,3 +138,15 @@ BASE_URL = "http://example.com" ...@@ -155,3 +138,15 @@ BASE_URL = "http://example.com"
WAGTAIL_ALLOW_UNICODE_SLUGS = False WAGTAIL_ALLOW_UNICODE_SLUGS = False
TAGGIT_CASE_INSENSITIVE = True TAGGIT_CASE_INSENSITIVE = True
AUTHENTICATION_BACKENDS = ["pirates.auth.PiratesOIDCAuthenticationBackend"]
OIDC_RP_CLIENT_ID = env.str("OIDC_RP_CLIENT_ID")
OIDC_RP_CLIENT_SECRET = env.str("OIDC_RP_CLIENT_SECRET")
OIDC_RP_REALM_URL = env.str("OIDC_RP_REALM_URL")
OIDC_RP_SIGN_ALGO = "RS256"
OIDC_OP_JWKS_ENDPOINT = join(OIDC_RP_REALM_URL, "protocol/openid-connect/certs")
OIDC_OP_AUTHORIZATION_ENDPOINT = join(OIDC_RP_REALM_URL, "protocol/openid-connect/auth")
OIDC_OP_TOKEN_ENDPOINT = join(OIDC_RP_REALM_URL, "protocol/openid-connect/token")
OIDC_OP_USER_ENDPOINT = join(OIDC_RP_REALM_URL, "protocol/openid-connect/userinfo")
from django.conf import settings from django.conf import settings
from django.conf.urls import include, url from django.conf.urls import include, url
from django.contrib import admin from django.contrib import admin
from pirates.urls import urlpatterns as pirates_urlpatterns
from wagtail.admin import urls as wagtailadmin_urls from wagtail.admin import urls as wagtailadmin_urls
from wagtail.core import urls as wagtail_urls from wagtail.core import urls as wagtail_urls
from wagtail.documents import urls as wagtaildocs_urls from wagtail.documents import urls as wagtaildocs_urls
...@@ -12,7 +13,7 @@ urlpatterns = [ ...@@ -12,7 +13,7 @@ urlpatterns = [
url(r"^admin/", include(wagtailadmin_urls)), url(r"^admin/", include(wagtailadmin_urls)),
url(r"^documents/", include(wagtaildocs_urls)), url(r"^documents/", include(wagtaildocs_urls)),
url(r"^search/$", search_views.search, name="search"), url(r"^search/$", search_views.search, name="search"),
] ] + pirates_urlpatterns
if settings.DEBUG: if settings.DEBUG:
......
...@@ -3,3 +3,4 @@ wagtailmenus ...@@ -3,3 +3,4 @@ wagtailmenus
django-environ django-environ
django-extensions django-extensions
psycopg2-binary psycopg2-binary
git+https://gitlab.pirati.cz/to/pirates@v0.2.0
...@@ -7,24 +7,34 @@ ...@@ -7,24 +7,34 @@
asgiref==3.2.7 # via django asgiref==3.2.7 # via django
beautifulsoup4==4.6.0 # via wagtail beautifulsoup4==4.6.0 # via wagtail
certifi==2020.4.5.1 # via requests certifi==2020.4.5.1 # via requests
cffi==1.14.0 # via cryptography
chardet==3.0.4 # via requests chardet==3.0.4 # via requests
cryptography==2.9.2 # via josepy, mozilla-django-oidc, pyopenssl
django-cogwheels==0.3 # via wagtailmenus django-cogwheels==0.3 # via wagtailmenus
django-environ==0.4.5 # via -r base.in django-environ==0.4.5 # via -r base.in
django-extensions==2.2.9 # via -r base.in django-extensions==2.2.9 # via -r base.in
django-modelcluster==5.0.1 # via wagtail django-modelcluster==5.0.1 # via wagtail
django-taggit==1.2.0 # via wagtail django-taggit==1.2.0 # via wagtail
django-treebeard==4.3.1 # via wagtail django-treebeard==4.3.1 # via wagtail
django==3.0.5 # via django-taggit, django-treebeard, djangorestframework, wagtail django==3.0.5 # via django-taggit, django-treebeard, djangorestframework, mozilla-django-oidc, wagtail
djangorestframework==3.11.0 # via wagtail djangorestframework==3.11.0 # via wagtail
draftjs-exporter==2.1.7 # via wagtail draftjs-exporter==2.1.7 # via wagtail
html5lib==1.0.1 # via wagtail html5lib==1.0.1 # via wagtail
idna==2.9 # via requests idna==2.9 # via requests
josepy==1.3.0 # via mozilla-django-oidc
l18n==2018.5 # via wagtail l18n==2018.5 # via wagtail
mozilla-django-oidc==1.2.3 # via pirates
pillow==6.2.2 # via wagtail pillow==6.2.2 # via wagtail
git+https://gitlab.pirati.cz/to/pirates@v0.2.0 # via -r base.in
psycopg2-binary==2.8.5 # via -r base.in psycopg2-binary==2.8.5 # via -r base.in
pyasn1-modules==0.2.8 # via python-ldap
pyasn1==0.4.8 # via pyasn1-modules, python-ldap
pycparser==2.20 # via cffi
pyopenssl==19.1.0 # via josepy
python-ldap==3.2.0 # via pirates
pytz==2019.3 # via django, django-modelcluster, l18n pytz==2019.3 # via django, django-modelcluster, l18n
requests==2.23.0 # via wagtail requests==2.23.0 # via mozilla-django-oidc, wagtail
six==1.14.0 # via django-extensions, html5lib, l18n six==1.14.0 # via cryptography, django-extensions, html5lib, josepy, l18n, mozilla-django-oidc, pyopenssl
sqlparse==0.3.1 # via django sqlparse==0.3.1 # via django
unidecode==1.1.1 # via wagtail unidecode==1.1.1 # via wagtail
urllib3==1.25.8 # via requests urllib3==1.25.8 # via requests
...@@ -32,3 +42,6 @@ wagtail==2.8.1 # via -r base.in ...@@ -32,3 +42,6 @@ wagtail==2.8.1 # via -r base.in
wagtailmenus==3.0.1 # via -r base.in wagtailmenus==3.0.1 # via -r base.in
webencodings==0.5.1 # via html5lib webencodings==0.5.1 # via html5lib
willow==1.3 # via wagtail willow==1.3 # via wagtail
# The following packages are considered to be unsafe in a requirements file:
# setuptools
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment