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 7539467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:23:24+00:00 2026-05-30T07:23:24+00:00

I have been developing an app using the very easy-to-pickup Flask system and I

  • 0

I have been developing an app using the very easy-to-pickup Flask system and I have used a jinja template to write out a bunch of links that correspond to pages in Flask that are defined by something like this:

@app.route(/<var1>/<var2>)
...
...

in the test server these links work just fine however when I move from the test server to a server behind a proxy I get a problem where the href links don’t take into account the extra directory name inserted by my proxy.

#where a link should read:
server:/myapp/<var1>/<var2>
# it acually puts out:
server:/<var1>/<var2>

my jinja etemplate looks like this but I am wondering if instead of putting a backslash there is a way to put a variable that specifies root directory.

{% block navigation %}
{% for record in db.values() %}
 <li><a href="/{{db.name}}/{{record.name}}">{{record.name}}</a></li>
{% endfor %}
{% endblock %}

Any help would be greatly appreciated. Thanks Flask team!

  • 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-05-30T07:23:25+00:00Added an answer on May 30, 2026 at 7:23 am

    Firstly, as @reclosedev said, you can generate URLs using the url_for function (assuming the view function is called myview:

    <a href="{{ url_for('myview', var1=db.name, var2=record.name) }}">
    

    Secondly, if you’re behind a reverse proxy, wrap the WSGI application with this decorator that updates the request environment so that Flask generates correct URLs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been developing an app specifically for modern browsers and have made very heavy
i am developing a app and have been for a while using Rails 2.3.4
I have been developing an android app, and i wanted to test it out
Recently I have been developing an app that needs AES encryption. I am using
I have been developing my web-app using JPA 2.0 implementation EclipseLink 2.2.0. I finally
I've been developing a very large LOB app using my flavor of M-V-VM which
I have been developing an app in VB.NET which requires a control object (for
So I have been developing a small ASP.NET web app in C# for my
I have been putting off developing this part of my app for sometime purely
I have been developing an iphone application using a domain model, and have put

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.