app.py - from flask import(Flask render_template request make_response session url_for redirect app = Flask_name app.secret_key ='[email protected]

app.py - from flask import(Flask render_template request...

This preview shows page 1 out of 1 page.

from flask import (Flask, render_template, request, make_response, session, url_for, redirect) app = Flask (__name__) app.secret_key = 'randomstring' @app.route('/') def index(): search = request.args.get('search') return render_template('index.html', search=search) @app.route('/profile/<username>') def show_profile(username): return render_template('profile.html', username=username) @app.route('/login', methods=['GET', 'POST']) def show_login(): if request.method == 'POST': resp = make_response('Email kamu adalah ' + request.form['email']) resp.set_cookie('email_user', request.form['email'])
Image of page 1

You've reached the end of your free preview.

Want to read the whole page?

  • Fall '19
  • flask import, return render_template('index.html

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture