Advertisement
DrAungWinHtut

webserver.py

Feb 11th, 2024
1,200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. from flask import Flask,redirect,url_for,render_template
  2.  
  3. app = Flask(__name__)
  4.  
  5.  
  6. @app.route('/')
  7. def home():    
  8.     return render_template('home.html')
  9.  
  10. @app.route('/info/')
  11. def info():
  12.     file = open('info.html','r')
  13.     content = file.read()
  14.     file.close()
  15.     return content
  16.  
  17. @app.route('/lib/')
  18. def lib():
  19.     return render_template('lib.html',data=['aung','win','htut'])
  20.  
  21.  
  22. @app.route('/admin/')
  23. def admin():
  24.     return redirect(url_for('home'))
  25.  
  26.  
  27.  
  28.  
  29.  
  30. if __name__ == '__main__':
  31.     app.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement