Note that there are some explanatory texts on larger screens.

plurals
  1. POWSGI - Attribute no 'user' Error
    primarykey
    data
    text
    <p>Hello i'm trying to run some python/django in a windows iis 7.5 environment. After starting the server (localhost:8888) I receive the following error. This error is generated only after accessing localhost:8888.</p> <pre><code> File "C:\Python27\lib\site-packages\django-1.5-py2.7.egg\django\core\handlers\ base.py", line 224, in handle_uncaught_exception return callback(request, **param_dict) File "C:\Python27\lib\site-packages\django-1.5-py2.7.egg\django\utils\decorato rs.py", line 91, in _wrapped_view response = view_func(request, *args, **kwargs) File "C:\Python27\lib\site-packages\ecm-2.1.2-py2.7.egg\ecm\views\custom_handl ers.py", line 22, in server_error http.HttpResponseServerError(t.render(RequestContext(request))) File "C:\Python27\lib\site-packages\django-1.5-py2.7.egg\django\template\conte xt.py", line 179, in __init__ self.update(processor(request)) File "C:\Python27\lib\site-packages\ecm-2.1.2-py2.7.egg\ecm\views\context_proc essors.py", line 55, in menu if request.user.is_superuser or UrlPermission.user_has_access(request.user, menu['url']): AttributeError: 'WSGIRequest' object has no attribute 'user' &lt;WSGIServer fileno=552 address=127.0.0.1:8888&gt;: Failed to handle request: request = GET /favicon.ico HTTP/1.1 from ('127.0.0.1', 50325) application = &lt;django.core.handlers.wsgi.WSGIHandler object at 0x022CDCB0&gt; </code></pre> <p>I've looked around and trie dmany of the proposed solutions - my middleware in django looks like this.</p> <pre><code> MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', # Uncomment the next line for simple clickjacking protection: # 'django.middleware.clickjacking.XFrameOptionsMiddleware', ) </code></pre> <p>Here is the code which references the request.user line. </p> <pre><code>def menu(request): """ Adds the variable {{ user_menu }} to all the templates. The menu is composed with items from each ECM app/plugin (see the menu.py files) The items are dynamically displayed according to user accesses. """ user_menus = [] for menu in ECM_MENUS: if request.user.is_superuser or UrlPermission.user_has_access(request.user, menu['url']): user_menus.append(menu) data = { 'menus': user_menus, 'path': str(request.get_full_path()) } return {'user_menu': render_to_string('ecm/menu.html', data), 'request_path': data['path']} </code></pre> <p>Any thoughts?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload