Skip to content

Latest commit

 

History

History
82 lines (53 loc) · 1.71 KB

INSTALL.md

File metadata and controls

82 lines (53 loc) · 1.71 KB

Installing Glossary Bot Locally

Follow these instructions to install a copy of Glossary Bot locally for development and testing.

Requirements

Glossary Bot is written in Python 3.6.6.

Install

Glossary Bot is a Flask app built to run on Heroku.

To install locally, clone this repository and cd into the resulting directory:

git clone [email protected]:codeforamerica/glossary-bot.git
cd glossary-bot

Set up and activate a new virtual environment using Virtualenv:

virtualenv venv-glossary-bot

Activate the virtual environment:

source venv-glossary-bot/bin/activate

Install the required packages with pip:

pip install -r requirements.txt

Create the production PostgreSQL database:

createdb glossary-bot

Copy env.sample to .env:

cp env.sample .env

and make sure that the value of DATABASE_URL in .env matches the name of the database you created in the last step.

Initialize the database:

python manage.py db upgrade

And run the application:

python manage.py runserver

Test

To run the app's tests, first create a test database. Make sure the name of the database matches the value of environ['DATABASE_URL'] set in the setUp() function in test/test_bot.py:

createdb glossary-bot-test

You can now run the tests from the command line:

python -m unittest

or run an individual test:

python -m unittest tests.test_bot.TestBot.test_get_definition