500 server error when debug=False in production












0















I have been trying for several weeks to resolve an issue with my deployment settings. When debug=True the Heroku app works fine, however, when I change debug to =False I always get a 500 server error. I have tried every suggestion on the other stackoverflow threads regarding this issue and none seem to work for me. Please let me know if you have any suggestions.



"""
Django settings for scipertise_demo project.

Generated by 'django-admin startproject' using Django 2.0.5.

For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""

import os
import django_heroku
import dj_database_url


# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/

#API_KEY ='46235562'

# SECURITY WARNING: keep the secret key used in production secret!

SECRET_KEY = 'SECRET_KEY'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = ['*']


# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',

'pages',
'users',
'search',
'taggit',
'booking',
'bootstrap4',
'bootstrap_datepicker_plus',
'widget_tweaks',
'sendgrid',





]

#HAYSTACK_CONNECTIONS = {
# 'default': {
# 'ENGINE': 'haystack.backends.elasticsearch2_backend.Elasticsearch2SearchEngine',
# 'URL': 'http://127.0.0.1:9200/',
# 'INDEX_NAME': 'haystack',
# },
#}

CRISPY_TEMPLATE_PACK = 'bootstrap4'
BOOTSTRAP4 = {
'include_jquery': True,
}

SITE_ID = 1

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',

]

ROOT_URLCONF = 'scipertise_demo.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'scipertise_demo.wsgi.application'


# Database
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
#DATABASES = {
# 'default': dj_database_url.config(
# default=config('DATABASE_URL')
# )
#}

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}


# Password validation
# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]


# Internationalization
# https://docs.djangoproject.com/en/2.0/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.0/howto/static-files/


STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATIC_URL = '/static/'

# Extra places for collectstatic to find static files.
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)

MEDIA_URL = "/media/"
#MEDIA_ROOT = os.path.join(BASE_DIR,'media/')

AUTH_USER_MODEL = 'users.CustomUser'

LOGIN_REDIRECT_URL = 'home'
LOGOUT_REDIRECT_URL = 'home'

TAGGIT_CASE_INSENSITIVE = True

EMAIL_HOST = 'smtp.sendgrid.net'
EMAIL_HOST_USER = 'EMAIL_HOST_USER'
EMAIL_HOST_PASSWORD = 'EMAIL_HOST_PASSWORD'
EMAIL_PORT = 587
EMAIL_USE_TLS = True


SENDGRID_API_KEY='SENDGRID_API_KEY'
SENDGRID_PASSWORD='SENDGRID_PASSWORD'
SENDGRID_USERNAME='SENDGRID_USERNAME'


# Activate Django-Heroku.
django_heroku.settings(locals())









share|improve this question


















  • 1





    Did you try and host your static content from another source? When debug is set to false it might be that your static home is not being served.

    – Victor 'Chris' Cabral
    Jan 2 at 21:04






  • 2





    what is the error? Please share traceback from logs if possible.

    – coderDude
    Jan 2 at 21:12











  • What do you mean by another source? I have all my static files contained within my django project in the static folder and set the static root. How would I serve my static home?

    – user6210879
    Jan 3 at 0:50
















0















I have been trying for several weeks to resolve an issue with my deployment settings. When debug=True the Heroku app works fine, however, when I change debug to =False I always get a 500 server error. I have tried every suggestion on the other stackoverflow threads regarding this issue and none seem to work for me. Please let me know if you have any suggestions.



"""
Django settings for scipertise_demo project.

Generated by 'django-admin startproject' using Django 2.0.5.

For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""

import os
import django_heroku
import dj_database_url


# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/

#API_KEY ='46235562'

# SECURITY WARNING: keep the secret key used in production secret!

SECRET_KEY = 'SECRET_KEY'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = ['*']


# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',

'pages',
'users',
'search',
'taggit',
'booking',
'bootstrap4',
'bootstrap_datepicker_plus',
'widget_tweaks',
'sendgrid',





]

#HAYSTACK_CONNECTIONS = {
# 'default': {
# 'ENGINE': 'haystack.backends.elasticsearch2_backend.Elasticsearch2SearchEngine',
# 'URL': 'http://127.0.0.1:9200/',
# 'INDEX_NAME': 'haystack',
# },
#}

CRISPY_TEMPLATE_PACK = 'bootstrap4'
BOOTSTRAP4 = {
'include_jquery': True,
}

