[GH-ISSUE #150] CSS file is not working while deploying to the heroku. #101

Closed
opened 2026-02-25 23:41:11 +03:00 by kerem · 6 comments
Owner

Originally created by @kumareshsaran on GitHub (Jan 19, 2018).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/150

Here is my settings.py file.I don't know where is the issues.if any one knows please ping me.

import os
import warnings

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

HOST = "localhost"
SECRET_KEY = "---"
DEBUG = True
ALLOWED_HOSTS = ['127.0.0.1', 'localhost', 'healthchecks-app.herokuapp.com']
DEFAULT_FROM_EMAIL = 'healthchecks@example.org'
USE_PAYMENTS = False
REGISTRATION_OPEN = True


INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.humanize',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'compressor',
    'hc.accounts',
    'hc.api',
    'hc.front',
    'hc.payments'
)

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',
    'hc.accounts.middleware.TeamAccessMiddleware',
)

AUTHENTICATION_BACKENDS = (
    'hc.accounts.backends.EmailBackend',
    'hc.accounts.backends.ProfileBackend'
)

ROOT_URLCONF = 'hc.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',
                'hc.payments.context_processors.payments'
            ],
        },
    },
]

WSGI_APPLICATION = 'hc.wsgi.application'
TEST_RUNNER = 'hc.api.tests.CustomRunner'


# Default database engine is SQLite. So one can just check out code,
# install requirements.txt and do manage.py runserver and it works
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': './hc.sqlite',
    }
}

# You can switch database engine to postgres or mysql using environment
# variable 'DB'. Travis CI does this.
if os.environ.get("DB") == "postgres":
    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.postgresql',
            'USER': 'postgres',
            'NAME': 'hc',
            'TEST': {'CHARSET': 'UTF8'}
        }
    }

if os.environ.get("DB") == "mysql":
    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.mysql',
            'USER': 'root',
            'NAME': 'hc',
            'TEST': {'CHARSET': 'UTF8'}
        }
    }

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True

SITE_ROOT = "https://healthchecks-app.herokuapp.com/"
SITE_NAME = MASTER_BADGE_LABEL = "Mychecks"
PING_ENDPOINT = SITE_ROOT + "/ping/"
PING_EMAIL_DOMAIN = HOST
STATIC_URL = '/static-collected/static/'
STATICFILES_DIRS = [os.path.join(BASE_DIR, "static")]
STATIC_ROOT = os.path.join(BASE_DIR, 'static-collected')
STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'whitenoise.middleware.WhiteNoiseMiddleware',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    'compressor.finders.CompressorFinder',
)
COMPRESS_OFFLINE = True
COMPRESS_CSS_HASHING_METHOD = "content"

# Discord integration -- override these in local_settings
DISCORD_CLIENT_ID = None
DISCORD_CLIENT_SECRET = None

# Slack integration -- override these in local_settings
SLACK_CLIENT_ID = None
SLACK_CLIENT_SECRET = None

# Pushover integration -- override these in local_settings
PUSHOVER_API_TOKEN = None
PUSHOVER_SUBSCRIPTION_URL = None
PUSHOVER_EMERGENCY_RETRY_DELAY = 300
PUSHOVER_EMERGENCY_EXPIRATION = 86400

# Pushbullet integration -- override these in local_settings
PUSHBULLET_CLIENT_ID = None
PUSHBULLET_CLIENT_SECRET = None

# Telegram integration -- override in local_settings.py
TELEGRAM_BOT_NAME = "ExampleBot"
TELEGRAM_TOKEN = None

# SMS (Twilio) integration -- override in local_settings.py
TWILIO_ACCOUNT = None
TWILIO_AUTH = None
TWILIO_FROM = None

# PagerDuty
PD_VENDOR_KEY = None

# Zendesk
ZENDESK_CLIENT_ID = None
ZENDESK_CLIENT_SECRET = None

if os.path.exists(os.path.join(BASE_DIR, "hc/local_settings.py")):
    from .local_settings import *
