Forums

ImportError: cannot import name TEMPLATE_CONTEXT_PROCESSORS

I have this in my error log when accessing my website

ImportError: cannot import name TEMPLATE_CONTEXT_PROCESSORS 2016-10-18 13:03:02,805 :Error running WSGI application Traceback (most recent call last): File "/bin/user_wsgi_wrapper.py", line 154, in call app_iterator = self.app(environ, start_response) File "/bin/user_wsgi_wrapper.py", line 170, in import_error_application raise e ImportError: cannot import name TEMPLATE_CONTEXT_PROCESSORS

I saw on SO post that importing TEMPLATE_CONTEXT_PROCESSORS is deprecated.I dont know where this file is bin/user_wsgi_wrapper.py.Kindly help

sounds like it is coming from your settings.py

Yes in my settings i did from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS but I have deleted the piece in settings.py but yet its still giving the same error,the one i posted above

Did you reload your webapp?

Yes I did and its no longer showing this error.the error its currently showing is 'No module named dal',dal is one of my installed apps in settings.py,if i should remove dal from installed apps it goes to the next one i.e 'No module named allauth' and so on I installed all the packages in settings.py using pip install -r requirements.txt including django and python i have in a virtualenvironment called myvenv. Can you help me out because its driving me nuts.These are my files /var/www/bolaji90_pythonanywhere_com_wsgi.py

import os
import sys

path = '/home/bolaji90/prissue-consumer-complaints'  
if path not in sys.path:
    sys.path.append(path)

os.environ['DJANGO_SETTINGS_MODULE'] = 'corrfeed4.settings'

from django.core.wsgi import get_wsgi_application
from django.contrib.staticfiles.handlers import StaticFilesHandler
application = StaticFilesHandler(get_wsgi_application())

Please check this Image directory structures in the pics below

1.https://postimg.org/image/otkhgzq6d/

  1. https://postimg.org/image/roxknuu6d/

If you're not seeing modules from the virtualenv, then you either installed them into a virtualenv that is not being used by your web app, or your web app is not configured to use a virtualenv.

Its working now.....I have seen it.Thank you

Great! Thanks for letting us know.