Giter Site home page Giter Site logo

wyldebeast-wunderliebe / w20e.paywall Goto Github PK

View Code? Open in Web Editor NEW
2.0 6.0 0.0 234 KB

A proof of concept Paywall mechanism using the micro-framework Flask and the online payment platform Mollie.

Home Page: https://paywall.pythonunited.com/test_voucher

License: MIT License

Python 48.74% HTML 50.70% CSS 0.56%
paywall mollie voucher micro-framework buildout flask concept-paywall

w20e.paywall's Introduction

w20e.paywall

A proof of concept paywall mechanism using the microframework Flask and the online payment platform Mollie.

requirements

  • Flask
  • requests
  • redis
  • mollie-api-python

virtualenv

virtualenv VENV
. ./VENV/bin/activate

clone from git

git clone https://github.com/wyldebeast-wunderliebe/w20e.paywall.git

buildout

cd w20.paywall
pip install zc.buildout
buildout -v

settings overrides

Use settings_overides.py for environment specific configuration adjustments like MOLLIE_API_KEY, REDIS_HOST and CSRF_SECRET_KEY.

touch src/instance/settings_overrides.py

fire up on development

export FLASK_APP=src/w20e/paywall/app.py
./bin/flask run

ngrok or serveo for localhost testing

Since Mollie needs to be able to reach your server (webhook_verification), you might consider using ngrok or serveo to create a secure tunnel to your localhost.

Serveo example: ssh -R 80:localhost:5000 serveo.net

fire up on production: mod_wsgi snippet

The paywall.wsgi script gets created by buildout. Below is a mod_wsgi snippet to get things going on Apache.

WSGIDaemonProcess paywall user=app-paywall-prd group=app-paywall-prd threads=5
WSGIScriptAlias / /opt/APPS/paywall/prd/w20e.paywall/parts/wsgiscript/paywall.wsgi

<Directory /opt/APPS/paywall/prd/w20e.paywall>
    WSGIProcessGroup paywall
    WSGIApplicationGroup %{GLOBAL}
    Require all granted
</Directory>

routes

For starters, you can navigate the following routes.

[host]/manage_vouchers
Needs to be restricted in a production environment. Gives an overview of all active vouchers, both valid and not.
[host]/test_voucher
A verify-buy-redirect chain, roundtripping the entire paywall mechanism.
[host]/new_voucher
Buy a voucher using a predefined set of voucher types.

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.