Bonjour a tous,

Après le déploiement de mon app sur Heroku j'ai une erreur 500 ... mais impossible de trouver le probleme après plusieurs solutions testées.

Merci d'avance pour votre aide

Mon log :
2020-03-25T15:22:03.790094+00:00 app[web.1]: [2020-03-25 15:22:03 +0000] [10] [INFO] Booting worker with pid: 10
2020-03-25T15:22:03.827668+00:00 app[web.1]: [2020-03-25 15:22:03 +0000] [11] [INFO] Booting worker with pid: 11
2020-03-25T15:22:10.317327+00:00 app[api]: Starting process with command `python app/manage.py migrate` by user yoh
2020-03-25T15:22:16.517827+00:00 heroku[run.1968]: State changed from starting to up
2020-03-25T15:22:16.614346+00:00 heroku[run.1968]: Awaiting client
2020-03-25T15:22:16.664513+00:00 heroku[run.1968]: Starting process with command `python app/manage.py migrate`
2020-03-25T15:22:22.092036+00:00 heroku[run.1968]: State changed from up to complete
2020-03-25T15:22:22.067686+00:00 heroku[run.1968]: Process exited with status 0
2020-03-25T15:22:50.181925+00:00 app[api]: Starting process with command `python app/manage.py createsuperuser` by user yoh
2020-03-25T15:22:57.282925+00:00 heroku[run.8388]: State changed from starting to up
2020-03-25T15:22:57.690011+00:00 heroku[run.8388]: Awaiting client
2020-03-25T15:22:57.723756+00:00 heroku[run.8388]: Starting process with command `python app/manage.py createsuperuser`
2020-03-25T15:23:20.219825+00:00 heroku[run.8388]: State changed from up to complete
2020-03-25T15:23:20.188548+00:00 heroku[run.8388]: Process exited with status 0
2020-03-25T15:24:14.393961+00:00 heroku[router]: at=info method=GET path="/" host=purbeurreapp.herokuapp.com request_id=d049d459-71b3-46ed-b07a-a9c4172979b6 fwd="109.13.3.168" dyno=web.1 connect=0ms service=123ms status=500 bytes=419 protocol=https
2020-03-25T15:24:14.394296+00:00 app[web.1]: 10.97.210.61 - - [25/Mar/2020:15:24:14 +0000] "GET / HTTP/1.1" 500 145 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.5 Safari/605.1.15"
2020-03-25T15:35:26.929117+00:00 app[api]: Starting process with command `python app/manage.py loaddata app/dump/data.json` by user yoh
2020-03-25T15:35:34.186304+00:00 heroku[run.1812]: State changed from starting to up
2020-03-25T15:35:34.451945+00:00 heroku[run.1812]: Awaiting client
2020-03-25T15:35:34.478479+00:00 heroku[run.1812]: Starting process with command `python app/manage.py loaddata app/dump/data.json`
2020-03-25T15:35:39.776206+00:00 heroku[run.1812]: State changed from up to complete
2020-03-25T15:35:39.749798+00:00 heroku[run.1812]: Process exited with status 1
2020-03-25T15:42:00.000000+00:00 app[api]: Build started by user yoh
2020-03-25T15:42:50.557952+00:00 heroku[web.1]: Restarting
2020-03-25T15:42:50.562248+00:00 heroku[web.1]: State changed from up to starting
2020-03-25T15:42:50.284057+00:00 app[api]: Deploy 5312a799 by user yoh
2020-03-25T15:42:50.284057+00:00 app[api]: Release v11 created by user yoh
2020-03-25T15:42:52.182924+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2020-03-25T15:42:52.200735+00:00 app[web.1]: [2020-03-25 15:42:52 +0000] [4] [INFO] Handling signal: term
2020-03-25T15:42:52.202073+00:00 app[web.1]: [2020-03-25 15:42:52 +0000] [11] [INFO] Worker exiting (pid: 11)
2020-03-25T15:42:52.202082+00:00 app[web.1]: [2020-03-25 15:42:52 +0000] [10] [INFO] Worker exiting (pid: 10)
2020-03-25T15:42:52.303863+00:00 app[web.1]: [2020-03-25 15:42:52 +0000] [4] [INFO] Shutting down: Master
2020-03-25T15:42:52.380966+00:00 heroku[web.1]: Process exited with status 0
2020-03-25T15:42:57.064600+00:00 heroku[web.1]: Starting process with command `gunicorn app.wsgi --chdir app/`
2020-03-25T15:42:59.000000+00:00 app[api]: Build succeeded
2020-03-25T15:43:00.108947+00:00 heroku[web.1]: State changed from starting to up
2020-03-25T15:42:59.739653+00:00 app[web.1]: [2020-03-25 15:42:59 +0000] [4] [INFO] Starting gunicorn 20.0.4
2020-03-25T15:42:59.740310+00:00 app[web.1]: [2020-03-25 15:42:59 +0000] [4] [INFO] Listening at: http://0.0.0.0:20853 (4)
2020-03-25T15:42:59.740443+00:00 app[web.1]: [2020-03-25 15:42:59 +0000] [4] [INFO] Using worker: sync
2020-03-25T15:42:59.744924+00:00 app[web.1]: [2020-03-25 15:42:59 +0000] [10] [INFO] Booting worker with pid: 10
2020-03-25T15:42:59.796719+00:00 app[web.1]: [2020-03-25 15:42:59 +0000] [11] [INFO] Booting worker with pid: 11
2020-03-25T15:43:50.272695+00:00 app[api]: Starting process with command `python app/manage.py loaddata app/dump/data.json` by user yoh
2020-03-25T15:43:57.198824+00:00 heroku[run.7767]: State changed from starting to up
2020-03-25T15:43:57.276373+00:00 heroku[run.7767]: Awaiting client
2020-03-25T15:43:57.299022+00:00 heroku[run.7767]: Starting process with command `python app/manage.py loaddata app/dump/data.json`
2020-03-25T15:44:02.340550+00:00 heroku[run.7767]: State changed from up to complete
2020-03-25T15:44:02.322943+00:00 heroku[run.7767]: Process exited with status 1
2020-03-25T15:47:53.890742+00:00 app[api]: Starting process with command `python app/manage.py loaddata app/app/dump/data.json` by user yoh
2020-03-25T15:48:03.446819+00:00 heroku[run.1889]: State changed from starting to up
2020-03-25T15:48:03.829539+00:00 heroku[run.1889]: Awaiting client
2020-03-25T15:48:03.880371+00:00 heroku[run.1889]: Starting process with command `python app/manage.py loaddata app/app/dump/data.json`
2020-03-25T15:48:26.379240+00:00 heroku[run.1889]: State changed from up to complete
2020-03-25T15:48:26.365137+00:00 heroku[run.1889]: Process exited with status 0
2020-03-25T15:49:52.443614+00:00 heroku[router]: at=info method=GET path="/" host=purbeurreapp.herokuapp.com request_id=cdce28ab-ce2c-4ff4-8be9-ab182891de1f fwd="109.13.3.168" dyno=web.1 connect=0ms service=99ms status=500 bytes=419 protocol=https
2020-03-25T15:49:52.443984+00:00 app[web.1]: 10.63.103.37 - - [25/Mar/2020:15:49:52 +0000] "GET / HTTP/1.1" 500 145 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.5 Safari/605.1.15"
2020-03-25T15:56:59.000000+00:00 app[api]: Build started by user yoh
2020-03-25T15:57:51.807247+00:00 app[api]: Release v12 created by user yoh
2020-03-25T15:57:51.807247+00:00 app[api]: Deploy 597746d5 by user yoh
2020-03-25T15:57:52.067320+00:00 heroku[web.1]: Restarting
2020-03-25T15:57:52.085557+00:00 heroku[web.1]: State changed from up to starting
2020-03-25T15:57:53.395862+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2020-03-25T15:57:53.409326+00:00 app[web.1]: [2020-03-25 15:57:53 +0000] [10] [INFO] Worker exiting (pid: 10)
2020-03-25T15:57:53.409334+00:00 app[web.1]: [2020-03-25 15:57:53 +0000] [11] [INFO] Worker exiting (pid: 11)
2020-03-25T15:57:53.420157+00:00 app[web.1]: [2020-03-25 15:57:53 +0000] [4] [INFO] Handling signal: term
2020-03-25T15:57:53.522249+00:00 app[web.1]: [2020-03-25 15:57:53 +0000] [4] [INFO] Shutting down: Master
2020-03-25T15:57:53.620020+00:00 heroku[web.1]: Process exited with status 0
2020-03-25T15:58:00.473703+00:00 heroku[web.1]: Starting process with command `gunicorn app.wsgi --chdir app/`
2020-03-25T15:58:00.000000+00:00 app[api]: Build succeeded
2020-03-25T15:58:03.421135+00:00 app[web.1]: [2020-03-25 15:58:03 +0000] [4] [INFO] Starting gunicorn 20.0.4
2020-03-25T15:58:03.421913+00:00 app[web.1]: [2020-03-25 15:58:03 +0000] [4] [INFO] Listening at: http://0.0.0.0:26163 (4)
2020-03-25T15:58:03.422039+00:00 app[web.1]: [2020-03-25 15:58:03 +0000] [4] [INFO] Using worker: sync
2020-03-25T15:58:03.427953+00:00 app[web.1]: [2020-03-25 15:58:03 +0000] [10] [INFO] Booting worker with pid: 10
2020-03-25T15:58:03.514257+00:00 app[web.1]: [2020-03-25 15:58:03 +0000] [11] [INFO] Booting worker with pid: 11
2020-03-25T15:58:04.808452+00:00 heroku[web.1]: State changed from starting to up
2020-03-25T15:58:24.849765+00:00 heroku[router]: at=info method=GET path="/" host=purbeurreapp.herokuapp.com request_id=324070bb-53e6-4944-9ab3-11b70debf391 fwd="109.13.3.168" dyno=web.1 connect=1ms service=96ms status=500 bytes=419 protocol=https
2020-03-25T15:58:24.847013+00:00 app[web.1]: 10.155.219.74 - - [25/Mar/2020:15:58:24 +0000] "GET / HTTP/1.1" 500 145 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.5 Safari/605.1.15"
mon fichier settings.py

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
 
