Python/Django project, runs on tips.bitcoin.com
- Create virtual env
- Copy
bctip/local_settings.py.example
,bctip/settings.py.example
, andbctip/wsgi.py.example
to drop the.example
ending and edit for local settings - Start Bitcoin ABC full node
- Activate python virtual environment
$ virtualenv env
$ source env/bin/activate
- 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
- Run the app in local browser
(env) $ python manage.py runserver
- Open browser and navigate to
localhost:8000
- Test
return_expired.py
by running the script manually
(env) $ python utils/return_expired.py
Starting with a fresh Ubuntu 16.04 server...
- Install git and nginx
sudo apt install git
sudo apt-get install nginx
- Clone this git repository into
/var/www/bch-tip
- Copy
bctip/local_settings.py.example
,bctip/settings.py.example
, andbctip/wsgi.py.example
to drop the.example
ending and edit for local settings cd
into the repo directory, e.g.cd /var/www/bch-tip
- 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
$
- Create
systemctl
service for deployment withgunicorn
- Configure
nginx
for appropriate URL, matching other settings config files - Deploy with
systemctl
- 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