SITE_ID = 1

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',

]

ROOT_URLCONF = 'scipertise_demo.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'scipertise_demo.wsgi.application'


# Database
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
#DATABASES = {
# 'default': dj_database_url.config(
# default=config('DATABASE_URL')
# )
#}

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}


# Password validation
# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]


# Internationalization
# https://docs.djangoproject.com/en/2.0/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.0/howto/static-files/


STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATIC_URL = '/static/'

# Extra places for collectstatic to find static files.
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)

MEDIA_URL = "/media/"
#MEDIA_ROOT = os.path.join(BASE_DIR,'media/')

AUTH_USER_MODEL = 'users.CustomUser'

LOGIN_REDIRECT_URL = 'home'
LOGOUT_REDIRECT_URL = 'home'

TAGGIT_CASE_INSENSITIVE = True

EMAIL_HOST = 'smtp.sendgrid.net'
EMAIL_HOST_USER = 'EMAIL_HOST_USER'
EMAIL_HOST_PASSWORD = 'EMAIL_HOST_PASSWORD'
EMAIL_PORT = 587
EMAIL_USE_TLS = True


SENDGRID_API_KEY='SENDGRID_API_KEY'
SENDGRID_PASSWORD='SENDGRID_PASSWORD'
SENDGRID_USERNAME='SENDGRID_USERNAME'


# Activate Django-Heroku.
django_heroku.settings(locals())









share|improve this question


















  • 1





    Did you try and host your static content from another source? When debug is set to false it might be that your static home is not being served.

    – Victor 'Chris' Cabral
    Jan 2 at 21:04






  • 2





    what is the error? Please share traceback from logs if possible.

    – coderDude
    Jan 2 at 21:12











  • What do you mean by another source? I have all my static files contained within my django project in the static folder and set the static root. How would I serve my static home?

    – user6210879
    Jan 3 at 0:50














0












0








0








I have been trying for several weeks to resolve an issue with my deployment settings. When debug=True the Heroku app works fine, however, when I change debug to =False I always get a 500 server error. I have tried every suggestion on the other stackoverflow threads regarding this issue and none seem to work for me. Please let me know if you have any suggestions.



"""
Django settings for scipertise_demo project.

Generated by 'django-admin startproject' using Django 2.0.5.

For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""

import os
import django_heroku
import dj_database_url


# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/

#API_KEY ='46235562'

# SECURITY WARNING: keep the secret key used in production secret!

SECRET_KEY = 'SECRET_KEY'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = ['*']


# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',

'pages',
'users',
'search',
'taggit',
'booking',
'bootstrap4',
'bootstrap_datepicker_plus',
'widget_tweaks',
'sendgrid',





]

#HAYSTACK_CONNECTIONS = {
# 'default': {
# 'ENGINE': 'haystack.backends.elasticsearch2_backend.Elasticsearch2SearchEngine',
# 'URL': 'http://127.0.0.1:9200/',
# 'INDEX_NAME': 'haystack',
# },
#}

CRISPY_TEMPLATE_PACK = 'bootstrap4'
BOOTSTRAP4 = {
'include_jquery': True,
}

SITE_ID = 1

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',

]

ROOT_URLCONF = 'scipertise_demo.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'scipertise_demo.wsgi.application'


# Database
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
#DATABASES = {
# 'default': dj_database_url.config(
# default=config('DATABASE_URL')
# )
#}

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}


# Password validation
# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]


# Internationalization
# https://docs.djangoproject.com/en/2.0/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.0/howto/static-files/


STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATIC_URL = '/static/'

# Extra places for collectstatic to find static files.
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)

MEDIA_URL = "/media/"
#MEDIA_ROOT = os.path.join(BASE_DIR,'media/')

AUTH_USER_MODEL = 'users.CustomUser'

LOGIN_REDIRECT_URL = 'home'
LOGOUT_REDIRECT_URL = 'home'

TAGGIT_CASE_INSENSITIVE = True

EMAIL_HOST = 'smtp.sendgrid.net'
EMAIL_HOST_USER = 'EMAIL_HOST_USER'
EMAIL_HOST_PASSWORD = 'EMAIL_HOST_PASSWORD'
EMAIL_PORT = 587
EMAIL_USE_TLS = True


SENDGRID_API_KEY='SENDGRID_API_KEY'
SENDGRID_PASSWORD='SENDGRID_PASSWORD'
SENDGRID_USERNAME='SENDGRID_USERNAME'


# Activate Django-Heroku.
django_heroku.settings(locals())









share|improve this question














I have been trying for several weeks to resolve an issue with my deployment settings. When debug=True the Heroku app works fine, however, when I change debug to =False I always get a 500 server error. I have tried every suggestion on the other stackoverflow threads regarding this issue and none seem to work for me. Please let me know if you have any suggestions.



"""
Django settings for scipertise_demo project.

Generated by 'django-admin startproject' using Django 2.0.5.

For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""

import os
import django_heroku
import dj_database_url


# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/

#API_KEY ='46235562'

# SECURITY WARNING: keep the secret key used in production secret!

SECRET_KEY = 'SECRET_KEY'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = ['*']


# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',

'pages',
'users',
'search',
'taggit',
'booking',
'bootstrap4',
'bootstrap_datepicker_plus',
'widget_tweaks',
'sendgrid',





]

#HAYSTACK_CONNECTIONS = {
# 'default': {
# 'ENGINE': 'haystack.backends.elasticsearch2_backend.Elasticsearch2SearchEngine',
# 'URL': 'http://127.0.0.1:9200/',
# 'INDEX_NAME': 'haystack',
# },
#}

CRISPY_TEMPLATE_PACK = 'bootstrap4'
BOOTSTRAP4 = {
'include_jquery': True,
}

SITE_ID = 1

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',

]

ROOT_URLCONF = 'scipertise_demo.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'scipertise_demo.wsgi.application'


# Database
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
#DATABASES = {
# 'default': dj_database_url.config(
# default=config('DATABASE_URL')
# )
#}

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}


# Password validation
# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]


# Internationalization
# https://docs.djangoproject.com/en/2.0/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.0/howto/static-files/


STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATIC_URL = '/static/'

# Extra places for collectstatic to find static files.
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)

MEDIA_URL = "/media/"
#MEDIA_ROOT = os.path.join(BASE_DIR,'media/')

AUTH_USER_MODEL = 'users.CustomUser'

LOGIN_REDIRECT_URL = 'home'
LOGOUT_REDIRECT_URL = 'home'

TAGGIT_CASE_INSENSITIVE = True

EMAIL_HOST = 'smtp.sendgrid.net'
EMAIL_HOST_USER = 'EMAIL_HOST_USER'
EMAIL_HOST_PASSWORD = 'EMAIL_HOST_PASSWORD'
EMAIL_PORT = 587
EMAIL_USE_TLS = True


SENDGRID_API_KEY='SENDGRID_API_KEY'
SENDGRID_PASSWORD='SENDGRID_PASSWORD'
SENDGRID_USERNAME='SENDGRID_USERNAME'


# Activate Django-Heroku.
django_heroku.settings(locals())






python django heroku






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 2 at 21:00









user6210879user6210879

266




266








  • 1





    Did you try and host your static content from another source? When debug is set to false it might be that your static home is not being served.

    – Victor 'Chris' Cabral
    Jan 2 at 21:04






  • 2





    what is the error? Please share traceback from logs if possible.

    – coderDude
    Jan 2 at 21:12











  • What do you mean by another source? I have all my static files contained within my django project in the static folder and set the static root. How would I serve my static home?

    – user6210879
    Jan 3 at 0:50














  • 1





    Did you try and host your static content from another source? When debug is set to false it might be that your static home is not being served.

    – Victor 'Chris' Cabral
    Jan 2 at 21:04






  • 2





    what is the error? Please share traceback from logs if possible.

    – coderDude
    Jan 2 at 21:12











  • What do you mean by another source? I have all my static files contained within my django project in the static folder and set the static root. How would I serve my static home?

    – user6210879
    Jan 3 at 0:50








1




1





Did you try and host your static content from another source? When debug is set to false it might be that your static home is not being served.

– Victor 'Chris' Cabral
Jan 2 at 21:04





Did you try and host your static content from another source? When debug is set to false it might be that your static home is not being served.

– Victor 'Chris' Cabral
Jan 2 at 21:04




2




2





what is the error? Please share traceback from logs if possible.

– coderDude
Jan 2 at 21:12





what is the error? Please share traceback from logs if possible.

– coderDude
Jan 2 at 21:12













What do you mean by another source? I have all my static files contained within my django project in the static folder and set the static root. How would I serve my static home?

– user6210879
Jan 3 at 0:50





