Skip to content

Xenia101/Flask-Vue.js-Integration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask Vue.js Integration

python Flask + Vue.js simple Intergration

Execution / Test Environment

  • Window 10
  • Python 3.6
  • Vue.js lastest version

Issue

When Flask + Vue intergration, confrict a Jinja2 delimiter and Vue.js delimiter

Add python code at app.py

class CustomFlask(Flask):
    jinja_options = Flask.jinja_options.copy()
    jinja_options.update(dict(
        block_start_string='(%',
        block_end_string='%)',
        variable_start_string='((',
        variable_end_string='))',
        comment_start_string='(#',
        comment_end_string='#)',
    ))
    
app = CustomFlask(__name__)

and insert the code below into main

app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 0

Example

Examples in Vue.js KOR

  • example app1, app5, app6

References

https://kr.vuejs.org/v2/guide/index.html

https://github.com/yymm/flask-vuejs