Application error after deploy django app on heroku

87 Views Asked by At

I have successfully built and deployed my DJANGO app on the HEROKU. During building the application collectstatic also is running smoothly. But after everything completed successfully when I tries to open my app it is showing me application error. I have adding my recent log with this question. If anyone needs more information to analyze and give the solution then I can provide that also.

recent log of heroku

2022-08-19T05:51:36.278162+00:00 app[api]: Initial release by user [email protected]

2022-08-19T05:51:36.278162+00:00 app[api]: Release v1 created by user [email protected] 2022-08-19T05:51:36.436285+00:00 app[api]: Enable Logplex by user [email protected] 2022-08-19T05:51:36.436285+00:00 app[api]: Release v2 created by user [email protected] 2022-08-19T05:51:57.696877+00:00 app[api]: Stack changed from heroku-20 to heroku-22 by user [email protected] 2022-08-19T05:51:57.713307+00:00 app[api]: Release v3 created by user [email protected] 2022-08-19T05:51:57.713307+00:00 app[api]: Upgrade stack to heroku-22 by user [email protected] 2022-08-19T05:52:24.000000+00:00 app[api]: Build started by user [email protected] 2022-08-19T05:53:26.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/4295d649-fdd6-4ff6-a915-07b881b4b295/activity/builds/614228a6-7a78-4922-ba2d-2bc5f297c905 2022-08-19T05:53:39.192112+00:00 app[api]: Release v4 created by user [email protected] 2022-08-19T05:53:39.192112+00:00 app[api]: Set DISABLE_COLLECTSTATIC config vars by user [email protected] 2022-08-19T05:53:45.000000+00:00 app[api]: Build started by user [email protected] 2022-08-19T05:55:33.534266+00:00 app[api]: Attach DATABASE (@ref:postgresql-symmetrical-16068) by user [email protected] 2022-08-19T05:55:33.534266+00:00 app[api]: Running release v5 commands by user [email protected] 2022-08-19T05:55:33.545559+00:00 app[api]: Release v6 created by user [email protected] 2022-08-19T05:55:33.545559+00:00 app[api]: @ref:postgresql-symmetrical-16068 completed provisioning, setting DATABASE_URL. by user [email protected] 2022-08-19T05:55:33.844912+00:00 app[api]: Release v7 created by user [email protected] 2022-08-19T05:55:33.844912+00:00 app[api]: Deploy a1c533bf by user [email protected] 2022-08-19T05:56:17.000000+00:00 app[api]: Build succeeded 2022-08-19T05:56:22.086314+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=find-my-book-library-chain.herokuapp.com request_id=5d56e1c3-1b09-424e-b4b4-a59a15d235a0 fwd="27.61.251.81" dyno= connect= service= status=503 bytes= protocol=https 2022-08-19T05:56:22.452264+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=find-my-book-library-chain.herokuapp.com request_id=6d39d192-c016-4e73-813d-a8a9f36ebcc1 fwd="27.61.251.81" dyno= connect= service= status=503 bytes= protocol=https 2022-08-19T05:56:50.238994+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=find-my-book-library-chain.herokuapp.com request_id=f97b737f-26d3-4557-abf2-8e48feb2e368 fwd="27.61.251.81" dyno= connect= service= status=503 bytes= protocol=https 2022-08-19T05:56:51.235519+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=find-my-book-library-chain.herokuapp.com request_id=7c7e31dd-1646-4568-b252-5b435ebfe943 fwd="27.61.251.81" dyno= connect= service= status=503 bytes= protocol=https 2022-08-19T05:58:55.616142+00:00 app[api]: Starting process with command python manage.py collectstatic --dry-run --noinput by user [email protected] 2022-08-19T05:59:09.924853+00:00 heroku[run.7797]: Awaiting client 2022-08-19T05:59:09.945662+00:00 heroku[run.7797]: Starting process with command python manage.py collectstatic --dry-run --noinput 2022-08-19T05:59:09.955208+00:00 heroku[run.7797]: State changed from starting to up 2022-08-19T05:59:14.971702+00:00 heroku[run.7797]: Process exited with status 1 2022-08-19T05:59:15.015777+00:00 heroku[run.7797]: State changed from up to complete 2022-08-19T06:06:39.580231+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=find-my-book-library-chain.herokuapp.com request_id=5e433d3a-87ce-4b17-a9e4-47d4c42c7ce6 fwd="27.61.251.81" dyno= connect= service= status=503 bytes= protocol=https 2022-08-19T06:06:40.346209+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=find-my-book-library-chain.herokuapp.com request_id=63b59ee4-c5c5-41e7-96e9-9fbf91fbbb88 fwd="27.61.251.81" dyno= connect= service= status=503 bytes= protocol=https 2022-08-19T06:12:26.000000+00:00 app[api]: Build started by user [email protected] 2022-08-19T06:12:35.357779+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=find-my-book-library-chain.herokuapp.com request_id=1d44e2e5-4e04-4028-9c32-6d2cdf0b1429 fwd="27.61.251.81" dyno= connect= service= status=503 bytes= protocol=https 2022-08-19T06:12:35.752287+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=find-my-book-library-chain.herokuapp.com request_id=0221448f-68b2-42a9-8e75-54ae2b422b1e fwd="27.61.251.81" dyno= connect= service= status=503 bytes= protocol=https 2022-08-19T06:13:54.066130+00:00 app[api]: Release v8 created by user [email protected] 2022-08-19T06:13:54.066130+00:00 app[api]: Deploy cbbe65ce by user [email protected] 2022-08-19T06:14:08.023950+00:00 app[api]: Release v9 created by user [email protected] 2022-08-19T06:14:08.023950+00:00 app[api]: Remove DISABLE_COLLECTSTATIC config vars by user [email protected] 2022-08-19T06:14:35.000000+00:00 app[api]: Build succeeded 2022-08-19T06:14:45.000000+00:00 app[api]: Build started by user [email protected] 2022-08-19T06:15:34.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/4295d649-fdd6-4ff6-a915-07b881b4b295/activity/builds/c0dff10a-4a59-4b90-acce-b44b01741a38 2022-08-19T06:31:24.000000+00:00 app[api]: Build started by user [email protected] 2022-08-19T06:33:03.574438+00:00 app[api]: Deploy 4d576ad2 by user [email protected] 2022-08-19T06:33:03.574438+00:00 app[api]: Release v10 created by user [email protected] 2022-08-19T06:33:45.000000+00:00 app[api]: Build succeeded 2022-08-19T06:34:30.106715+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=find-my-book-library-chain.herokuapp.com request_id=03ff21ab-61f3-4346-9d2d-d06bc232eda7 fwd="27.61.251.81" dyno= connect= service= status=503 bytes= protocol=https 2022-08-19T06:34:30.584631+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=find-my-book-library-chain.herokuapp.com request_id=3eed7ffc-6afc-4009-8267-9bba2ae0a719 fwd="27.61.251.81" dyno= connect= service= status=503 bytes= protocol=https 2022-08-19T06:44:12.627223+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=find-my-book-library-chain.herokuapp.com request_id=90a23f36-30ca-44bd-979d-60c4c70b5bfb fwd="27.61.251.81" dyno= connect= service= status=503 bytes= protocol=https 2022-08-19T06:44:13.207881+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=find-my-book-library-chain.herokuapp.com request_id=4b1235bb-620d-4c07-835a-0fc57e283b21 fwd="27.61.251.81" dyno= connect= service= status=503 bytes= protocol=https 2022-08-19T06:44:41.000000+00:00 app[api]: Build started by user [email protected] 2022-08-19T06:46:22.674154+00:00 app[api]: Deploy 1fd5b001 by user [email protected] 2022-08-19T06:46:22.674154+00:00 app[api]: Release v11 created by user [email protected] 2022-08-19T06:47:06.000000+00:00 app[api]: Build succeeded 2022-08-19T06:47:11.890355+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=find-my-book-library-chain.herokuapp.com request_id=6ea47f0f-a33e-4dd1-9d22-ce67a5232340 fwd="27.61.251.81" dyno= connect= service= status=503 bytes= protocol=https 2022-08-19T06:47:12.295691+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=find-my-book-library-chain.herokuapp.com request_id=47ec7db6-71cd-4b7d-9e19-308df3398d5c fwd="27.61.251.81" dyno= connect= service= status=503 bytes= protocol=https

