Skip to content
Printable Bitcoin Tips
Python HTML CSS
Branch: master
Clone or download
Pull request Compare This branch is 33 commits ahead of norn:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bctip
core
jsonrpc
locale
static-frontend/static
utils
.gitignore
LICENSE
README.md
manage.py
requirements.txt

README.md

BCH Tip - Printable Bitcoin Cash (BCH) Tips

Python/Django project, runs on tips.bitcoin.com

Development

  1. Create virtual env
  2. Copy bctip/local_settings.py.example, bctip/settings.py.example, and bctip/wsgi.py.example to drop the .example ending and edit for local settings
  3. Start Bitcoin ABC full node
  4. Activate python virtual environment
$ virtualenv env
$ source env/bin/activate
  1. With virtual environment activated:

Collect necessary static files for the app

(env) $ python manage.py collectstatic

Initialize database

(env) $ python manage.py makemigrations
(env) $ python manage.py migrate
  1. Run the app in local browser
(env) $ python manage.py runserver
  1. Open browser and navigate to localhost:8000
  2. Test return_expired.py by running the script manually
(env) $ python utils/return_expired.py

Production

Starting with a fresh Ubuntu 16.04 server...

  1. Install git and nginx
sudo apt install git
sudo apt-get install nginx
  1. Clone this git repository into /var/www/bch-tip
  2. Copy bctip/local_settings.py.example, bctip/settings.py.example, and bctip/wsgi.py.example to drop the .example ending and edit for local settings
  3. cd into the repo directory, e.g. cd /var/www/bch-tip
  4. Install and activate python virtual environment, then install requirements and configure database
$ sudo apt-install virtualenv
$ virtualenv env
$ source env/bin/activate
(env) $ pip install -r requirements.txt
(env) $ python manage.py makemigrations
(env) $ python manage.py migrate
(env) $ python manage.py collectstatic
(env) $ deactivate
$ 
  1. Create systemctl service for deployment with gunicorn
  2. Configure nginx for appropriate URL, matching other settings config files
  3. Deploy with systemctl
  4. Set up crontab to run /utils/return_expired.py

The script will output a log to return_expired.log in root directory of the git repo

You can’t perform that action at this time.