mirror of
https://github.com/wger-project/wger.git
synced 2026-12-05 04:57:52 +01:00
As suggested by maintainer rolandgeider, add a dedicated USE_GOOGLE_AUTH setting. USE_SOCIAL_AUTH is now auto-derived (True if any provider is enabled) rather than being set manually. This pattern scales cleanly when GitHub and Facebook are added in future PRs — each provider gets its own flag, and USE_SOCIAL_AUTH stays in sync. Files changed: - settings/settings_global.py: add USE_GOOGLE_AUTH to WGER_SETTINGS defaults, remove USE_GITHUB_AUTH/USE_FACEBOOK_AUTH, auto-derive USE_SOCIAL_AUTH from provider flags - settings/main.py: read USE_GOOGLE_AUTH from env, remove USE_GITHUB_AUTH/USE_FACEBOOK_AUTH env reads, add auto-derive logic - settings/local_dev.py: set USE_GOOGLE_AUTH=True, remove github/facebook flags, add auto-derive logic - settings/ci.py: set USE_GOOGLE_AUTH=False, remove github/facebook flags
98 lines
2.6 KiB
Python
98 lines
2.6 KiB
Python
# This file is part of wger Workout Manager <https://github.com/wger-project>.
|
|
# Copyright (C) 2013 - 2026 wger Team
|
|
#
|
|
# wger Workout Manager is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU Affero General Public License as published by
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# wger Workout Manager is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU Affero General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU Affero General Public License
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
# ruff: noqa: F405, F403
|
|
|
|
# Third Party
|
|
import environ
|
|
|
|
# wger
|
|
from .settings_global import *
|
|
|
|
env = environ.Env()
|
|
|
|
DEBUG = False
|
|
|
|
"""
|
|
Settings for CI:
|
|
|
|
The basic changes are
|
|
|
|
* skip migrations
|
|
* use a faster password hasher
|
|
* use plain (un-hashed) static file storage
|
|
* use an in-memory backend for media files
|
|
"""
|
|
|
|
PASSWORD_HASHERS = [
|
|
'django.contrib.auth.hashers.MD5PasswordHasher',
|
|
'django.contrib.auth.hashers.PBKDF2PasswordHasher',
|
|
]
|
|
|
|
# Application settings
|
|
WGER_SETTINGS['EMAIL_FROM'] = 'wger Workout Manager <wger@example.com>'
|
|
WGER_SETTINGS['ALLOW_REGISTRATION'] = True
|
|
WGER_SETTINGS['ALLOW_GUEST_USERS'] = True
|
|
WGER_SETTINGS['ALLOW_UPLOAD_VIDEOS'] = False
|
|
WGER_SETTINGS['MIN_ACCOUNT_AGE_TO_TRUST'] = 21 # in days
|
|
WGER_SETTINGS['EXERCISE_CACHE_TTL'] = 3600 # in seconds
|
|
WGER_SETTINGS['USE_GOOGLE_AUTH'] = False
|
|
WGER_SETTINGS['USE_SOCIAL_AUTH'] = False
|
|
|
|
DATABASES = {
|
|
'default': {
|
|
'ENGINE': 'django.db.backends.sqlite3',
|
|
'NAME': 'database.sqlite',
|
|
'TEST': {
|
|
'MIGRATE': False,
|
|
},
|
|
}
|
|
}
|
|
|
|
ADMINS = ['"Your name" <your_email@example.com>']
|
|
MANAGERS = ADMINS
|
|
|
|
TIME_ZONE = 'Europe/Berlin'
|
|
SECRET_KEY = '61fxc$k%9nj!be-_up9%xzm(z)9l7$h33b1!@bf9581=c-03%p'
|
|
|
|
RECAPTCHA_PUBLIC_KEY = ''
|
|
RECAPTCHA_PRIVATE_KEY = ''
|
|
USE_RECAPTCHA = False
|
|
|
|
SITE_URL = 'http://localhost:8000'
|
|
|
|
MEDIA_ROOT = env.str('DJANGO_MEDIA_ROOT', '/tmp/')
|
|
MEDIA_URL = '/media/'
|
|
|
|
ALLOWED_HOSTS = [
|
|
'*',
|
|
]
|
|
|
|
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
|
DEFAULT_FROM_EMAIL = WGER_SETTINGS['EMAIL_FROM']
|
|
EMAIL_PAGE_DOMAIN = SITE_URL
|
|
AXES_ENABLED = False
|
|
|
|
STORAGES = {
|
|
# In-memory storage avoids disk writes for media uploads during tests.
|
|
'default': {
|
|
'BACKEND': 'django.core.files.storage.InMemoryStorage',
|
|
},
|
|
'staticfiles': {
|
|
'BACKEND': 'django.contrib.staticfiles.storage.StaticFilesStorage',
|
|
},
|
|
}
|