项目作者: beebus

项目描述 :
Learning Flask - A course on LinkedIn Learning.
高级语言: Python
项目地址: git://github.com/beebus/crispy-spoon.git
创建时间: 2019-08-17T08:23:32Z
项目社区:https://github.com/beebus/crispy-spoon

开源协议:GNU General Public License v3.0

下载


Python package

crispy-spoon

flask playground based on https://www.linkedin.com/learning/learning-flask-2

  1. $ heroku login

heroku: Press any key to open up the browser to login or q to exit:

Opening browser to https://cli-auth.heroku.com/auth/browser/

Logging in… done

Logged in as…

  1. $ heroku create

Creating app… done, [appname]…

  1. $ heroku addons:create heroku-postgresql:hobby-dev -a [appname]

Creating heroku-postgresql:hobby-dev on [appname]… free

Database has been created and is available

! This database is empty. If upgrading, you can transfer

! data from another database with pg:copy

Created postgresql-something-37746 as DATABASE_URL

Use heroku addons:docs heroku-postgresql to view documentation

  1. $ heroku config -a [appname]

(Save the response info)

  1. $ sudo pip install --upgrade pip
  2. $ sudo pip install virtualenv

In a folder with a .py file and a requirements.txt file, run the following.

  1. $ virtualenv venv

Using base prefix ‘/usr’… Installing setuptools, pip, wheel…

done.

  1. $ source venv/bin/activate
  2. $ pip install -r requirements.txt
  3. $ export FLASK_APP=flask-basic.py
  4. $ flask run
  • Serving Flask app “flask-basic”
  • Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)

    127.0.0.1 - - [17/Aug/2019 03:12:39] “GET / HTTP/1.1” 200 -

    127.0.0.1 - - [17/Aug/2019 03:12:39] “GET /favicon.ico HTTP/1.1” 404 -