• 0
Votes
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /var/www/html/cnasolution/application/views/question.php
Line: 191
Function: _error_handler

File: /var/www/html/cnasolution/application/controllers/Questions.php
Line: 419
Function: view

File: /var/www/html/cnasolution/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

FileNotFoundError in Heroku at deploying (Django)

When I run python manage.py collectstatic --noinput in my local machine, it works fine. But when heroku runs python manage.py collectstatic --noinput it gives error like this: for entry in os.scandir(path) FileNotFoundError: [Errno 2] No such file or directory: '/tmp/build_5d05d870/static'

My project directory seems like this:

mysite-----|libooki(app)----------|migrations            |----------------------|init.py            |----------------------|admin.py            |----------------------|........ -----------|media -----------|media_cdn -----------|mysite -----------|static|--------------|css|------style.css -----------|staticfiles -----------|templates -----------|.........  

My settings.py seems like this. (I followed this article: https://devcenter.heroku.com/articles/django-assets)

from pathlib import Path import os import django_heroku    BASE_DIR = Path(__file__).resolve().parent.parent TEMPLATE_DIR = os.path.join(BASE_DIR, 'templates')  INSTALLED_APPS = [     ........,     'libooki', ]  MIDDLEWARE = [     ...........................................,     'whitenoise.middleware.WhiteNoiseMiddleware', ]  WSGI_APPLICATION = 'mysite.wsgi.application'  STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') STATIC_URL = '/static/'  STATICFILES_DIRS = (     os.path.join(BASE_DIR, 'static'), ) MEDIA_ROOT = os.path.join(BASE_DIR,'media_cdn') MEDIA_URL = '/media/' STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' django_heroku.settings(locals()) 
Download script demo [LINK]
Download script demo [LINK 2] Download script demo [LINK 2]