Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8376245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:23:05+00:00 2026-06-09T15:23:05+00:00

I have a simple Flask app that contains a few basic views. One of

  • 0

I have a simple Flask app that contains a few basic views. One of these views is called result. What it does is grabs the URL parameters using GET, then does a bunch of operations using the parameters, and finally renders the template using render_template() and passes it the calculated values.

On rendering, the result URL looks something like this:

http://127.0.0.1:5000/result?s=abcd&t=wxyz

What I want to do is instead of rendering the template under the result view, I’d like to redirect to a new view (let’s call it final), passing the calculated values along with the redirect, and render the template from there. Why do all this? Because I’d like the final URL to look like this instead:

http://127.0.0.1:5000/final/abcd

I’m sorry if the title is a bit vague.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T15:23:07+00:00Added an answer on June 9, 2026 at 3:23 pm

    The simplest solution that “abcd” in the final URL can be the actual result:

    @app.route("/result")
    def calculate_result():
        s, t = request.args.get("s"), request.args.get("t")
        # Calculate result with s and t
        return redirect(url_for(".display_results", result=result))
    
    @app.route("/final/<result>")
    def display_results(result):
        return render_template("results.html", result=result)
    

    If it cannot be, then you can use session instead:

    @app.route("/result")
    def calculate_result():
        s, t = request.args.get("s"), request.args.get("t")
        # Calculate result with s and t
        session["result"] = result
        return redirect(url_for(".display_results", result=result))
    
    @app.route("/final/abcd")
    def display_results():
        result = session.get("result")
        return render_template("results.html", result=result)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple AS3 app that draws few circles using drawing api
I have simple win service, that executes few tasks periodically. How should I pass
I currently have a simple app that includes user authentication through devise and a
I have partial view that displays model-specific flash messages. The partial looks like: app/views/mymodel/_flashpartial.erb
I have a simple html/javascript based Android app that loads with the following code:
I have a simple Flask app running. To serve I use Tornado. The code
I have this simple Flask app: from flask import Flask import prolog_handler as p
I have simple php validation form that is halfway working. If you leave the
I have simple database - one table with 6 collumns. 3 of them i
I'm about to have to write a web page/app that will serve the agenda

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.