else:
    warnings.warn("local_settings.py not found, using defaults")
Originally created by @kumareshsaran on GitHub (Jan 19, 2018). Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/150 Here is my settings.py file.I don't know where is the issues.if any one knows please ping me. ``` import os import warnings BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) HOST = "localhost" SECRET_KEY = "---" DEBUG = True ALLOWED_HOSTS = ['127.0.0.1', 'localhost', 'healthchecks-app.herokuapp.com'] DEFAULT_FROM_EMAIL = 'healthchecks@example.org' USE_PAYMENTS = False REGISTRATION_OPEN = True INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.humanize', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'compressor', 'hc.accounts', 'hc.api', 'hc.front', 'hc.payments' ) 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', 'hc.accounts.middleware.TeamAccessMiddleware', ) AUTHENTICATION_BACKENDS = ( 'hc.accounts.backends.EmailBackend', 'hc.accounts.backends.ProfileBackend' ) ROOT_URLCONF = 'hc.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', 'hc.payments.context_processors.payments' ], }, }, ] WSGI_APPLICATION = 'hc.wsgi.application' TEST_RUNNER = 'hc.api.tests.CustomRunner' # Default database engine is SQLite. So one can just check out code, # install requirements.txt and do manage.py runserver and it works DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': './hc.sqlite', } } # You can switch database engine to postgres or mysql using environment # variable 'DB'. Travis CI does this. if os.environ.get("DB") == "postgres": DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'USER': 'postgres', 'NAME': 'hc', 'TEST': {'CHARSET': 'UTF8'} } } if os.environ.get("DB") == "mysql": DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'USER': 'root', 'NAME': 'hc', 'TEST': {'CHARSET': 'UTF8'} } } LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True SITE_ROOT = "https://healthchecks-app.herokuapp.com/" SITE_NAME = MASTER_BADGE_LABEL = "Mychecks" PING_ENDPOINT = SITE_ROOT + "/ping/" PING_EMAIL_DOMAIN = HOST STATIC_URL = '/static-collected/static/' STATICFILES_DIRS = [os.path.join(BASE_DIR, "static")] STATIC_ROOT = os.path.join(BASE_DIR, 'static-collected') STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'whitenoise.middleware.WhiteNoiseMiddleware', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', 'compressor.finders.CompressorFinder', ) COMPRESS_OFFLINE = True COMPRESS_CSS_HASHING_METHOD = "content" # Discord integration -- override these in local_settings DISCORD_CLIENT_ID = None DISCORD_CLIENT_SECRET = None # Slack integration -- override these in local_settings SLACK_CLIENT_ID = None SLACK_CLIENT_SECRET = None # Pushover integration -- override these in local_settings PUSHOVER_API_TOKEN = None PUSHOVER_SUBSCRIPTION_URL = None PUSHOVER_EMERGENCY_RETRY_DELAY = 300 PUSHOVER_EMERGENCY_EXPIRATION = 86400 # Pushbullet integration -- override these in local_settings PUSHBULLET_CLIENT_ID = None PUSHBULLET_CLIENT_SECRET = None # Telegram integration -- override in local_settings.py TELEGRAM_BOT_NAME = "ExampleBot" TELEGRAM_TOKEN = None # SMS (Twilio) integration -- override in local_settings.py TWILIO_ACCOUNT = None TWILIO_AUTH = None TWILIO_FROM = None # PagerDuty PD_VENDOR_KEY = None # Zendesk ZENDESK_CLIENT_ID = None ZENDESK_CLIENT_SECRET = None if os.path.exists(os.path.join(BASE_DIR, "hc/local_settings.py")): from .local_settings import * else: warnings.warn("local_settings.py not found, using defaults") ```
kerem closed this issue 2026-02-25 23:41:11 +03:00
Author
Owner

@iphoting commented on GitHub (Jan 19, 2018):

I’ve made a Heroku-compatible fork, you might want to try it out: https://github.com/iphoting/healthchecks/

