1👍
If I am right :
Write a view for localhost:8000/myapp/
In this view generate your token and then redirect it to new url from the view .
def mytoken(request):
token = '0-wedfbdhfgm'
return redirect(localhost:8000/myapp/token='+token)
0👍
This is a two-step process. You need to create
- a view with a matching url to retrieve your individual token
- a view with a matching named url to provide the result to the user
urls.py
...
url(r'^myapp/(?P<token>\w+)/$', views.your_user_result_view, name='your-user-result-view'),
url(r'^myapp/$', views.your_token_appender_view, name='your-token-appender-view'),
...
views.py
...
def your_user_result_view(request):
...
def your_token_appender_view(request):
token = ...
redirect(reverse('your-user-result-view',kwargs={'token':token}))
...
- Python Django: couldn't include the template
- Getting error 'ascii' codec can't decode byte 0xc3 in position 149: ordinal not in range(128)' when rebuilding haystack index
- MS Azure doesn't install virtualenv for Django project. error: Unable to find vcvarsall.bat
- Python – How to output matplotlib plots as images to the browser in Django
- Django email account verification
Source:stackexchange.com