1 2 3 4 5 6 7 8 9 10 | #main.py from flask import Flask from controllers.index import Index app = Flask(__name__) Index.register(app, route_base = '/' ) if __name__ = = '__main__' : app.run(debug = True ) |
1 2 3 4 5 6 7 8 9 10 11 | #controllers/index.py from flask import render_template from flask_classful import FlaskView, route class Index(FlaskView): def __init__( self ): pass @route ( '/' ) def index( self ): return render_template( 'index.html' , data = { 'blogTitle' : 'រៀនពីចំងាយ' }) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | <!--templates/index.html--> <!DOCTYPE html> < html > < head > < meta charset = "UTF-8" /> < meta name = "viewport" content = "width=device-width, initial-scale=1.0" /> < title >{{data['blogTitle']}}</ title > < script src = "/static/scripts/jQuery.js" ></ script > < script src = '/static/scripts/main.js' ></ script > < link href = "/static/styles/index.css" rel = "stylesheet" > < link href = "/static/fonts/setup.css" rel = 'stylesheet' > < link href = "/static/images/site_logo.png" rel = "icon" > </ head > < body > ស្វាគមន៍មកកាន់កម្មវិធីកេហទំព័រ «រៀនពីចំងាយ» </ body > </ html > |
GitHub: "https://github.com/Sokhavuth/E-Learning
Heroku: https://khmerweb-elearning.herokuapp.com/