-1

I am creating an app in which I have to transfer value from one function to other in Django, after reading some articles I have found out I can use global variables inside the Django function. I just want to ask is it good to use global function because the app I am wokring on is gonna be live and people will use it I dont want any trouble at later stages.

-edited

davidism
  • 121,510
  • 29
  • 395
  • 339
faiz khan
  • 11
  • 4

1 Answers1

0

There are many ways to share the data across methods, files, or applications within Django. You might be able to achieve what you want with the global variables but there are far better approaches. You can consider:

  • thanks,what do you think about django sessions? – faiz khan Jan 05 '22 at 08:06
  • From my understanding, sessions are best suited when sharing information across views. That depends upon the case-to-case scenario and also that there are security implications when sharing data across sessions(https://docs.djangoproject.com/en/4.0/topics/http/sessions/#session-security). – Syed Muhammad Dawoud Sheraz Jan 05 '22 at 08:22