ceys / django-tracking

Automatically exported from code.google.com/p/django-tracking
MIT License
0 stars 0 forks source link

what if the request has no session? #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. add all the settings along with MIDDLEWARE_CLASSES = (
    'tracking.middleware.VisitorTrackingMiddleware',

2. then in some template
        {% load tracking_tags %}
        {% visitors_on_site as visitors %}
<p>
    {{ visitors }} active user{{ visitors|pluralize }}
</p>

3. hit http://127.0.0.1:8000/

The output is :

Traceback (most recent call last):

  File "C:\Users\troy\Django-1.0\django\core\servers\basehttp.py", line
277, in run
    self.result = application(self.environ, self.start_response)

  File "C:\Users\troy\Django-1.0\django\core\servers\basehttp.py", line
634, in __call__
    return self.application(environ, start_response)

  File "C:\Users\troy\Django-1.0\django\core\handlers\wsgi.py", line 239,
in __call__
    response = self.get_response(request)

  File "C:\Users\troy\Django-1.0\django\core\handlers\base.py", line 67, in
get_response
    response = middleware_method(request)

  File "C:\Users\troy\svn\p2m\tracking\middleware.py", line 28, in
process_request
    session_key = request.session.session_key

AttributeError: 'WSGIRequest' object has no attribute 'session'

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
Windows and django1.0

Please provide any additional information below.

Original issue reported on code.google.com by tamonash...@gmail.com on 29 Sep 2008 at 7:49

GoogleCodeExporter commented 8 years ago
I apologize for the delay in responding to this issue... Forgot to setup the 
issue
notification for the project.  I'll look into a solution to this problem.

Original comment by wheaties...@gmail.com on 6 Nov 2008 at 8:36

GoogleCodeExporter commented 8 years ago

Original comment by wheaties...@gmail.com on 6 Nov 2008 at 8:40

GoogleCodeExporter commented 8 years ago
I think this has long been addressed and I just forgot to update this issue.  
Would 
you please verify?

Original comment by wheaties...@gmail.com on 3 Feb 2009 at 1:27

GoogleCodeExporter commented 8 years ago
Closing because it appears to have been fixed.

Original comment by wheaties...@gmail.com on 27 Dec 2010 at 4:02