Private
Public Access
1
0

removing future

This commit is contained in:
Sander Roosendaal
2022-02-15 08:23:48 +01:00
parent 8af7ac8af4
commit 221953bfdf
54 changed files with 83 additions and 283 deletions

View File

@@ -1,8 +1,3 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
"""
Django settings for rowsandall_app project.
@@ -55,7 +50,7 @@ DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
INSTALLED_APPS = [
'rowers',
'survey',
'survey',
# 'cvkbrno',
'django.contrib.admin',
'django.contrib.auth',
@@ -81,14 +76,14 @@ INSTALLED_APPS = [
'tz_detect',
'django_social_share',
'django_countries',
'rules',
'taggit',
'rules',
'taggit',
]
AUTHENTICATION_BACKENDS = (
'oauth2_provider.backends.OAuth2Backend',
# Uncomment following if you want to access the admin
'rules.permissions.ObjectPermissionBackend',
'rules.permissions.ObjectPermissionBackend',
'django.contrib.auth.backends.ModelBackend',
)
@@ -109,7 +104,7 @@ MIDDLEWARE = [
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'tz_detect.middleware.TimezoneMiddleware',
'rowers.middleware.SurveyMiddleWare',
'rowers.middleware.SurveyMiddleWare',
'rowers.middleware.GDPRMiddleWare',
# 'rowers.middleware.PowerTimeFitnessMetricMiddleWare',
'rowers.middleware.RowerPlanMiddleWare',
@@ -137,18 +132,18 @@ TEMPLATES = [
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'django.template.context_processors.i18n',
'django.template.context_processors.i18n',
# 'context_processors.google_analytics',
'context_processors.warning_message',
'rowers.context_processors.braintree_merchant',
],
'libraries' : {
'libraries' : {
'staticfiles': 'django.templatetags.static',
}
# 'loaders': [
# 'django.template.loaders.app_directories.Loader',
# ],
},
# 'loaders': [
# 'django.template.loaders.app_directories.Loader',
# ],
},
},
]
@@ -166,25 +161,25 @@ CONN_MAX_AGE = 0
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': CFG['db_name'],
'USER': CFG['db_user'],
'PASSWORD': CFG['db_password'],
'HOST': CFG['db_host'],
'PORT': CFG['db_port'],
'ENGINE': 'django.db.backends.mysql',
'NAME': CFG['db_name'],
'USER': CFG['db_user'],
'PASSWORD': CFG['db_password'],
'HOST': CFG['db_host'],
'PORT': CFG['db_port'],
'OPTIONS': {
'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
'charset': 'utf8mb4',
}
}
},
'slave': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
},
},
'TEST': {
'CHARSET': 'utf8',
'COLLATION': 'utf8_general_ci',
},
'CHARSET': 'utf8',
'COLLATION': 'utf8_general_ci',
},
}
@@ -197,9 +192,9 @@ AUTH_PASSWORD_VALIDATORS = [
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
'OPTIONS': {
'min_length': 9,
}
'OPTIONS': {
'min_length': 9,
}
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
@@ -207,9 +202,9 @@ AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
{
'NAME': 'rowers.validator.LettersAndDigitsValidator',
}
{
'NAME': 'rowers.validator.LettersAndDigitsValidator',
}
]
@@ -272,13 +267,13 @@ LOGOUT_REDIRECT_URL = '/'
PROGRESS_CACHE_SECRET = CFG['progress_cache_secret']
try:
UPLOAD_SERVICE_URL = CFG['upload_service_url']
UPLOAD_SERVICE_URL = CFG['upload_service_url']
except KeyError: # pragma: no cover
UPLOAD_SERVICE_URL = "http://localhost:8000/rowers/workout/api/upload/"
UPLOAD_SERVICE_URL = "http://localhost:8000/rowers/workout/api/upload/"
try:
UPLOAD_SERVICE_SECRET = CFG['upload_service_secret']
UPLOAD_SERVICE_SECRET = CFG['upload_service_secret']
except KeyError: # pragma: no cover
UPLOAD_SERVICE_SECRET = "FoYezZWLSyfAVimumpHEeYsJjsNCerxV"
UPLOAD_SERVICE_SECRET = "FoYezZWLSyfAVimumpHEeYsJjsNCerxV"
# Concept 2
C2_CLIENT_ID = CFG['c2_client_id']
@@ -456,7 +451,7 @@ REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.BasicAuthentication',
# 'rest_framework.authentication.SessionAuthentication',
# 'rest_framework.authentication.TokenAuthentication',
# 'rest_framework.authentication.TokenAuthentication',
'oauth2_provider.contrib.rest_framework.OAuth2Authentication',
),
'PAGE_SIZE': 20,
@@ -473,14 +468,14 @@ SWAGGER_SETTINGS = {
'authorizationUrl':'/rowers/o/authorize',
'flow': 'implicit',
},
'api_key': {
'api_key': {
'type': 'apiKey',
'in': 'header',
'name': 'Authorization'
},
},
'SHOW_REQUEST_HEADERS': True,
'USE_SESSION_AUTH': True,
'USE_SESSION_AUTH': True,
'JSON_EDITOR': True,
}
@@ -555,19 +550,19 @@ except KeyError: # pragma: no cover
PAYMENT_PROCESSING_ON = False
try:
FAKTUROID_API_KEY = CFG['fakturoid_api_key']
FAKTUROID_API_KEY = CFG['fakturoid_api_key']
except KeyError: # pragma: no cover
FAKTUROID_API_KEY = ''
FAKTUROID_API_KEY = ''
try:
FAKTUROID_EMAIL = CFG['fakturoid_email']
FAKTUROID_EMAIL = CFG['fakturoid_email']
except KeyError: # pragma: no cover
FAKTUROID_EMAIL = ''
FAKTUROID_EMAIL = ''
try:
FAKTUROID_SLUG = CFG['fakturoid_slug']
FAKTUROID_SLUG = CFG['fakturoid_slug']
except KeyError: # pragma: no cover
FAKTUROID_SLUG = ''
FAKTUROID_SLUG = ''
# ID obfuscation
try:
@@ -582,20 +577,20 @@ except KeyError: # pragma: no cover
CELERY = False
try:
WORKOUTS_FIT_TOKEN = CFG['workouts_fit_token']
WORKOUTS_FIT_URL = CFG['workouts_fit_url']
WORKOUTS_FIT_TOKEN = CFG['workouts_fit_token']
WORKOUTS_FIT_URL = CFG['workouts_fit_url']
except KeyError: # pragma: no cover
WORKOUTS_FIT_TOKEN = 'aapnootmies'
WORKOUTS_FIT_URL = 'http://localhost:50053/tojson'
WORKOUTS_FIT_TOKEN = 'aapnootmies'
WORKOUTS_FIT_URL = 'http://localhost:50053/tojson'
# Recaptcha
try:
RECAPTCHA_SITE_KEY = CFG['recaptcha_site_key']
RECAPTCHA_SITE_SECRET = CFG['recaptcha_site_secret']
RECAPTCHA_SITE_KEY = CFG['recaptcha_site_key']
RECAPTCHA_SITE_SECRET = CFG['recaptcha_site_secret']
except KeyError: # pragma: no cover
RECAPTCHA_SITE_KEY = ''
RECAPTCHA_SITE_SECRET = ''
RECAPTCHA_SITE_KEY = ''
RECAPTCHA_SITE_SECRET = ''
GEOIP_PATH = STATIC_ROOT

View File

@@ -27,19 +27,20 @@ if TESTING or use_sqlite:
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
'HOST': 'localhost',
'PASSWORD': 'roeidata',
'USER': '',
'PASSWORD': 'roeidata',
'PORT': '3306', },
# 'TEST': {
# 'CHARSET': 'utf8',
# 'COLLATION': 'utf8_general_ci',
# 'CHARSET': 'utf8',
# 'COLLATION': 'utf8_general_ci',
# },
# 'slave': {
# 'ENGINE': 'django.db.backends.mysql',
# 'ENGINE': 'django.db.backends.mysql',
# 'NAME': 'rowsanda_107501',
# 'USER': 'rowsanda_107501',
# 'USER': 'rowsanda_107501',
# }
# }
}
@@ -82,7 +83,7 @@ STATIC_ROOT = BASE_DIR
#STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static'),
os.path.join(BASE_DIR, 'static/plots'),]
os.path.join(BASE_DIR, 'static/plots'),]
INTERNAL_IPS = ['127.0.0.1']