<!-- gh-comment-id:358941048 --> @iphoting commented on GitHub (Jan 19, 2018): I’ve made a Heroku-compatible fork, you might want to try it out: https://github.com/iphoting/healthchecks/
Author
Owner

@kumareshsaran commented on GitHub (Jan 19, 2018):

Hi thank you for your response.. I try to deploy this project.it shows error in deployment.below i mention the error.

   Compressing... Traceback (most recent call last):
         File "manage.py", line 10, in <module>
           execute_from_command_line(sys.argv)
         File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
           utility.execute()
         File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 356, in execute
           self.fetch_command(subcommand).run_from_argv(self.argv)
         File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/base.py", line 283, in run_from_argv
           self.execute(*args, **cmd_options)
         File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/base.py", line 330, in execute
           output = self.handle(*args, **options)
         File "/app/.heroku/python/lib/python3.6/site-packages/compressor/management/commands/compress.py", line 307, in handle
           self.compress(**opts)
         File "/app/.heroku/python/lib/python3.6/site-packages/compressor/management/commands/compress.py", line 242, in compress
           rendered = parser.render_nodelist(template, context, node)
         File "/app/.heroku/python/lib/python3.6/site-packages/compressor/offline/django.py", line 114, in render_nodelist
           return node.nodelist.render(context)
         File "/app/.heroku/python/lib/python3.6/site-packages/django/template/base.py", line 990, in render
           bit = node.render_annotated(context)
         File "/app/.heroku/python/lib/python3.6/site-packages/django/template/base.py", line 957, in render_annotated
           return self.render(context)
         File "/app/.heroku/python/lib/python3.6/site-packages/django/templatetags/static.py", line 105, in render
           url = self.url(context)
         File "/app/.heroku/python/lib/python3.6/site-packages/django/templatetags/static.py", line 102, in url
           return self.handle_simple(path)
         File "/app/.heroku/python/lib/python3.6/site-packages/django/templatetags/static.py", line 117, in handle_simple
           return staticfiles_storage.url(path)
         File "/app/.heroku/python/lib/python3.6/site-packages/django/contrib/staticfiles/storage.py", line 162, in url
           return self._url(self.stored_name, name, force)
         File "/app/.heroku/python/lib/python3.6/site-packages/django/contrib/staticfiles/storage.py", line 141, in _url
           hashed_name = hashed_name_func(*args)
         File "/app/.heroku/python/lib/python3.6/site-packages/django/contrib/staticfiles/storage.py", line 432, in stored_name
           raise ValueError("Missing staticfiles manifest entry for '%s'" % clean_name)
       ValueError: Missing staticfiles manifest entry for 'css/bootstrap.css'
 !     Push rejected, failed to compile Python app.
 !     Push failed
<!-- gh-comment-id:358958712 --> @kumareshsaran commented on GitHub (Jan 19, 2018): Hi thank you for your response.. I try to deploy this project.it shows error in deployment.below i mention the error. ``` Compressing... Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line utility.execute() File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 356, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/base.py", line 283, in run_from_argv self.execute(*args, **cmd_options) File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/base.py", line 330, in execute output = self.handle(*args, **options) File "/app/.heroku/python/lib/python3.6/site-packages/compressor/management/commands/compress.py", line 307, in handle self.compress(**opts) File "/app/.heroku/python/lib/python3.6/site-packages/compressor/management/commands/compress.py", line 242, in compress rendered = parser.render_nodelist(template, context, node) File "/app/.heroku/python/lib/python3.6/site-packages/compressor/offline/django.py", line 114, in render_nodelist return node.nodelist.render(context) File "/app/.heroku/python/lib/python3.6/site-packages/django/template/base.py", line 990, in render bit = node.render_annotated(context) File "/app/.heroku/python/lib/python3.6/site-packages/django/template/base.py", line 957, in render_annotated return self.render(context) File "/app/.heroku/python/lib/python3.6/site-packages/django/templatetags/static.py", line 105, in render url = self.url(context) File "/app/.heroku/python/lib/python3.6/site-packages/django/templatetags/static.py", line 102, in url return self.handle_simple(path) File "/app/.heroku/python/lib/python3.6/site-packages/django/templatetags/static.py", line 117, in handle_simple return staticfiles_storage.url(path) File "/app/.heroku/python/lib/python3.6/site-packages/django/contrib/staticfiles/storage.py", line 162, in url return self._url(self.stored_name, name, force) File "/app/.heroku/python/lib/python3.6/site-packages/django/contrib/staticfiles/storage.py", line 141, in _url hashed_name = hashed_name_func(*args) File "/app/.heroku/python/lib/python3.6/site-packages/django/contrib/staticfiles/storage.py", line 432, in stored_name raise ValueError("Missing staticfiles manifest entry for '%s'" % clean_name) ValueError: Missing staticfiles manifest entry for 'css/bootstrap.css' ! Push rejected, failed to compile Python app. ! Push failed ```
Author
Owner

