3👍
✅
Use Cookies and store the unique id in cookies and retrieve it everytime to identify the user.
You can use Django’s session framework. Example code:
Setting a cookie:
def view(request):
...
...
response.set_cookie( 'user_id', user_id )
Retrieving a cookie:
def view(request):
...
if request.COOKIES.has_key( 'user_id' ):
value = request.COOKIES[ 'user_id' ]
👤avi
-1👍
Depending on the time a user can take between the first and the second part,
you can use session variables in PHP to generate an id and store it in the Database.
you can find the configuration for the max time of this variable once it’s set in the php.ini file.
by checking the session variable you know if the user has completed the first form and in case it’s false redirect to it.
cheers
- [Answered ]-Return JSON response using Django template system
- [Answered ]-Scrapy Memory Error (too many requests) Python 2.7
- [Answered ]-NoReverseMatch exception while resetting password in django using django's default views
- [Answered ]-User permissions for content in Django
- [Answered ]-Django objects queryset
Source:stackexchange.com