diff --git a/app/settings.py b/app/settings.py index b05fe71..7298483 100644 --- a/app/settings.py +++ b/app/settings.py @@ -21,14 +21,12 @@ # See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = '^ar@p4e$sdqoa*=gd)*(e*(+&k3rv#x_*v5w*wb9+ef@097-fd' +SECRET_KEY = os.environ.get('SECRET_KEY', "a-not-so-secret-key") # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True - +DEBUG = os.environ.get('DEBUG', False) ALLOWED_HOSTS = ['*', ] - # Application definition INSTALLED_APPS = [ @@ -48,6 +46,7 @@ MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', + 'whitenoise.middleware.WhiteNoiseMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', @@ -74,9 +73,6 @@ }, ] -WSGI_APPLICATION = 'app.wsgi.application' - - # Database # https://docs.djangoproject.com/en/3.1/ref/settings/#databases @@ -115,9 +111,7 @@ TIME_ZONE = 'UTC' USE_I18N = True - USE_L10N = True - USE_TZ = True @@ -126,13 +120,13 @@ STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, "static") +STATICFILES_STORAGE = 'whitenoise.storage.CompressedStaticFilesStorage' CHANNEL_LAYERS = { - "default": { - "BACKEND": "channels.layers.InMemoryChannelLayer" - } + "default": { + # IMPORTANT, do not ever use this in a production environment + "BACKEND": "channels.layers.InMemoryChannelLayer" + } } - - ASGI_APPLICATION = 'sockpuppet.routing.application' - +WSGI_APPLICATION = 'app.wsgi.application' diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..7934446 --- /dev/null +++ b/readme.md @@ -0,0 +1,14 @@ +# Django sockpuppet expo + +## Running locally + +``` +pip install -r requirements.in +yarn install +yarn run watch + +python manage.py migrate +python manage.py runserver +``` + + diff --git a/requirements.in b/requirements.in index 5b1de52..20a4828 100644 --- a/requirements.in +++ b/requirements.in @@ -3,6 +3,7 @@ django-sockpuppet requests django-pygments-renderer django-widget-tweaks +whitenoise # deployment fabric