Skip to content

Commit b8acc53

Browse files
authored
Merge pull request #121 from maykinmedia/issue/remove-sites
🔥 [#59] Remove django.contrib.sites from INSTALLED_APPS
2 parents 4be8bbd + 23bbcdb commit b8acc53

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

open_api_framework/conf/base.py

+5-13
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,6 @@
2929
#
3030
# Core Django settings
3131
#
32-
SITE_ID = config(
33-
"SITE_ID",
34-
default=1,
35-
help_text="The database ID of the site object. You usually won't have to touch this.",
36-
)
37-
38-
SITE_DOMAIN = config(
39-
"SITE_DOMAIN",
40-
default="example.com",
41-
help_text=("Defines the primary domain where the application is hosted."),
42-
)
4332

4433
# SECURITY WARNING: keep the secret key used in production secret!
4534
SECRET_KEY = config(
@@ -199,8 +188,6 @@
199188
"django.contrib.contenttypes",
200189
"django.contrib.auth",
201190
"django.contrib.sessions",
202-
# Note: If enabled, at least one Site object is required
203-
"django.contrib.sites",
204191
"django.contrib.messages",
205192
"django.contrib.staticfiles",
206193
# Optional applications.
@@ -810,6 +797,11 @@
810797
),
811798
auto_display_default=False,
812799
)
800+
SITE_DOMAIN = config(
801+
"SITE_DOMAIN",
802+
default="example.com",
803+
help_text=("Defines the primary domain where the application is hosted."),
804+
)
813805

814806
#
815807
# SENTRY - error monitoring

tests/test_generate_envvar_docs.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@
7474
Optional
7575
--------
7676
77-
* ``SITE_ID``: The database ID of the site object. You usually won't have to touch this. Defaults to: ``1``.
78-
* ``SITE_DOMAIN``: Defines the primary domain where the application is hosted. Defaults to: ``example.com``.
7977
* ``DEBUG``: Only set this to ``True`` on a local development environment. Various other security settings are derived from this setting!. Defaults to: ``False``.
8078
* ``USE_X_FORWARDED_HOST``: whether to grab the domain/host from the X-Forwarded-Host header or not. This header is typically set by reverse proxies (such as nginx, traefik, Apache...). Note: this is a header that can be spoofed and you need to ensure you control it before enabling this. Defaults to: ``False``.
8179
* ``IS_HTTPS``: Used to construct absolute URLs and controls a variety of security settings. Defaults to the inverse of ``DEBUG``.
@@ -98,6 +96,7 @@
9896
* ``NUM_PROXIES``: the number of reverse proxies in front of the application, as an integer. This is used to determine the actual client IP adres. On Kubernetes with an ingress you typically want to set this to 2. Defaults to: ``1``.
9997
* ``CSRF_TRUSTED_ORIGINS``: A list of trusted origins for unsafe requests (e.g. POST). Defaults to: ``[]``.
10098
* ``NOTIFICATIONS_DISABLED``: indicates whether or not notifications should be sent to the Notificaties API for operations on the API endpoints. Defaults to ``True`` for the ``dev`` environment, otherwise defaults to ``False``.
99+
* ``SITE_DOMAIN``: Defines the primary domain where the application is hosted. Defaults to: ``example.com``.
101100
* ``SENTRY_DSN``: URL of the sentry project to send error reports to. Default empty, i.e. -> no monitoring set up. Highly recommended to configure this.
102101
* ``DISABLE_2FA``: Whether or not two factor authentication should be disabled. Defaults to: ``False``.
103102
* ``LOG_OUTGOING_REQUESTS_EMIT_BODY``: Whether or not outgoing request bodies should be logged. Defaults to: ``True``.

0 commit comments

Comments
 (0)