@kumareshsaran commented on GitHub (Jan 19, 2018):

Thank you so much, friend.it's working fine

<!-- gh-comment-id:358967459 --> @kumareshsaran commented on GitHub (Jan 19, 2018): Thank you so much, friend.it's working fine
Author
Owner

@YayiniSundar commented on GitHub (Jan 20, 2018):

This is my heroku link : https://healthchecks-app.herokuapp.com/ I am not getting specific image.png files as it is loaded using Static compress file.

Here is my Settings.py file:

"""
Django settings for hc project.

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

import os
import warnings

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

HOST = "localhost"
SECRET_KEY = "---"
DEBUG = True
ALLOWED_HOSTS = []
DEFAULT_FROM_EMAIL = 'healthchecks@example.org'
USE_PAYMENTS = False
REGISTRATION_OPEN = True
TEMPLATE_DEBUG = False


INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.humanize',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'compressor',
    'hc.accounts',
    'hc.api',
    'hc.front',
    'hc.payments'
)

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',
    'hc.accounts.middleware.TeamAccessMiddleware',
)

AUTHENTICATION_BACKENDS = (
    'hc.accounts.backends.EmailBackend',
    'hc.accounts.backends.ProfileBackend'
)

ROOT_URLCONF = 'hc.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',
                'hc.payments.context_processors.payments'
            ],
        },
    },
]

WSGI_APPLICATION = 'hc.wsgi.application'
TEST_RUNNER = 'hc.api.tests.CustomRunner'


# Default database engine is SQLite. So one can just check out code,
# install requirements.txt and do manage.py runserver and it works
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': './hc.sqlite',
    }
}

# You can switch database engine to postgres or mysql using environment
# variable 'DB'. Travis CI does this.
if os.environ.get("DB") == "postgres":
    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.postgresql',
            'USER': 'postgres',
            'NAME': 'hc',
            'TEST': {'CHARSET': 'UTF8'}
        }
    }

if os.environ.get("DB") == "mysql":
    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.mysql',
            'USER': 'root',
            'NAME': 'hc',
            'TEST': {'CHARSET': 'UTF8'}
        }
    }

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True

SITE_ROOT = "http://localhost:8000"
SITE_NAME = MASTER_BADGE_LABEL = "Mychecks"
PING_ENDPOINT = SITE_ROOT + "/ping/"
PING_EMAIL_DOMAIN = HOST
STATIC_URL = '/static/'
STATICFILES_DIRS = [os.path.join(BASE_DIR, "static")]
STATIC_ROOT = os.path.join(BASE_DIR, 'static-collected')
STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    'compressor.finders.CompressorFinder',
)
COMPRESS_OFFLINE = True
COMPRESS_ENABLED = True
COMPRESS_ROOT = STATIC_ROOT
COMPRESS_CSS_HASHING_METHOD = "content"
COMPRESS_OUTPUT_DIR = ''

COMPRESS_CSS_FILTERS = [
    # Creates absolute urls from relative ones.
    'compressor.filters.css_default.CssAbsoluteFilter',
    # CSS minimizer.
    'compressor.filters.cssmin.CSSMinFilter'
]

# Discord integration -- override these in local_settings
DISCORD_CLIENT_ID = None
DISCORD_CLIENT_SECRET = None

# Slack integration -- override these in local_settings
SLACK_CLIENT_ID = None
SLACK_CLIENT_SECRET = None

# Pushover integration -- override these in local_settings
PUSHOVER_API_TOKEN = None
PUSHOVER_SUBSCRIPTION_URL = None
PUSHOVER_EMERGENCY_RETRY_DELAY = 300
PUSHOVER_EMERGENCY_EXPIRATION = 86400

# Pushbullet integration -- override these in local_settings
PUSHBULLET_CLIENT_ID = None
PUSHBULLET_CLIENT_SECRET = None

# Telegram integration -- override in local_settings.py
TELEGRAM_BOT_NAME = "ExampleBot"
TELEGRAM_TOKEN = None

# SMS (Twilio) integration -- override in local_settings.py
TWILIO_ACCOUNT = None
TWILIO_AUTH = None
TWILIO_FROM = None

# PagerDuty
PD_VENDOR_KEY = None

# Zendesk
ZENDESK_CLIENT_ID = None
ZENDESK_CLIENT_SECRET = None

if os.path.exists(os.path.join(BASE_DIR, "hc/local_settings.py")):
    from .local_settings import *
elif ('ON_HEROKU' in os.environ or 'DYNO' in os.environ or 'STACK' in os.environ) and os.path.exists(os.path.join(BASE_DIR, "hc/heroku_settings.py")):
    from .heroku_settings import *
else:
    warnings.warn("local_settings.py not found, using defaults")

In base.html css static is not loading for following objects:

Failed to load resource: the server responded with a status of 404 (Not Found) period_grace.png Failed to load resource: the server responded with a status of 404 (Not Found) my_checks.png Failed to load resource: the server responded with a status of 404 (Not Found) channels.png Failed to load resource: the server responded with a status of 404 (Not Found) cron.png Failed to load resource: the server responded with a status of 404 (Not Found) icomoon.ttf Failed to load resource: the server responded with a status of 404 (Not Found) icomoon.woff Failed to load resource: the server responded with a status of 404 (Not Found)

Please do brief description as i am in learning phase of Django and heroku.

Thanks In Advance

<!-- gh-comment-id:359155617 --> @YayiniSundar commented on GitHub (Jan 20, 2018): This is my heroku link : https://healthchecks-app.herokuapp.com/ I am not getting specific image.png files as it is loaded using Static compress file. Here is my Settings.py file: """ Django settings for hc project. ``` Generated by 'django-admin startproject' using Django 1.8.2. import os import warnings BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) HOST = "localhost" SECRET_KEY = "---" DEBUG = True ALLOWED_HOSTS = [] DEFAULT_FROM_EMAIL = 'healthchecks@example.org' USE_PAYMENTS = False REGISTRATION_OPEN = True TEMPLATE_DEBUG = False INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.humanize', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'compressor', 'hc.accounts', 'hc.api', 'hc.front', 'hc.payments' ) 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', 'hc.accounts.middleware.TeamAccessMiddleware', ) AUTHENTICATION_BACKENDS = ( 'hc.accounts.backends.EmailBackend', 'hc.accounts.backends.ProfileBackend' ) ROOT_URLCONF = 'hc.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', 'hc.payments.context_processors.payments' ], }, }, ] WSGI_APPLICATION = 'hc.wsgi.application' TEST_RUNNER = 'hc.api.tests.CustomRunner' # Default database engine is SQLite. So one can just check out code, # install requirements.txt and do manage.py runserver and it works DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': './hc.sqlite', } } # You can switch database engine to postgres or mysql using environment # variable 'DB'. Travis CI does this. if os.environ.get("DB") == "postgres": DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'USER': 'postgres', 'NAME': 'hc', 'TEST': {'CHARSET': 'UTF8'} } } if os.environ.get("DB") == "mysql": DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'USER': 'root', 'NAME': 'hc', 'TEST': {'CHARSET': 'UTF8'} } } LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True SITE_ROOT = "http://localhost:8000" SITE_NAME = MASTER_BADGE_LABEL = "Mychecks" PING_ENDPOINT = SITE_ROOT + "/ping/" PING_EMAIL_DOMAIN = HOST STATIC_URL = '/static/' STATICFILES_DIRS = [os.path.join(BASE_DIR, "static")] STATIC_ROOT = os.path.join(BASE_DIR, 'static-collected') STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', 'compressor.finders.CompressorFinder', ) COMPRESS_OFFLINE = True COMPRESS_ENABLED = True COMPRESS_ROOT = STATIC_ROOT COMPRESS_CSS_HASHING_METHOD = "content" COMPRESS_OUTPUT_DIR = '' COMPRESS_CSS_FILTERS = [ # Creates absolute urls from relative ones. 'compressor.filters.css_default.CssAbsoluteFilter', # CSS minimizer. 'compressor.filters.cssmin.CSSMinFilter' ] # Discord integration -- override these in local_settings DISCORD_CLIENT_ID = None DISCORD_CLIENT_SECRET = None # Slack integration -- override these in local_settings SLACK_CLIENT_ID = None SLACK_CLIENT_SECRET = None # Pushover integration -- override these in local_settings PUSHOVER_API_TOKEN = None PUSHOVER_SUBSCRIPTION_URL = None PUSHOVER_EMERGENCY_RETRY_DELAY = 300 PUSHOVER_EMERGENCY_EXPIRATION = 86400 # Pushbullet integration -- override these in local_settings PUSHBULLET_CLIENT_ID = None PUSHBULLET_CLIENT_SECRET = None # Telegram integration -- override in local_settings.py TELEGRAM_BOT_NAME = "ExampleBot" TELEGRAM_TOKEN = None # SMS (Twilio) integration -- override in local_settings.py TWILIO_ACCOUNT = None TWILIO_AUTH = None TWILIO_FROM = None # PagerDuty PD_VENDOR_KEY = None # Zendesk ZENDESK_CLIENT_ID = None ZENDESK_CLIENT_SECRET = None if os.path.exists(os.path.join(BASE_DIR, "hc/local_settings.py")): from .local_settings import * elif ('ON_HEROKU' in os.environ or 'DYNO' in os.environ or 'STACK' in os.environ) and os.path.exists(os.path.join(BASE_DIR, "hc/heroku_settings.py")): from .heroku_settings import * else: warnings.warn("local_settings.py not found, using defaults") ``` In base.html css static is not loading for following objects: Failed to load resource: the server responded with a status of 404 (Not Found) period_grace.png Failed to load resource: the server responded with a status of 404 (Not Found) my_checks.png Failed to load resource: the server responded with a status of 404 (Not Found) channels.png Failed to load resource: the server responded with a status of 404 (Not Found) cron.png Failed to load resource: the server responded with a status of 404 (Not Found) icomoon.ttf Failed to load resource: the server responded with a status of 404 (Not Found) icomoon.woff Failed to load resource: the server responded with a status of 404 (Not Found) Please do brief description as i am in learning phase of Django and heroku. Thanks In Advance
Author
Owner

@mwaz commented on GitHub (Mar 27, 2018):

That is something to do with static files. disable collect static should be set to 0 on your env. that should work

<!-- gh-comment-id:376405564 --> @mwaz commented on GitHub (Mar 27, 2018): That is something to do with static files. disable collect static should be set to 0 on your env. that should work
Author
Owner

@cuu508 commented on GitHub (Jan 7, 2019):

Looks like the original issue was resolved, closing.

<!-- gh-comment-id:452054723 --> @cuu508 commented on GitHub (Jan 7, 2019): Looks like the original issue was resolved, closing.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/healthchecks#101
No description provided.