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

log user out from template file in django

I want to add a logout href in my admin.html like: Log out What can I do to destroy the session when a user is redirected to /panel/ by clicking that 'Log out' link? What are the session variables to use in template…
alioguzhan
  • 7,657
  • 10
  • 46
  • 67
0
votes
1 answer

How to access Django signed-in user information from the JavaScript?

I'm making a chrome extension (with link submission feature) for my Django-powered site. I'm using django-tastypie to post links from JavaScript. However, I can't figure out how to access django sessions from JavaScript in order to determine the…
0
votes
1 answer

How can I use session to display a modal message?

I would like to know how could I use a session variable to define a message and display it on the next page. I have created a base template that I extend in all templates. I inserted the modal message code to check if there is any message in the…
dextervip
  • 4,999
  • 16
  • 65
  • 93
-1
votes
1 answer

Django cycles between authenticated and unauthenticated session state

When browsing through my website or when I refresh page, it happens that Django forgets about the authentication state and returns the page that an anonymous user would see. When the page is refreshed again it either returns to a logged in session…
jnns
  • 5,148
  • 4
  • 47
  • 74
-1
votes
1 answer

Django: How to dynamically store user data in sessions?

I am trying to create different django-allauth signup forms for different types of users. So different forms for different user types. Once a user selects a user type (example: "I want to sign up as a vendor"), they should be redirected to a…
-1
votes
1 answer

Store name value with Django sessions for another view

The error that Django throws at me when I fill in the form is: 'GetSessionName' object has no attribute 'name' and I have never worked with sessions before so I don't know how to solve this problem. The idea of the site is to have a small Login…
Alex Mihoc
  • 80
  • 1
  • 7
-1
votes
1 answer

SESSION_EXPIRE_AT_BROWSER_CLOSE where we need to write in our project in django?

In django for expire a session after closing a browser where we need to type SESSION_EXPIRE_AT_BROWSER_CLOSE this in which file??
-1
votes
1 answer

pyodbc session error when django project is downloaded from gitlab

i have a django project which works fine when not uploaded i have uploaded it to gitlab with following command: 1. git clone ssh://git@gitlab****dcms-api.git 2. git checkout dcms_sso 3.git add . then i took the same code from git lab: 1. git clone…
geek
  • 794
  • 3
  • 16
  • 41
-1
votes
1 answer

Why I am getting TypeError on production server where I am trying to save data in the session?

Environment: Request Method: GET Request URL: django_server_running_on_apache Django Version: 1.3.3 Python Version: 2.7.3 Traceback: File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response 178. …
ameya1984
  • 87
  • 1
  • 6
-1
votes
2 answers

Saving Formset in a Session - Django

Is here any way to store formset to a session ? My Scenario is like this . I have a form to fill user data and upload user certificates, and in the next page(form by clicking next) there is a form to enter Professional details . Is it possible to…
Ani Varghese
  • 403
  • 2
  • 6
  • 17
1 2 3
32
33