- Up to Python 3.6.3 installed
- Clone the repository
$ git clone https://github.com/johnsliao/Shopify-SocialProofing.git
- Set up your virtual environment
$ virtualenv -p python3 venv
$ source venv/bin/activate
- Set your environment variables.
$ export API_KEY=<API_KEY>
$ export API_SECRET=<API_SECRET>
$ export DEVELOPMENT_MODE=TEST # Must be 'TEST' or 'PRODUCTION'
- Install dependencies
$ pip install -r requirements.txt
- Run the server
$ python3 manage.py runserver
You should see something like:
(venv) dtl-macbook1:Shopify-SocialProofing jliaolocal$ python3 manage.py runserver
Performing system checks...
System check identified no issues (0 silenced).
You have 13 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
October 31, 2017 - 17:20:00
Django version 1.11.1, using settings 'app.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
In order to build the front end bundle, navigate to app/react
From the directory with the package.json, run npm install
to have all the node_modules.
Now run npm run build
in order to compile the bundle.js. It should show up in static/app/bundle.js folder where it can be required in by
any html file.
Heroku is the hosting service for the app and the database (postgres).
To query the database via Heroku:
- More -> Run Console
$ heroku run bash
- Connect to the database
$ psql -h <host> -p <port> -U <username> <database>
- Run a query
$ SELECT * FROM app_stores;
id | store_name | permanent_token
----+---------------------------------+----------------------------------
1 | michael-john-devs.myshopify.com | 948d9463f07e4bfcc8b5324b62637898
(1 row)
Trello board found here.
Currently using Travis CI.
To run the tests manually, use the following command:
$ python3 manage.py test