0
remote:  !     Error while running '$ python manage.py collectstatic --noinput'.
remote:        See traceback above for details.
remote:
remote:        You may need to update application code to resolve this error.
remote:        Or, you can disable collectstatic for this application:
remote:
remote:           $ heroku config:set DISABLE_COLLECTSTATIC=1
remote:
remote:        https://devcenter.heroku.com/articles/django-assets
remote:  !     Push rejected, failed to compile Python app.
remote:
remote:  !     Push failed

This is the error i am getting when i am deploying my application on Heroku. I used a postgres database to store my data and when i am trying to deploy its giving me an error

code

DEBUG = False

ALLOWED_HOSTS = ['127.0.0.1','mca-blog-n.herokuapp.com']



 TEMPLATES = [
{
    'BACKEND': 'django.template.backends.django.DjangoTemplates',
    'DIRS': [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 = 'CrabbyCoder.wsgi.application'


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

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


 # Static files (CSS, JavaScript, Images)
 # https://docs.djangoproject.com/en/3.0/howto/static-files/
STATIC_ROOT=os.path.join(BASE_DIR,'staticfiles')
STATIC_URL = '/static/'
STATICFILES_DIRS=[
os.path.join(BASE_DIR,'static')
]
michjnich
  • 2,796
  • 3
  • 15
  • 31
priston
  • 47
  • 6
  • Does this answer your question? [Collectstatic error while deploying Django app to Heroku](https://stackoverflow.com/questions/36665889/collectstatic-error-while-deploying-django-app-to-heroku) – michjnich Aug 11 '22 at 07:59
  • The error is not exactly about the `collectstatic`, i would recommend you share the full logs traceback. The error is usually at the top of the log. To be explicit, any error you get in the collectstatic stage would still show this kind of traceback you posted – Destiny Franks Aug 12 '22 at 20:13
  • Are you using AWS (RDS) or localhost for the postgresl or are you using Heroku Postgres? – Destiny Franks Aug 12 '22 at 20:14
  • @DestinyFranks from the code sample, it looks like they're using sqlite and _not_ postgres. Not sure why the question is tagged `heroku-postgres` – Doug Harris Aug 24 '22 at 19:33
  • Yes, i later in noticed that – Destiny Franks Aug 24 '22 at 20:26

0 Answers0