For setting session variable:
request.session['idempresa'] = profile.idempresa
For getting session Data:
if 'idempresa' in request.session:
idempresa = request.session['idempresa']
Related Contents:
- What’s the best way to store a phone number in Django models?
- How do I filter ForeignKey choices in a Django ModelForm?
- Django MEDIA_URL and MEDIA_ROOT
- Django set default form values
- Creating a dynamic choice field
- dynamically add field to a form
- Django Passing Custom Form Parameters to Formset
- How can I build multiple submit buttons django form?
- Django – Login with Email
- Django: multiple models in one template using forms [closed]
- Django – No such table: main.auth_user__old
- Django reverse lookup of foreign keys
- Unicodedecodeerror with runserver
- Difference between static STATIC_URL and STATIC_ROOT on Django
- Multiple Models in a single django ModelForm?
- Django TemplateDoesNotExist?
- Django-Registration & Django-Profile, using your own custom form
- Django model “doesn’t declare an explicit app_label”
- Define css class in django Forms
- Overriding the save method in Django ModelForm
- Django ModelForm for Many-to-Many fields
- How to redirect with post data (Django)
- 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 can I get the domain name of my site within a Django template?
- How to set the timezone in Django
- ImportError: No module named ‘django.core.urlresolvers’
- How to change ForeignKey display text in the Django Admin?
- How to get the domain name of my site within a Django template?
- How does Django Know the Order to Render Form Fields?
- Django formsets: make first required?
- How do I add a placeholder on a CharField in Django?
- How to change the file name of an uploaded file in Django?
- Nested inlines in the Django admin?
- Configure Django and Google Cloud Storage?
- Getting TypeError: __init__() missing 1 required positional argument: ‘on_delete’ when trying to add parent table after child table with entries
- CSS not loading wrong MIME type Django [duplicate]
- Django: OperationalError No Such Table
- Difference between AbstractUser and AbstractBaseUser in Django?
- Customize/remove Django select box blank option
- Django ModelForm to have a hidden input
- Pre-populate an inline FormSet?
- Django: adding an “Add new” button for a ForeignKey in a ModelForm
- Class Based Views VS Function Based Views
- Unable to import path from django.urls
- How do I activate a virtualenv inside PyCharm’s terminal?
- How can I filter a date of a DateTimeField in Django?
- Set up Python simpleHTTPserver on Windows [duplicate]
- Sphinx cannot find my python files. Says ‘no module named …’
- Calling a Python function with *args,**kwargs and optional / default arguments
- Sending a password over SSH or SCP with subprocess.Popen