1π
β
If you donβt want to pass a parameter in the URL, you need to pass it in some other way. The only real way to do this is to use the session: set a session variable in the post view, and check it in the index one.
def process_post(request, ...):
... do whatever ...
request.session['confirm'] = True
return redirect('home')
def index(request):
confirm = request.session.pop('confirm', None)
if confirm:
...
π€Daniel Roseman
0π
Iβm not really sure I understand the question. Are you essentially trying to do this?
(r'^your_app_view/(?P<app_value>.+)/$',views.your_view)
then in your_view you can access app_value do whatever you need and redirect to another view.
Are you then asking how to get that argument to the second view that the first view is calling?
If so then this SO answer should help you. Django return redirect() with parameters
π€Chris Hawkes
- [Answer]-Instance on Django form not working
- [Answer]-Django cache everything but a piece
- [Answer]-How to use Django ORM to make a query so that it returns the latest entry based on a datetime field in a particular group?
Source:stackexchange.com