-2

The error:

line 136, in render_template
   ctx.app.update_template_context(context)
    AttributeError: 'NoneType' object has no attribute 'app'

The app.route:

@app.route('/congratulations')
def congratulations():
    return render_template('congratulations.html')

To redirect to this template I used:

redirect('/congratulations')
and
congratulations() 

(None of them are working)

davidism
  • 121,510
  • 29
  • 395
  • 339

1 Answers1

0

Let me write down examples I used

return redirect(url_for('main.login'))

return redirect('/')

return redirect(f'/store/{store_id}')

This is a reference. https://python-commandments.org/flask-redirect/ https://flask.palletsprojects.com/en/2.1.x/api/#flask.redirect

I hope it helps.

Ellie-YS
  • 11
  • 4