Questions tagged [django-sessions]

For questions related to Django's session mechanism.

Django provides full support for anonymous sessions. The session framework lets you store and retrieve arbitrary data on a per-site-visitor basis. It stores data on the server side and abstracts the sending and receiving of cookies. Cookies contain a session ID – not the data itself (unless you’re using the cookie based backend or a custom backend).

Reference: https://docs.djangoproject.com/en/stable/topics/http/sessions/

490 questions
0
votes
1 answer

Creating an anonymous django session

In my attempts to learn django, I've been trying to make a clone of dayscore.net. Meaning that, I want to make the site using django, this does not refer to a git clone or a hg clone If you take a look, every time a new user comes to dayscore, you…
Games Brainiac
  • 80,178
  • 33
  • 141
  • 199
0
votes
1 answer

Redis replication for cached session in Django

I am developing the django-backend of a ios app. I will use cached-session using redis. Once a user logs in, I will save his session in the redis-cache (backed up by mysql), I just want to know (for the long run), can I use redis replication to keep…
0
votes
3 answers

Django rendering issue

I am facing a problem while building a Django web app. I want that if a user logs into his account, his session should be stored and when he agains visits the login page ,he should be redirected to his home page. Here is my code. Views.py from…
Praful Bagai
  • 16,684
  • 50
  • 136
  • 267
0
votes
2 answers

Creating Django sessions

I am facing a problem while building a Django web app. I want that if a user logs into his account, his session should be stored and when he agains visits the login page ,he should be redirected to his home page. I have tried using Here is my…
Praful Bagai
  • 16,684
  • 50
  • 136
  • 267
0
votes
1 answer

Django: Session created in database when login page loaded

My django_session table was growing very large and it seems to be due to a pingdom bot that I set-up hitting my login page. I tried creating a brand new django 1.4 app and the behaviour is replicated on any page that uses the…
alan
  • 4,247
  • 7
  • 37
  • 49
0
votes
1 answer

How to persist data across multiple requests?

The signup process for my app is as follows: Users click a signup link for a specific plan They fill out a simple email/password form After submitting, they are asked to check their email for a verification link Clicking the verification link takes…
fredley
  • 32,953
  • 42
  • 145
  • 236
0
votes
2 answers

using session to store data from anonymous user

in my django app, I have a user wishlist feature. I want that an anonymous user can add a product to his wishlist. models.py class User_Wishlist(models.Model): created_by = models.ForeignKey(User, default=None, null =True, blank=True) …
user_2000
  • 1,103
  • 3
  • 14
  • 26
0
votes
2 answers

How to use django session framework in views?

I have been reading on django session framework and am not really getting it. i am creating an object and am wondering how i can be able to use django sessions in the view. this is how o create an object. def show_checkout(request): if…
Mats_invasion
  • 117
  • 1
  • 2
  • 12
0
votes
1 answer

Error when submitting form

Possible Duplicate: Updating an entry on form submit instead of saving new entry I am editing the form and submitting it, but it is not getting updated, instead it is storing in another entry. def searchinventory2(request, id = None): print…
0
votes
1 answer

MongoDB as a session backend for Django

Are there any good packages for using MongoDB as a session backend in Django? mango looks outdated. django-sessionbackend-mongodb is not pip installable and undocumented. There's also MongoEngine that should work well, but it's overkill in my…
yprez
  • 14,854
  • 11
  • 55
  • 70
0
votes
1 answer

how to manage sessions in django after the user is logged in (without using default admin )?

I build a forum in Django i want to manage user sessions when the user post something n check comments on their own posts. Also the particular user should get notifications regarding any activity on their posts.
Aventador
  • 205
  • 2
  • 11
0
votes
1 answer

How to check session without creating new one?

In part of my application i have some custom settings for visitors. When user load page i try to check custom settings for request and if settings exist i do customization in page. i do it in Template Context Processor def shared_values(request): …
Sergey Lyapustin
  • 1,917
  • 17
  • 27
0
votes
1 answer

django - KeyError when trying to log in

when i try to login it shows : KeyError at /admin/ 'loggedin' it shows this error only when i submit with correct username and pwd. so i think it is about my admin view.. here is my log in view : def log_user_in(request): if…
alioguzhan
  • 7,657
  • 10
  • 46
  • 67
0
votes
2 answers

Django - how to access session status from template

i want to add an 'EDIT' link for each posts on index page. but before show this link ; i need to check if session is registered. i mean i need something like this : {% if session.name=='blabla' %} Edit {% endif %} i have …
alioguzhan
  • 7,657
  • 10
  • 46
  • 67
0
votes
1 answer

session variable or extra context?

I need to have a few variables accessible on almost every view. I think I can see how to do it either using a context processor and "extra context" values, or by using session variables. Are there advantages and disadvantages? Which approach…
mb52089
  • 872
  • 2
  • 10
  • 24
1 2 3
32
33