Advertisement
Guest User

Untitled

a guest
Oct 14th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.89 KB | None | 0 0
  1. VIEWS.PY
  2.  
  3. from flask import render_template, request
  4. from core.forms import LoginForm
  5. from core.utils import Site
  6. import lxml.html
  7.  
  8. @app.route('/', methods=['GET', 'POST'])
  9. def main_page():
  10.     form = LoginForm()
  11.     if request.method == 'POST':
  12.         username=request.form['username']
  13.         password=request.form['password']
  14.         path=Site.user_path
  15.         s=Site.login(username, password)
  16.         url='https://link.com/index'
  17.         user_response=Site.get_content(Site, s, url, path)
  18.         user=', '.join([str(x) for x in user_response])
  19.  
  20.         context={
  21.             "user": user.replace("(", "- "),    
  22.         }
  23.         return render_template("start_page.html", context=context)
  24.     return render_template("index.html", form=form)
  25.  
  26. @app.route('/marks')
  27. def marks():
  28.     url='https://link.com/marks'
  29.     #Here i have a problem
  30.     return render_template("marks.html")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement