Coder Social home page Coder Social logo

bctip's Introduction

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

bctip's People

Contributors

norn avatar selimaydi avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.