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 6338389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:26:06+00:00 2026-05-24T19:26:06+00:00

I got two handlers in Amazon Web Service. I want to share some data

  • 0

I got two handlers in Amazon Web Service. I want to share some data in both so i used global variable. where one is used to fetch some value and put it to the global variable when another handler called so is can use same value what is set in global variable, but it is giving default value in another handler and i have checked it is setting the value but in other one it is not giving same it is giving default value. One more imp thing is same code is runnning perfect in webfactional but same code is not running in AWS. Pls help what i have to do and thanks in advance. Here ma code is:

ipid_global = 0
uhid_global = 0

def patient_search:

     global ipid_global
     global uhid_global

     patient  = PatientInfo.objects.get(ip_id__iexact=ip_id)
     dis_advice  = PatientAdvice.objects.get(ip_id__iexact=ip_id)

     ipid_global = int(patient.ip_id)
     uhid_global = str(patient.uh_id)



def patient(request):

        global ipid_global
        global uhid_global

        ip_id = ipid_global
        uh_id = uhid_global

        return HttpResponse(ipid_global)

In real it is indended properly…

  • 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-24T19:26:07+00:00Added an answer on May 24, 2026 at 7:26 pm

    Never do this.

    In production, Django (I presume this is Django, although you don’t say so – I’ve added it to the tags) runs in a multi-process environment. Each process has its own copy of the global variables. There is no way to ensure that subsequent requests are served by the same process.

    If you need to keep state between requests, save it in the session, or pass it explicitly as a URL parameter.

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

Sidebar

Related Questions

I got two projects running, both written in PHP. Now I want to merge
I've got a WCF service which handles some sensitive data. I'd like to make
I got two tables, one of which is a helper of the other. The
I have got two similar FB apps i am working on. The one works,
I've got an ASP.NET web app that is starting to show some very strange
I want to start a mobile application however I got some questions. I am
I got two views which are equally distributed on my main layout.But my two
I got two properties initialized in header file: @property (readwrite, assign) int Figure1; @property
I got two tables Product(Productname VARCHAR(10), Rating REAL) and Review(RatingID INT, Productname VARCHAR(10), Rating
I got two tables in my database: user and call. User exists of 3

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.