Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7441489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:01:17+00:00 2026-05-29T11:01:17+00:00

A page in my django app lets the user zoom and drag an image.

  • 0

A page in my django app lets the user zoom and drag an image. I’d like to save the zoom level and the image position so that the next time I view the page, the image is back to the state of my last visit.

The django sessions docs clearly show how to set session info, but only once you’re in the Python code. The detail I’m unclear on is how to execute “session updating” code whenever I navigate away from my page.

Is is possible to keep my saved session synced with javascript variables in a django template?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T11:01:17+00:00Added an answer on May 29, 2026 at 11:01 am

    You need your web page to send that information to your server so it can update it in the session. The way session works in django is it only sends a session id to your web page(usually through cookie) and then that cookie is sent back with every request your web page does(cookie is part of HTTP protocol and managed by the web browser).

    The template code is run on the server to output html and javascript but none of this is actually run on the server and the template is not a live connection to your server. Merely setting variable in javascript will not get them back to the server.

    You could however send the saved variable in a request to your server using an ajax request for example so your server puts them in the session for later use.

    jQuery provides an unload event to be notified when the user goes away. You could bind to this event to do your update.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a client that has an app built with django. On every page
I'm trying to write a simple app that lets a user grant my code
I'm building a django app that has an image gallery, and the client insists
I'm building a Django app that will need SSL on all user-facing pages. On
I am building my first django app that uses user authentication and I'm using
I would like to build a Django app that allows searching for a movie
I have written a django page that requires only super users to login. So
I have a simple django page that has a counter on it. I use
I have a django app that has / at the end of every URL
I try to integrate django-ifs like a django app without using buildout. Now I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.