Skip to content

kflavin/stock_screener_web

Repository files navigation

CircleCI

deploy to heroku

git push heroku master
heroku ps:scale web=1

Dryscrape on Ubuntu

Ensure webkit dev installed

sudo apt-get install libqtwebkit-dev

Tests

python manage.py tests

Configure (using virtualenvwrapper)

mkvirtualenv stocks_web
pip install -r requirements.txt

source environment

Use SQLAlchemy database URI's

# Setup database URI
export DEV_DATABASE_URL="sqlite:///stocks-dev.db"
export TEST_DATABASE_URL="sqlite:///stocks-test.db"
export DATABASE_URL="sqlite:///stocks-prod.db"

export MAIL_SENDER='youremail@example.com'
export MAIL_USER=<username>
export MAIL_PASSWORD=<password>
export SECURITY_PASSWORD_HASH="sha512_crypt"
export SECURITY_PASSWORD_SALT="somelongsaltstraing"

export PYTHONPATH=.:$PYTHONPATH

# Optional
export CLI_USER=<cli_user>
export CLI_PASSWORD=<cli_password>
export CLI_HOST=http://127.0.0.1:5000

Create postgres table

create user dev_user with password 'password';
create database dev_db owner dev_user;
grant all privileges on database dev_db to dev_user;

setup db for local testing

python manage.py create_db
python manage.py create_admin
python manage.py runserver