For setting session variable:
request.session['idempresa'] = profile.idempresa
For getting session Data:
if 'idempresa' in request.session:
idempresa = request.session['idempresa']
More Related Contents:
- What’s the best way to store a phone number in Django models?
- How to expire Django session in 5minutes?
- Django set default form values
- Creating a dynamic choice field
- How can I build multiple submit buttons django form?
- How to redirect with post data (Django)
- Django-Registration & Django-Profile, using your own custom form
- Django model “doesn’t declare an explicit app_label”
- Getting TypeError: __init__() missing 1 required positional argument: ‘on_delete’ when trying to add parent table after child table with entries
- ImportError: No module named ‘django.core.urlresolvers’
- How to set the timezone in Django
- Django formsets: make first required?
- How does Django Know the Order to Render Form Fields?
- Trying to parse `request.body` from POST in Django [duplicate]
- How to create a UserProfile form in Django with first_name, last_name modifications?
- Django: OperationalError No Such Table
- How to create virtual env with python3
- Microsoft Visual C++ 14.0 is required. Get it with “Microsoft Visual C++ Build Tools”: http://landinghub.visualstudio.com/visual-cpp-build-tools [duplicate]
- How to get the domain name of my site within a Django template?
- How to change the file name of an uploaded file in Django?
- Customize/remove Django select box blank option
- Pre-populate an inline FormSet?
- Unable to import path from django.urls
- How to get the previous URL from a POST in Django
- Change a Django form field to a hidden field
- Resize fields in Django Admin
- Django Admin: Using a custom widget for only one model field
- Django viewset has not attribute ‘get_extra_actions’
- Install mod_wsgi on Ubuntu with Python 3.6, Apache 2.4, and Django 1.11
- How to properly use the “choices” field option in Django