Skip to content
Aditya Bansal edited this page Oct 8, 2016 · 15 revisions

1. Pre-reqs before starting:

a. Install python 2.7+

b. Install virtualenv and pip.

On ubuntu sudo apt-get install python-pip pip install virtualenv

c. install heroku toolbelt

Follow instructions at https://toolbelt.heroku.com/. This should also install git.

2. Clone the repository in your machine

git clone https://github.com/adityabansal/newsApp

3. Create a virtual environment at cloned repository's root

virtualenv venv

To load the created virtual environment source venv/bin/activate

4. Install dependecies from requirements.txt

pip install -r /path/to/requirements.txt

Note: On ubuntu, you might have to run following commands for lxml to be installed: sudo apt-get install libxml2-dev libxslt1-dev python-dev libz-dev

5.Create the required databases, S3 buckets, SQS queues etc and add the .env file

Add the databases, buckets and queues as described here. Create the .env containing various configuration settings and secrets and add it to repository root. This .env file will be used by foreman if you run the app locally. It is not added into git because it contains secrets (like aws keys).

6. run the app locally using foreman

foreman start

7. run unit tests

nosetests

8. setup heroku remote

Run the following command to set up a git remote for deploying to a heroku app

heroku git:remote -a appName

To deploy -> git push heroku master