vue create frontend (Version = 2)
cd frontend
npm install
vue add vuetify
vue.config.js
filenpm run serve
mkdir backend
pip install Flask
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
if __name__ == "__main__":
app.run()
cd backend
python main.py
module.exports = {
transpileDependencies: ["vuetify"],
assetsDir: "static",
outputDir: "dist",
};
cd frontend
npm run build
print("module [app] loaded")
from flask import Flask, render_template, make_response
import os
app = Flask(__name__
, template_folder=os.getcwd()+'../../frontend/dist'
, static_folder=os.getcwd()+'../../frontend/dist/static'
, static_url_path='/static')
@app.route("/", methods=["GET"])
def page_index():
resp = make_response(render_template("index.html"))
return resp
if __name__ == "__main__":
app.run()
cd backend
python main.py
✅ 가상 환경을 만들어 개발하는 것 추천 Python Virtual Environment