From 7b05d2311f3b1727d9567c21f6d9eaac518ef187 Mon Sep 17 00:00:00 2001 From: J08nY Date: Fri, 11 Aug 2017 19:10:54 +0200 Subject: Setup static files and make index page work. --- example_project/settings.py | 42 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) (limited to 'example_project/settings.py') diff --git a/example_project/settings.py b/example_project/settings.py index f46b653..f373e8c 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -30,7 +30,7 @@ https://docs.djangoproject.com/en/1.11/ref/settings/ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) -BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +BASE_DIR = os.path.dirname(os.path.abspath(__file__)) # Quick-start development settings - unsuitable for production @@ -44,6 +44,8 @@ DEBUG = True ALLOWED_HOSTS = [] +SITE_ID = 1 + # Mailman API credentials MAILMAN_REST_API_URL = 'http://localhost:8001' MAILMAN_REST_API_USER = 'restadmin' @@ -61,7 +63,22 @@ INSTALLED_APPS = [ 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', + 'django.contrib.sites', 'django.contrib.staticfiles', + 'django_pgpmailman', + 'django_mailman3', + 'django_gravatar', + 'allauth', + 'allauth.account', + 'allauth.socialaccount', + 'allauth.socialaccount.providers.openid', + 'django_mailman3.lib.auth.fedora', + 'allauth.socialaccount.providers.github', + 'allauth.socialaccount.providers.gitlab', + 'allauth.socialaccount.providers.google', + # 'allauth.socialaccount.providers.facebook', + 'allauth.socialaccount.providers.twitter', + 'allauth.socialaccount.providers.stackexchange', ] MIDDLEWARE = [ @@ -74,7 +91,7 @@ MIDDLEWARE = [ 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] -ROOT_URLCONF = 'django_pgpmailman.urls' +ROOT_URLCONF = 'urls' TEMPLATES = [ { @@ -84,15 +101,21 @@ TEMPLATES = [ 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', + 'django.template.context_processors.i18n', + 'django.template.context_processors.media', + 'django.template.context_processors.static', + 'django.template.context_processors.tz', + 'django.template.context_processors.csrf', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', + 'django_mailman3.context_processors.common' ], }, }, ] -WSGI_APPLICATION = 'django_pgpmailman.wsgi.application' +WSGI_APPLICATION = 'wsgi.application' # Database @@ -124,6 +147,10 @@ AUTH_PASSWORD_VALIDATORS = [ }, ] +LOGIN_URL = 'account_login' +LOGIN_REDIRECT_URL = 'list_index' +LOGOUT_URL = 'account_logout' + # Internationalization # https://docs.djangoproject.com/en/1.11/topics/i18n/ @@ -139,7 +166,12 @@ USE_L10N = True USE_TZ = True -# Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/1.11/howto/static-files/ +# Absolute path to the directory static files should be collected to. +# 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.join(BASE_DIR, 'static') +# URL prefix for static files. +# Example: "http://example.com/static/", "http://static.example.com/" STATIC_URL = '/static/' -- cgit v1.2.3-70-g09d2