Running the ‘flasky’ app

I hope you remember these steps for looking at the files and code from Grinberg’s “flasky” repo:

  1. cd into your flasky directory
  2. activate the virtualenv
  3. Do a git checkout for the appropriate chapter and section (Grinberg gives you these explicitly throughout each chapter); for example:
    git checkout 4a

When you run the hello.py program at first, you type python hello.py at the $ prompt. This starts the server and the app, as we did in class on March 15. You can view the page at localhost:5000 in your browser.

Starting in chapter 2, when we have manager = Manager(app) in the program, we have to run the program with an extra command-line command, runserver:

$ python hello.py runserver

There’s one other possible stumbling block to be avoided: Have you “pipped” all the things that Grinberg has told you to install?

Here’s a list in case you forgot something:

  • $ pip install flask-script (p. 17)
  • $ pip install flask-bootstrap (p. 26)
  • $ pip install flask-moment (p. 33)
  • $ pip install flask-wtf (p. 37)
  • $ pip install flask-sqlalchemy (p. 52)
  • $ pip install flask-migrate (p. 64)

You can use the command pip freeze to see a list of all the packages you have installed.

Screen Shot 2016-03-20 at 7.40.12 PM

So if you are getting errors when you try to run something, make sure you have installed all the required packages!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s