I have the classes in main module
__init__.py
import web
from web.contrib.template import render_jinja
urls = (
'/', 'main.views.login',
'/login', 'main.views.login',
'/feature', 'main.views.feature'
)
app = web.application(urls, globals())
render = render_jinja(
'main/templates',
encoding='utf-8',
)
views.py
from main import web, render
class login:
def GET(self):
return render.login(title="Login")
def POST(self):
data = web.input();
userName = data['username']
password = data['password']
if((userName == 'viv') and (password == 'viv')):
raise web.seeother('/feature?user=' + userName)
return render.login(error="Login Failed !!!")
class feature:
def GET(self):
print(web.input())
return render.feature()
In login.POST , the form data is compared and if successful i need to redirect to feature.html which has
<div>Hello {{ user }}</div>
Using JINJA2 templating with web.py how can i redirect to feature.html with parameter 'user'. The above code works but 'user' is send as URL parameter .Basically i want to try web.py redirect with JINJA2 templating.Please help.