satting.py file '''

    import os

"""
Django settings for find_my_book project.

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

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

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

from pathlib import Path

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent


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

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-%&q9ti#1*5snurg)-3@#807m8s&9_%f%3o%^x_1(12=mo^%(my'

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

ALLOWED_HOSTS = ['127.0.0.1' , 'find-my-book-library-chain.herokuapp.com']


# Application definition

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

    # my apps
    'home',
    'phonenumber_field',
    'dajaxice',
    'dajax',
    'import_export'
]

AUTH_USER_MODEL = 'home.CustomAuthentoication'

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'whitenoise.middleware.WhiteNoiseMiddleware',
    '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 = 'find_my_book.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 = 'find_my_book.wsgi.application'


# Database
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases

DATABASES = {

    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'find_my_book', 
        'USER': 'postgres', 
        'PASSWORD': '',
        'HOST': '127.0.0.1', 
        'PORT': '5432',
    }
}


# Password validation
# https://docs.djangoproject.com/en/4.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/4.0/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_TZ = True


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

STATIC_URL = 'static/'

# Default primary key field type
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'



# *************************************
# **********ADDED MANUALLY************
# *************************************

# registration of the static folder
STATICFILES_DIRS = [
    os.path.join(BASE_DIR , "static")
]




LOGIN_REDIRECT_URL = 'index'
ACCOUNT_LOGOUT_REDIRECT_URL = 'index'


# settings for the DJANG-DAJAX
TEMPLATE_LOADERS = (
   'django.template.loaders.filesystem.Loader',
   'django.template.loaders.app_directories.Loader',
   'django.template.loaders.eggs.Loader',
)

TEMPLATE_CONTEXT_PROCESSORS = (
   'django.contrib.auth.context_processors.auth',
   'django.core.context_processors.debug',
   'django.core.context_processors.i18n',
   'django.core.context_processors.media',
   'django.core.context_processors.static',
   'django.core.context_processors.request',
   'django.contrib.messages.context_processors.messages'
)

STATICFILES_FINDERS = (
   'django.contrib.staticfiles.finders.FileSystemFinder',
   'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#    'dajaxice.finders.DajaxiceFinder',
)

# DAJAXICE_MEDIA_PREFIX = 'dajaxice'


STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles") 
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
# STATICFILES_STORAGE='whitenoise.django.GzipManifestStaticFilesStorage'

'''

urls.py file

from django.contrib import admin
from django.urls import path , include
from django.conf.urls import url
from django.views.static import serve
from django.conf import settings

urlpatterns = [
    path('admin/', admin.site.urls),
    path('' , include('home.urls')),
    
    url(r'^media/(?P<path>.*)$', serve,{'document_root':       settings.MEDIA_ROOT}), 
    url(r'^static/(?P<path>.*)$', serve,{'document_root': settings.STATIC_ROOT}),
]
0

There are 0 best solutions below