Jul-08-2020, 08:05 PM
Hello Coders!
I have a problem with a redirect, I'm a very beginner, and I would like to accomplish to this!
I show you the code:
As you can see I have myMongoDB_id that actually takes the Object ID from my MongoDB record.
In this way as soon as I submit the recipe through a form, the user gets redirected to /recipe/5f034b69b91c57308938cf82 and can directly see the recipe posted, but my redirect doesn't work. Please could you tell me why? I tried many things but I can't manage to pass the Object Id.
Thank you very much!
I have a problem with a redirect, I'm a very beginner, and I would like to accomplish to this!
I show you the code:
1 2 3 4 |
# This is the Object ID myMongoDB_id = str (dict1[ "_id" ]) return redirect(url_for( 'recipe/' , myMongoDB_id)) |
In this way as soon as I submit the recipe through a form, the user gets redirected to /recipe/5f034b69b91c57308938cf82 and can directly see the recipe posted, but my redirect doesn't work. Please could you tell me why? I tried many things but I can't manage to pass the Object Id.
Thank you very much!