Skip to content

Dev: invoke options --no-django-debug and --http-domain #10384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/dev/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ save some work while typing docker compose commands. This section explains these
* ``--init`` is used the first time this command is ran to run initial migrations, create an admin user, etc
* ``--no-reload`` makes all celery processes and django runserver
to use no reload and do not watch for files changes
* ``--ngrok`` is useful when it's required to access the local instance from outside (e.g. GitHub webhook)
* ``--no-django-debug`` runs all containers with ``DEBUG=False``
* ``--http-domain`` configures an external domain for the environment (useful for Ngrok or other http proxy).
Note that https proxies aren't supported.
There will also be issues with "suspicious domain" failures on Proxito.
* ``--ext-theme`` to use the new dashboard templates
* ``--webpack`` to start the Webpack dev server for the new dashboard templates

Expand Down
3 changes: 3 additions & 0 deletions readthedocs/settings/docker_compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ class DockerBaseSettings(CommunityBaseSettings):

"""Settings for local development with Docker"""

DEBUG = bool(os.environ.get('RTD_DJANGO_DEBUG', True))

DOCKER_ENABLE = True
RTD_DOCKER_COMPOSE = True
RTD_DOCKER_COMPOSE_VOLUME = 'community_build-user-builds'
Expand Down Expand Up @@ -149,6 +151,7 @@ def DATABASES(self): # noqa
}

ACCOUNT_EMAIL_VERIFICATION = "none"

SESSION_COOKIE_DOMAIN = None
CACHES = {
'default': {
Expand Down
4 changes: 3 additions & 1 deletion readthedocs/storage/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ class OverrideHostnameMixin:
See: https://github.com/jschneier/django-storages/pull/658
"""

override_hostname = None # Just the hostname without scheme (eg. 'assets.readthedocs.org')
override_hostname = (
None # Just the hostname without scheme (eg. 'assets.readthedocs.org')
)

def url(self, *args, **kwargs):
url = super().url(*args, **kwargs)
Expand Down
4 changes: 2 additions & 2 deletions readthedocs/storage/s3_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ def __init__(self, *args, **kwargs):

class S3StaticStorageMixin:

bucket_name = getattr(settings, 'S3_STATIC_STORAGE_BUCKET', None)
override_hostname = getattr(settings, 'S3_STATIC_STORAGE_OVERRIDE_HOSTNAME', None)
bucket_name = getattr(settings, "S3_STATIC_STORAGE_BUCKET", None)
override_hostname = getattr(settings, "S3_STATIC_STORAGE_OVERRIDE_HOSTNAME", None)

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
Expand Down