Schmebulock's goal is to gather information from products and compare their prices over time, so users can make educated decisions on how to spend their money.
Currently under early development (alpha).
Development being done in GitLab and GitHub (mirror) simultaneously.
- PostgreSQL9.5+
- Python3.4+
- virtualenvwrapper (recommended, but any virtualenv manager will do)
- Unix based OS (instructions written for GNU/Linux systems)
-
Activate virtualenv:
mkvirtualenv schmebulock --python=/usr/bin/python3 (if it doesn't exist) workon schmebulock
-
Clone this repo into your preferred directory:
GitLab:
git clone git@gitlab.com:jeacaveo/schmebulock.git
GitHub:
git clone git@github.com:jeacaveo/schmebulock.git
Enter project root:
cd schmebulock
-
Configure database (creating as superuser to allow creating extension):
$ sudo su postgres $ psql # create database schmebulock; # create user schmebulock with password 'schmebulock'; # alter role schmebulock set client_encoding to 'utf8'; # alter role schmebulock set default_transaction_isolation to 'read committed'; # alter role schmebulock set timezone to 'UTC'; # grant all privileges on database schmebulock to schmebulock; # alter user schmebulock superuser; # \c schmebulock # create extension postgis # \q $ exit
-
Install requirements:
pip install -r requirements-dev.txt
-
Run migrations:
python manage.py migrate python manage.py migrate cities
-
Run tests without coverage (parameters in [] are optional):
python manage.py test [app_name][.test_module][.TestClass][.test_name]
-
Run tests with coverage:
coverage run --source='.' manage.py test && coverage report -m
-
Create superuser (optional):
python manage.py createsuperuser
(complete user creation process, suggestions: admin/admin123)
-
Load initial data for stores and brands (optional, if ran multiple times it will create duplicates):
python manage.py loaddata stores python manage.py loaddata brands
-
Load city data (optional, not loading postal code or alternative name data):
mkdir -p cities/data python manage.py cities --import=country python manage.py cities --import=region python manage.py cities --import=subregion python manage.py cities --import=city python manage.py cities --import=district
-
Run the server:
python manage.py runserver
API root (Django Schema Browser):
http://localhost:8000/api/
API documentation root (Swagger):
http://localhost:8000/api/docs/