Error Importing Request Processor Module Staticfiles.context_processors
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Module “django.core.context_processors” does not define a “auth” callable request processor up vote 47 down vote favorite 6 I have a Django live website , i want to do some kind of maintenance on it but when I downloaded it and tried to open it from my local machine and my debug mode is true I faced this error: ImproperlyConfigured at / Module "django.core.context_processors" does not define a "auth" callable request processor I'm using Python 2.5 I would be grateful for any help. django share|improve this question edited Sep 19 '11 at 13:53 asked Sep 19 '11 at 11:26 mena samy 240135 add a comment| 2 Answers 2 active oldest votes up vote 94 down vote accepted It looks like you have upgraded to Django 1.4 or later. The auth context processor has been moved from django.core.context_processors.auth to django.contrib.auth.context_processors.auth. The move started in Django 1.2, and django.core.context_processors.auth was completely removed in Django 1.4. I recommend you run the same version of Django on your dev and production environments to prevent errors like this. When you upgrade to Django 1.4, you need to make the following change to TEMPLATE_CONTEXT_PROCESSORS in your settings file: # old TEMPLATE_CONTEXT_PROCESSORS = ("django.core.context_processors.auth", ... ) # new TEMPLATE_CONTEXT_PROCESSORS = ("django.contrib.auth
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a http://stackoverflow.com/questions/7470179/module-django-core-context-processors-does-not-define-a-auth-callable-reques minute: Sign up Django: “Error importing request processor module” using custom processor up vote 1 down vote favorite I've implemented my own context processor and I'm trying to configure it properly in django's settings: from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS as DEFAULT_PROCESSORS MY_CONTEXT_PROCESSORS = ( 'django.core.context_processors.request', 'com.mysite.apps.myapp.processors.MyProcessor.MyProcessor.process', ) TEMPLATE_CONTEXT_PROCESSORS = DEFAULT_PROCESSORS + MY_CONTEXT_PROCESSORS but I got the following error: Error importing request processor module http://stackoverflow.com/questions/17232415/django-error-importing-request-processor-module-using-custom-processor com.mysite.apps.myapp.processors.MyProcessor.MyProcessor: "No module named MyProcessor" MyProcessor is a simple class with a static method "process" (I love OOP and I use classes and package architecture in my project). It exits and is spelled correctly... so what's wrong? UPDATE: by replacing my class with a simple "process" function ("com.mysite.apps.myapp.processors.MyProcessor.process") it works... but I'm not satisfied... how does Django load these processors? I use a packages/classes approach everywhere in my app (models, tests, views...) and it usually works... what's the difference here? Since the dynamic nature of Python, a path like "com.mysite.apps.myapp.processors.MyProcessor.MyProcessor" should be resolved independently from a class or a standard "submodule"... don't you agree? django share|improve this question edited Jun 21 '13 at 10:21 asked Jun 21 '13 at 9:57 daveoncode 8,13134086 What happens if you do python manage.py shell and try import com.mysite.apps.myapp.processors.MyProcessor.MyProcessor.process? If that doesn't work, what about importing com.mysite.apps.myapp.processors? –Wilfred Hughes Jun 21 '13 at 10:01 Are you sure your directory structure has MyProcessor within MyProcessor ? That looks like the issue to me. –karthikr Jun 21 '13 at 10:02 I just tried "from com.mysite.apps.myapp.processors.MyPro
Sign in Pricing Blog Support Search GitHub This repository Watch https://github.com/omab/django-social-auth/issues/592 110 Star 2,348 Fork 771 omab/django-social-auth Code Issues 57 Pull requests 8 Projects 0 Pulse Graphs New issue Import error from __init__.py file https://docs.djangoproject.com/en/1.10/ref/contrib/staticfiles/ in backend folder #592 Closed shadowsyntax opened this Issue Jan 30, 2013 · 12 comments Projects None yet Labels None yet error importing Milestone No milestone Assignees No one assigned 2 participants shadowsyntax commented Jan 30, 2013 while trying to login into admin url of Django after installing django-social-auth I get the exception:: Error importing request processor module social_auth.context_processors: "cannot import name Consumer" further investigations shows the oauth2 error importing request that gets installed with the d-s-a does not have any file or directory that contains the name "consumer" but this is referenced in your backend init.py file. Am I doing something wrong or what?? Please kindly check this. Thanks! Owner omab commented Jan 30, 2013 Could you share a stacktrace? Consumer is defined on oauth2/__init__.py, https://github.com/simplegeo/python-oauth2/blob/master/oauth2/__init__.py#L175. shadowsyntax commented Jan 30, 2013 Hello Matias, Find below the stacktrace Environment: Request Method: GET Request URL: http://localhost:81/scratchgently/admin/ Django Version: 1.4.1 Python Version: 2.7.3 Installed Applications: ('django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'registration', 'octial', 'social_auth', 'crispy_forms', 'django.contrib.admin', 'django.contrib.admindocs') Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware') Traceback: File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response 136. response = response.render() File "/usr/lib/python2.7/dist-packages/django/template/response.py" in render 104. self._set_content(self.rendered_content) File "/usr/lib/python2.7/dist-packages/django/template/response.py" in rendered_content 80. context = self.resolve_context(self.context_data) File "/usr/lib/python2.7/dist-packages/django/template/response.py" in resolve_context 158. return RequestContext(self._request, context, current_app=self._current_app) File "/usr/lib/python2.7/dist-packages/django/template/context.py" in __i
app¶ django.contrib.staticfiles collects static files from each of your applications (and any other places you specify) into a single location that can easily be served in production. See also For an introduction to the static files app and some usage examples, see Managing static files (e.g. images, JavaScript, CSS). For guidelines on deploying static files, see Deploying static files. Settings¶ See staticfiles settings for details on the following settings: STATIC_ROOT STATIC_URL STATICFILES_DIRS STATICFILES_STORAGE STATICFILES_FINDERS Management Commands¶ django.contrib.staticfiles exposes three management commands. collectstatic¶ django-admin collectstatic¶ Collects the static files into STATIC_ROOT. Duplicate file names are by default resolved in a similar way to how template resolution works: the file that is first found in one of the specified locations will be used. If you're confused, the findstatic command can help show you which files are found. On subsequent collectstatic runs (if STATIC_ROOT isn't empty), files are copied only if they have a modified timestamp greater than the timestamp of the file in STATIC_ROOT. Therefore if you remove an application from INSTALLED_APPS, it's a good idea to use the collectstatic --clear option in order to remove stale static files. Files are searched by using the enabled finders. The default is to look in all locations defined in STATICFILES_DIRS and in the 'static' directory of apps specified by the INSTALLED_APPS setting. The collectstatic management command calls the post_process() method of the STATICFILES_STORAGE after each run