GithubHelp home page GithubHelp logo

flask_practice's Introduction

flask_practice

快速實作作品

link

virtualenv

用virtualenv可以讓不同版本的flask不會因為global的東西被改變後,舊的東西因此死機。 在flask的資料夾裡: virtualenv -p C:\Python34\python.exe venv 可以選擇python的版本。 pip install flask 可以安裝flask相應的版本。

flask的架構

把像home.htmlabout.html等文件放在templates這個資料夾下,然後用layout.html做為主模版,如果有和layout.html不一樣的話,可以取代,這就是template的概念。 如果是css、js、image的靜態的文件的話,可以放在static之下。

Jinja2的語法

{% for post in posts %} 一些statement用{%%},可以傳進html版後,進行排版 {{ title }} 變數名雙大括號

deploy to Heroku

參考自Deploying-Flask-To-Heroku

Reference

  1. https://www.youtube.com/watch?v=QnDWIZuWYW0&list=PL-osiE80TeTs4UjLw5MM6OjgkjFeUxCYH&index=3&t=0s
  2. https://www.youtube.com/watch?v=N5vscPTWKOk

flask_practice's People

Contributors

soulertsai avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.