Skip to content
/ 20 Public
generated from cs130-w21/template

StockMeetsBagel: Profile Generation from Stock Portfolio

License

Notifications You must be signed in to change notification settings

cs130-w21/20

Repository files navigation

StockMeetsBagel

Build Status Release

See our about page.

Setup

It is recommended to install dependencies for this project in a virtual environment. Python 3 comes with venv, while Python 2 needs virtualenv. Instructions here are from Flask's docs.

Create an environment

On Unix machines, run the following in the project folder:

$ mkdir venv
$ python3 -m venv venv

On Windows, run the following in the project folder (Powershell):

> mkdir venv
> py -3 -m venv venv

If you are using Python 2, run this instead:

$ mkdir venv
$ python2 -m virtualenv venv

Activate the environment

Before installing dependencies, activate the created environment:

$ . venv/bin/activate

On Windows:

> venv\Scripts\activate

Install dependencies

Within the activated environment, run the following command to install dependencies (Windows/Unix):

$ pip install -r requirements.txt

This will install Flask with optional dependencies in your activated environment. If you do not need optional dependencies listed in the requirements file, you can edit requirements.txt before installing.

Before Running

If you are running the application for the first time, you will need to initialize the database. Run the following within venv to initialize the database:

$ flask init-db

With the database initialized, launch the application within venv with

$ export FLASK_APP=flaskr
$ flask run

This release uses Flask's built-in server, but it is recommended to use a production container like Gunicorn.