diff --git a/config/settings/__init__.py b/config/settings/__init__.py index 31fafad..7700601 100644 --- a/config/settings/__init__.py +++ b/config/settings/__init__.py @@ -12,10 +12,12 @@ STATIC_ROOT = BASE_DIR / 'static_root' STATICFILES_DIRS = [BASE_DIR / 'vendor'] -# the list of included files can be extended to accommodate a more complex setup -include( - optional('local.py') -) +DEBUG = True # defaults to True for development setup +if DEBUG is True: # can be removed when not required + include('development.py') +else: + # the list of included files can be extended to accommodate a more complex setup + include(optional('local.py')) # prepend the BASE_URL to the different URL settings if BASE_URL: diff --git a/config/settings/development.py b/config/settings/development.py new file mode 100644 index 0000000..0723a41 --- /dev/null +++ b/config/settings/development.py @@ -0,0 +1,40 @@ +''' +These are development settings for debug mode, don't use this in production +https://docs.djangoproject.com/en/4.2/ref/settings/ +https://github.com/rdmorganiser/rdmo/blob/main/rdmo/core/settings.py +https://rdmo.readthedocs.io/en/latest/development/setup.html +''' + +if DEBUG is not True: + from django.core.exceptions import ImproperlyConfigured + + raise ImproperlyConfigured('DEBUG must be True for the development settings') + +SECRET_KEY = 'this is not a very secret key' +PASSWORD_HASHERS = ("django.contrib.auth.hashers.MD5PasswordHasher",) +SITE_ID = 1 + +# http://rdmo.readthedocs.io/en/latest/configuration/databases.html +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': 'db.sqlite3', + } +} + +# Optional, theme: http://rdmo.readthedocs.io/en/latest/configuration/themes.html +# INSTALLED_APPS += ['rdmo_theme'] + +# Optional, RDMO plugins: https://github.com/rdmorganiser?q=rdmo-plugins&type=all&language=&sort= +# INSTALLED_APPS += ['rdmo_pugin'] +# PROJECT_EXPORTS += [] +# PROJECT_IMPORTS += [] + +# Optional, browsable API, that comes with the Django Rest Framework +# REST_FRAMEWORK['DEFAULT_RENDERER_CLASSES'] = ( +# 'rest_framework.renderers.JSONRenderer', +# 'rest_framework.renderers.BrowsableAPIRenderer', +# ) + +# Optional, email port +# EMAIL_PORT = 8025 diff --git a/pyproject.toml b/pyproject.toml index fd496a5..bcf1d58 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,6 +6,8 @@ target_version = ["py38", "py39", "py310", "py311"] [tool.ruff] target-version = "py38" line-length = 120 + +[tool.ruff.lint] select = [ "B", # flake8-bugbear "C4", # flake8-comprehensions @@ -25,7 +27,7 @@ ignore = [ "RUF012", # mutable-class-default ] -[tool.ruff.isort] +[tool.ruff.lint.isort] section-order = [ "future", "standard-library", @@ -38,13 +40,13 @@ section-order = [ "local-folder" ] -[tool.ruff.isort.sections] +[tool.ruff.lint.isort.sections] pytest = ["pytest"] django = ["django"] rest_framework = ["rest_framework"] rdmo = ["rdmo"] -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] "config/settings/*.py" = [ "F401", "F403",