"""
Django settings for nutella project.
 
Generated by 'django-admin startproject' using Django 3.0.2.
 
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
 
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
 
import os
import django_heroku
# 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/3.0/howto/deployment/checklist/
 
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '****'
 
# SECURITY WARNING: don't run with debug turned on in production!
if os.environ.get('ENV') == 'PRODUCTION':
    DEBUG = False
    # Static files settings
    STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
else:
    DEBUG = True
 
ALLOWED_HOSTS = ["purbeurreapp.herokuapp.com/"]
 
 
# Application definition
 
INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'off.apps.OffConfig',
    'user.apps.UserConfig',
]
 
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',
    'django.middleware.locale.LocaleMiddleware',
]
 
ROOT_URLCONF = 'app.urls'
 
TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        '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',
            ],
        },
    },
]
 
LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'handlers': {
        'console': {
            'class': 'logging.StreamHandler',
        },
    },
    'loggers': {
        'django': {
            'handlers': ['console'],
             'level': os.getenv('DJANGO_LOG_LEVEL', 'DEBUG'),
        },
    },
}
 
WSGI_APPLICATION = 'nutella.wsgi.application'
 
# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
 
DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.postgresql_psycopg2',
          'NAME': '****',
          'USER': '****',
          'PASSWORD': '****',
          'HOST': 'localhost',
          'PORT': '',
          'CONN_MAX_AGE': 500,
      }
  }
 
# Password validation
# https://docs.djangoproject.com/en/3.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/3.0/topics/i18n/
 
LANGUAGE_CODE = 'fr'
 
TIME_ZONE = 'UTC'
 
USE_I18N = True
 
USE_L10N = True
 
USE_TZ = True
 
 
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.0/howto/static-files/
PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
 
STATIC_ROOT = os.path.join(PROJECT_ROOT, 'app/static')
 
# Extra places for collectstatic to find static files.
STATICFILES_DIRS = (
    os.path.join(PROJECT_ROOT, 'static'),
    os.path.join(PROJECT_ROOT, 'user/static'),
)
STATIC_URL = '/static/'
LOGIN_REDIRECT_URL = 'compte'
LOGIN_URL = 'login'
django_heroku.settings(locals())