1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 09:58:23 +02:00

Merge branch 'master' into 'logging'

# Conflicts:
#   locale/de/LC_MESSAGES/django.po
#   locale/fr/LC_MESSAGES/django.po
This commit is contained in:
ynerant
2020-03-07 10:32:17 +01:00
358 changed files with 82864 additions and 156 deletions

View File

@ -6,5 +6,14 @@
"domain": "localhost",
"name": "La Note Kfet \ud83c\udf7b"
}
},
{
"model": "cas_server.servicepattern",
"pk": 1,
"fields": {
"pos": 1,
"pattern": ".*",
"name": "REPLACEME"
}
}
]

View File

@ -55,6 +55,9 @@ INSTALLED_APPS = [
# Autocomplete
'dal',
'dal_select2',
# CAS
'cas_server',
'cas',
# Note apps
'activity',
@ -77,6 +80,7 @@ MIDDLEWARE = [
'django.middleware.locale.LocaleMiddleware',
'django.contrib.sites.middleware.CurrentSiteMiddleware',
'note_kfet.middlewares.TurbolinksMiddleware',
'cas.middleware.CASMiddleware',
]
ROOT_URLCONF = 'note_kfet.urls'
@ -93,6 +97,7 @@ TEMPLATES = [
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'django.template.context_processors.request',
# 'django.template.context_processors.media',
],
},
},
@ -129,6 +134,7 @@ PASSWORD_HASHERS = [
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend', # this is default
'guardian.backends.ObjectPermissionBackend',
'cas.backends.CASBackend',
)
REST_FRAMEWORK = {
@ -177,10 +183,10 @@ FIXTURE_DIRS = [os.path.join(BASE_DIR, "note_kfet/fixtures")]
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/var/www/example.com/static/"
STATIC_ROOT = os.path.realpath(__file__)
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static')]
STATIC_ROOT = os.path.join(BASE_DIR,"static/")
# STATICFILES_DIRS = [
# os.path.join(BASE_DIR, 'static')]
STATICFILES_DIRS = []
CRISPY_TEMPLATE_PACK = 'bootstrap4'
DJANGO_TABLES2_TEMPLATE = 'django_tables2/bootstrap4.html'
# URL prefix for static files.
@ -189,3 +195,15 @@ STATIC_URL = '/static/'
ALIAS_VALIDATOR_REGEX = r''
MEDIA_ROOT=os.path.join(BASE_DIR,"media")
MEDIA_URL='/media/'
# Profile Picture Settings
PIC_WIDTH = 200
PIC_RATIO = 1
# CAS Settings
CAS_AUTO_CREATE_USER = False
CAS_LOGO_URL = "/static/img/Saperlistpopette.png"
CAS_FAVICON_URL = "/static/favicon/favicon-32x32.png"

View File

@ -48,3 +48,7 @@ CSRF_COOKIE_SECURE = False
CSRF_COOKIE_HTTPONLY = False
X_FRAME_OPTIONS = 'DENY'
SESSION_COOKIE_AGE = 60 * 60 * 3
# CAS Client settings
# Can be modified in secrets.py
CAS_SERVER_URL = "https://note.comby.xyz/cas/"

View File

@ -47,3 +47,6 @@ CSRF_COOKIE_SECURE = False
CSRF_COOKIE_HTTPONLY = False
X_FRAME_OPTIONS = 'DENY'
SESSION_COOKIE_AGE = 60 * 60 * 3
# CAS Client settings
CAS_SERVER_URL = "https://note.crans.org/cas/"

View File

@ -4,6 +4,10 @@
from django.contrib import admin
from django.urls import path, include
from django.views.generic import RedirectView
from django.conf.urls.static import static
from django.conf import settings
from cas import views as cas_views
urlpatterns = [
# Dev so redirect to something random
@ -12,6 +16,10 @@ urlpatterns = [
# Include project routers
path('note/', include('note.urls')),
# Include CAS Client routers
path('accounts/login/', cas_views.login, name='login'),
path('accounts/logout/', cas_views.logout, name='logout'),
# Include Django Contrib and Core routers
path('i18n/', include('django.conf.urls.i18n')),
path('accounts/', include('member.urls')),
@ -19,8 +27,14 @@ urlpatterns = [
path('admin/doc/', include('django.contrib.admindocs.urls')),
path('admin/', admin.site.urls),
# Include CAS Server routers
path('cas/', include('cas_server.urls', namespace="cas_server")),
# Include Django REST API
path('api/', include('api.urls')),
path('logs/', include('logs.urls')),
]
urlpatterns += static(settings.MEDIA_URL,document_root=settings.MEDIA_ROOT)
urlpatterns += static(settings.STATIC_URL,document_root=settings.STATIC_ROOT)