DolphDev / pynationstates

Python API wrapper for NationStates
MIT License
15 stars 4 forks source link

nationstates.nsapiwrapper.exceptions.Forbidden: No UserAgent Supplied. #22

Closed 0ALFARSI0 closed 2 years ago

0ALFARSI0 commented 2 years ago

I didnt find any explaining about the Forbidden exception

i was trying to handle the request ,

@app.route("/nation/<name>")
def nationView(name):
   name = name if name else logination
   return render_template("nationOverview.html",nation = Nation.nation(name))

logination is a variable that stores the local storage into it using URL

@app.route("/nationLogin/<nation>")
def nationLogin(nation):
    logination = nation
    return redirect(url_for("index"))
 $(function () {
        $('#submt').on('click', function () {
            localStorage.setItem("nation",""+ $('#nation_name').val() +"")
            window.location.href = `{{ url_for('nationLogin',nation=${localStorage.getItem('nation')}) }}`
        });
0ALFARSI0 commented 2 years ago

Sorry , i just found the problem, 😅i didn't include the name in the constructor