Error on setup, insert SessionMiddleware

52 views
Skip to first unread message

Sam Carleton

unread,
Apr 15, 2014, 2:38:30 PM4/15/14
to django...@googlegroups.com
I am working on trying to setup my first django-oscar site on my local Windows 7 machine and I am getting an error when I try to view http://127.0.0.1:8000.  This is the error:

Environment:

Request Method: GET
Request URL: http://127.0.0.1:8000/

Django Version: 1.6.2
Python Version: 2.7.6
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.flatpages',
 'south',
 'oscar',
 'oscar.apps.analytics',
 'oscar.apps.checkout',
 'oscar.apps.address',
 'oscar.apps.shipping',
 'oscar.apps.catalogue',
 'oscar.apps.catalogue.reviews',
 'oscar.apps.partner',
 'oscar.apps.basket',
 'oscar.apps.payment',
 'oscar.apps.offer',
 'oscar.apps.order',
 'oscar.apps.customer',
 'oscar.apps.promotions',
 'oscar.apps.search',
 'oscar.apps.voucher',
 'oscar.apps.wishlists',
 'oscar.apps.dashboard',
 'oscar.apps.dashboard.reports',
 'oscar.apps.dashboard.users',
 'oscar.apps.dashboard.orders',
 'oscar.apps.dashboard.promotions',
 'oscar.apps.dashboard.catalogue',
 'oscar.apps.dashboard.offers',
 'oscar.apps.dashboard.partners',
 'oscar.apps.dashboard.pages',
 'oscar.apps.dashboard.ranges',
 'oscar.apps.dashboard.reviews',
 'oscar.apps.dashboard.vouchers',
 'oscar.apps.dashboard.communications',
 'haystack',
 'treebeard',
 'sorl.thumbnail']
Installed Middleware:
('django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'oscar.apps.basket.middleware.BasketMiddleware')


Traceback:
File "C:\Python27\lib\site-packages\django\core\handlers\base.py" in get_response
  90.                 response = middleware_method(request)
File "C:\Python27\lib\site-packages\django\contrib\auth\middleware.py" in process_request
  16.         assert hasattr(request, 'session'), "The Django authentication middleware requires session middleware to be installed. Edit your MIDDLEWARE_CLASSES setting to insert 'django.contrib.sessions.middleware.SessionMiddleware'."

Exception Type: AssertionError at /
Exception Value: The Django authentication middleware requires session middleware to be installed. Edit your MIDDLEWARE_CLASSES setting to insert 'django.contrib.sessions.middleware.SessionMiddleware'.

----------------------------------------------------------------------
Attached is my settings.py file.



settings.py

David Winterbottom

unread,
Apr 15, 2014, 4:17:29 PM4/15/14
to django-oscar
Looks like you need to put the session middleware above your auth middleware in MIDDLEWARE_CLASSES.

A word of warning though: it's highly likely Oscar doesn't work particularly well on Windows - it's not an environment we aim to support. I recommend you use a virtual machine (eg via Vagrant) to run a linux OS for Oscar.


--
https://github.com/tangentlabs/django-oscar
http://django-oscar.readthedocs.org/en/latest/
https://twitter.com/django_oscar
---
You received this message because you are subscribed to the Google Groups "django-oscar" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-oscar...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-oscar.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-oscar/2a9436cb-0e5f-424d-b1f8-4c6ea8a2c1b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
David Winterbottom
Technical Director

Tangent Labs
84-86 Great Portland Street
London W1W 7NR
England, UK

Sam Carleton

unread,
Apr 15, 2014, 8:58:30 PM4/15/14
to django...@googlegroups.com, david.win...@tangentlabs.co.uk
David,

Thank you for your reply.  I keep seeing different aspects of python and Django that are not supported well on either OSX or Windows.  Might you be able to speak into that a bit?  Myself being a software developer, I am pondering why there would be issues.  Is there file IO that doesn't cross platforms well?  Since we are talking web, I know it isn't a UI issue:)

Sam

David Winterbottom

unread,
Apr 24, 2014, 11:42:58 AM4/24/14
to django-oscar
On 16 April 2014 01:58, Sam Carleton <scar...@gmail.com> wrote:
David,

Thank you for your reply.  I keep seeing different aspects of python and Django that are not supported well on either OSX or Windows.  Might you be able to speak into that a bit?  Myself being a software developer, I am pondering why there would be issues.  Is there file IO that doesn't cross platforms well?  Since we are talking web, I know it isn't a UI issue:)

​I'm not really an expert here but I imagine it's about extensions that require compilation (eg C extensions). It would be considerably more work to write applications that compile on both OSes and culturally, the majority of Python developers seem to use a unix-based OX - hence why Windows often has problems.

For Oscar, we're never going to use Windows at Tangent for Django projects so it's not really a good use of our time to support it.

 

Sam


On Tuesday, April 15, 2014 4:17:29 PM UTC-4, David Winterbottom wrote:
Looks like you need to put the session middleware above your auth middleware in MIDDLEWARE_CLASSES.

A word of warning though: it's highly likely Oscar doesn't work particularly well on Windows - it's not an environment we aim to support. I recommend you use a virtual machine (eg via Vagrant) to run a linux OS for Oscar.

--
https://github.com/tangentlabs/django-oscar
http://django-oscar.readthedocs.org/en/latest/
https://twitter.com/django_oscar
---
You received this message because you are subscribed to the Google Groups "django-oscar" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-oscar...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-oscar.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages