Frontend supplier application for the digital marketplace.
- Python app, based on the Flask framework
Install Virtualenv
sudo easy_install virtualenv
Install dependencies, build assets and run the app
make run_all
Install Virtualenv
sudo easy_install virtualenv
Create a virtual environment
virtualenv ./venv
source ./venv/bin/activate
Install new Python dependencies with pip
make requirements_for_test
Front-end code (both development and production) is compiled using Node and Gulp.
You need Node (minimum version of 0.10.0, maximum version 0.12.x) which will also get you NPM, Node's package management tool.
To check the version you're running, type:
node --version
To install the required Node modules, type:
npm install
NPM is used for all frontend build tasks. The commands available are:
npm run frontend-build:development
(compile the frontend files for development)npm run frontend-build:production
(compile the frontend files for production)npm run frontend-build:watch
(watch all frontend files & rebuild when anything changes) FAILEDnpm run frontend-install
(install all non-NPM dependancies)
Note: npm run frontend-install
is run automatically as a post-install task when you run npm install
.
To run the whole testsuite:
make test
To test individual parts of the test stack use the test_pep8
, test_python
or test_javascript
targets.
eg.
make test_javascript
To run the Supplier Frontend App for local development use the run_all
target.
This will install requirements, build assets and run the app.
make run_all
To just run the application use the run_app
target.
The supplier frontend runs on port 5003. Use the app at http://127.0.0.1:5003/suppliers
To use feature flags, check out the documentation in (the README of) digitalmarketplace-utils.
boto provides a Python interface to Amazon Web Services; it's what we're using to download from and upload to our s3 buckets.
If you don't configure your AWS credentials correctly
on your local machine, you'll probably run into a nasty-looking boto.exception.NoAuthHandlerFound
page at some point.
The short version is that you should create an ~/.aws/credentials
file formatted like so:
[default]
aws_access_key_id = ...
aws_secret_access_key = ...
AWS access keys can be found/configured in the Identity and Access Management (IAM) section of the digitalmarketplace-development AWS console.
If you're experiencing problems connecting, make sure to unset
any env
variables used by boto (e.g. AWS_ACCESS_KEY_ID
, AWS_SECRET_ACCESS_KEY
,
AWS_SECURITY_TOKEN
and AWS_PROFILE
) as they may be overriding the values in your credentials file.
- Setup the heroku command https://devcenter.heroku.com/articles/getting-started-with-python#set-up
- Create the app with
heroku create
- Set the app to have a multi-buildpack with
heroku buildpacks:set https://github.com/ddollar/heroku-buildpack-multi.git
- Set environment variables with
heroku config:set
- Deploy the app with
git push heroku <your-branch>:master