You can either run this locally with a default sqlite database after
installing the requirements.txt file, or if you have Docker and
prefer a cleaner environment, install docker-compose with
install docker-compose and run
docker-compose up. This will set up
a near production-ready containerized development environment that
runs migrations, with the django development server running on
To run one-off commands, like shell, you can run
docker-compose run web python manage.py shell or to create root
Currently in the development environment we compile JSX on every
request, which at the time of this writing is about 5 seconds. If you
want to disable this (because you are working just on python for
example), you can add the line
LORE_COMPRESS_ENABLED: True to
docker-compose.yml under the web -> environment section of the file.
The first request will then take 5 seconds, but subsequent ones will
Adding an application
To add an application to this, add it to the requirements file, add its needed settings, include its URLs, and provide any needed template overrides.
We have bower installed and configured in the
docker image. This is very handy for documenting and adding
dependencies like backbone or bootstrap. To add a new dependency,
docker-compose run web bower install jquery --save for
example. This will download jquery to the
lore/static/bower/jquery folder and add it to the bower.json file.
The assets downloaded should be stripped down to as little as needed
before checking in, but the files should be checked into the repository.
We are using django-compressor for static asset compression, along with django-compressor-requirejs for creating requirejs packages. What this means to you is that you need to do static asset additions in your templates with something like:
The project is setup with
py.test. It will run pylint, pep8, and
py.test tests with coverage. It will also generate an HTML coverage
report. To run them all inside the docker image, run
run web tox, or if you are running locally, after installing the
requirements file, just run
docker-compose -f docker-karma.yml up and connecting
to port 9876 on your docker host.
In addition to local testing, all commits and pull requests are tested on travis-ci.org.
If you want test to run on file changes, the
adds pytest-watcher, which can be started with:
docker-compose run web ptw --poll
For additional options like having it say "passed"
out loud, or sending desktop notifications for failures see the
Keep in mind, there can be a bit of a lag between saves and the test running.
Building Local Documentation
To build the sphinx documentation project, run:
docker-compose run web tox -e docs
This will build it on your local machine and you should be able to
point your browser at
RESTful API Documentation
LORE has a RESTful API that is documented on Apiary http://docs.lore.apiary.io .