What do you mean by another source? I have all my static files contained within my django project in the static folder and set the static root. How would I serve my static home?

– user6210879
Jan 3 at 0:50












2 Answers
2






active

oldest

votes


















0














Enable white noise in the middleware.



http://whitenoise.evans.io/en/stable/django.html






share|improve this answer
























  • I tried this but still getting the error. Did you follow all of the other steps to configure your static files with whitenoise?

    – user6210879
    Jan 3 at 0:48











  • To deploy in heroku, I followed this tutorial - medium.com/agatha-codes/…

    – aSoulja
    Jan 3 at 11:29





















0














Hopefully this helps someone. The problem for me was the forward slash in '/css/layout.css' in my html template (I know.. I'm banging my head against a wall) and commenting out the line: STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' in my settings file. Worked perfectly after those two changes.






share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54013112%2f500-server-error-when-debug-false-in-production%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Enable white noise in the middleware.



    http://whitenoise.evans.io/en/stable/django.html






    share|improve this answer
























    • I tried this but still getting the error. Did you follow all of the other steps to configure your static files with whitenoise?

      – user6210879
      Jan 3 at 0:48











    • To deploy in heroku, I followed this tutorial - medium.com/agatha-codes/…

      – aSoulja
      Jan 3 at 11:29


















    0














    Enable white noise in the middleware.



    http://whitenoise.evans.io/en/stable/django.html






    share|improve this answer
























    • I tried this but still getting the error. Did you follow all of the other steps to configure your static files with whitenoise?

      – user6210879
      Jan 3 at 0:48











    • To deploy in heroku, I followed this tutorial - medium.com/agatha-codes/…

      – aSoulja
      Jan 3 at 11:29
















    0












    0








    0







    Enable white noise in the middleware.



    http://whitenoise.evans.io/en/stable/django.html






    share|improve this answer













    Enable white noise in the middleware.



    http://whitenoise.evans.io/en/stable/django.html







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jan 2 at 21:56









    aSouljaaSoulja

    2116




    2116













    • I tried this but still getting the error. Did you follow all of the other steps to configure your static files with whitenoise?

      – user6210879
      Jan 3 at 0:48











    • To deploy in heroku, I followed this tutorial - medium.com/agatha-codes/…

      – aSoulja
      Jan 3 at 11:29





















    • I tried this but still getting the error. Did you follow all of the other steps to configure your static files with whitenoise?

      – user6210879
      Jan 3 at 0:48











    • To deploy in heroku, I followed this tutorial - medium.com/agatha-codes/…

      – aSoulja
      Jan 3 at 11:29



















    I tried this but still getting the error. Did you follow all of the other steps to configure your static files with whitenoise?

    – user6210879
    Jan 3 at 0:48





    I tried this but still getting the error. Did you follow all of the other steps to configure your static files with whitenoise?

    – user6210879
    Jan 3 at 0:48













    To deploy in heroku, I followed this tutorial - medium.com/agatha-codes/…

    – aSoulja
    Jan 3 at 11:29







    To deploy in heroku, I followed this tutorial - medium.com/agatha-codes/…

    – aSoulja
    Jan 3 at 11:29















    0














    Hopefully this helps someone. The problem for me was the forward slash in '/css/layout.css' in my html template (I know.. I'm banging my head against a wall) and commenting out the line: STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' in my settings file. Worked perfectly after those two changes.






    share|improve this answer




























      0














      Hopefully this helps someone. The problem for me was the forward slash in '/css/layout.css' in my html template (I know.. I'm banging my head against a wall) and commenting out the line: STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' in my settings file. Worked perfectly after those two changes.






      share|improve this answer


























        0












        0








        0







        Hopefully this helps someone. The problem for me was the forward slash in '/css/layout.css' in my html template (I know.. I'm banging my head against a wall) and commenting out the line: STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' in my settings file. Worked perfectly after those two changes.






        share|improve this answer













        Hopefully this helps someone. The problem for me was the forward slash in '/css/layout.css' in my html template (I know.. I'm banging my head against a wall) and commenting out the line: STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' in my settings file. Worked perfectly after those two changes.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 7 at 20:23









        user6210879user6210879

        266




        266






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54013112%2f500-server-error-when-debug-false-in-production%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

            Does disintegrating a polymorphed enemy still kill it after the 2018 errata?

            A Topological Invariant for $pi_3(U(n))$