Simple site to display the general and historical arbitrage on the Luno exchange.
example: https://dev.thewrongway.co.za
Local:
- Python 3
- Git
- Selenium and Chrome web-driver
- Free account on www.openexchangerates.org or an alternative currency exchange API
Local Django development environment:
Create your virtual environment:
python -m venv venv
Activate virtual environemnt:
source venv/bin/activate
Clone repo
git clone https://github.com/ebdekock/crypto.git
Install requirements
pip install -r requirements.txt
Set up Django DB
python manage.py migrate
Update secret key, currency api key and site site url in settings.py.
Make any other adjustments.
Add cron
python manage.py crontab add
(Optional) Run initial cron manually:
python manage.py shell
>>> from spread.cron import currency_lookup
>>> from spread.cron import price_lookup
>>> currency_lookup()
>>> price_lookup()
>>>
Start server
python manage.py startserver
Functional Tests
Requires development server to be running.
Runs test as an end user, uses Selenium to launch a headless browser and test for major sections of website and any console errors.
python manage.py test spread.functional_tests
Unit Tests
The index test creates mock entries in a test database and ensures the correct template is being used to render site.
The cron test goes through all the exchanges and currency API calls to ensure all entries return correct types.
python manage.py test
Quick-start development settings - unsuitable for production
See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
- Django - The web framework used
- Requests - Make HTTP requests to access remote API's
- Selenium - Functional tests
- Idea from here.
