Using request args in Flask for a variable URL
<p>My goal is to run a Flask app that will be given a URL of this form where the ids vary:</p>

<pre><code>http://localhost:5000/Longword/game?firstid=123&amp;secondid=456&amp;thirdid=789
</code></pre>

<p>and return a simple page outputting something like</p>

<pre><code>First id = 123, second id = 456, third id = 789
</code></pre>

<p>I run this script, and when hardcoding in an example <code>URL</code> I cannot get request args to return anything but None. I have tried formatting the int as a string and different things like that -- in no circumstances can I get request args to work.</p>

<pre><code>import os
import json
from flask import Flask, request, render_template

app = Flask(__name__)

@app.route('/')
def main():
    return "on main home page"

@app.route('/longword/gameid=123&amp;playerid=456')
def Longword():
    user = request.args.get('gameid')
    return "got hardcode %d" % gameid
</code></pre>

<p>My second issue, which will be tackled after I can get request args going, is that I cannot configure <code>route()</code> in such a way to handle variable <code>URL</code>s.  I am only able to load pages by hardcoding them into route. I made a separate attempt to do this using sessions but was equally unsuccessful.</p>