Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Configure crispy forms to use bootstrap 4

Roland Geider6e4f8d79d471
diff --git a/requirements.txt b/requirements.txt
index 7dc513288..86a204f56 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -14,6 +14,7 @@ Django==4.1.5
django-activity-stream==1.4.2
django-axes==5.40.1
django-crispy-forms~=2.0
+crispy-bootstrap4==2022.1
django-simple-history~=3.3
django-email-verification~=0.3.1
django_compressor~=4.3
diff --git a/wger/settings_global.py b/wger/settings_global.py
index 2eb3d4520..fa9ae8a5e 100644
--- a/wger/settings_global.py
+++ b/wger/settings_global.py
@@ -20,7 +20,6 @@ import os
import re
from datetime import timedelta
-
"""
This file contains the global settings that don't usually need to be changed.
For a full list of options, visit:
@@ -78,6 +77,7 @@ INSTALLED_APPS = (
# Form renderer helper
'crispy_forms',
+ 'crispy_bootstrap4',
# REST-API
'rest_framework',
@@ -165,8 +165,7 @@ TEMPLATES = [
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
],
- 'debug':
- False
+ 'debug': False
},
},
]
@@ -249,7 +248,7 @@ AVAILABLE_LANGUAGES = (
LANGUAGE_CODE = 'en'
# All translation files are in one place
-LOCALE_PATHS = (os.path.join(SITE_ROOT, 'locale'), )
+LOCALE_PATHS = (os.path.join(SITE_ROOT, 'locale'),)
# Primary keys are AutoFields
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
@@ -318,6 +317,7 @@ AXES_CACHE = 'default'
# Django Crispy Templates
#
CRISPY_TEMPLATE_PACK = 'bootstrap4'
+CRISPY_ALLOWED_TEMPLATE_PACKS = 'bootstrap4'
#
# Easy thumbnails
@@ -423,13 +423,13 @@ COMPRESS_ROOT = STATIC_ROOT
REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': ('wger.utils.permissions.WgerPermission', ),
'DEFAULT_PAGINATION_CLASS':
- 'rest_framework.pagination.LimitOffsetPagination',
+ 'rest_framework.pagination.LimitOffsetPagination',
'PAGE_SIZE':
- 20,
+ 20,
'PAGINATE_BY_PARAM':
- 'limit', # Allow client to override, using `?limit=xxx`.
+ 'limit', # Allow client to override, using `?limit=xxx`.
'TEST_REQUEST_DEFAULT_FORMAT':
- 'json',
+ 'json',
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.TokenAuthentication',