diff options
Diffstat (limited to 'talerblog/blog')
-rw-r--r-- | talerblog/blog/blog.py | 12 | ||||
-rw-r--r-- | talerblog/blog/templates/base.html | 4 |
2 files changed, 10 insertions, 6 deletions
diff --git a/talerblog/blog/blog.py b/talerblog/blog/blog.py index 1adcb7f..25f5687 100644 --- a/talerblog/blog/blog.py +++ b/talerblog/blog/blog.py @@ -28,7 +28,7 @@ import uuid import base64 import requests import flask -from werkzeug.contrib.cache import SimpleCache +from werkzeug.contrib.cache import UWSGICache, SimpleCache from talerblog.talerconfig import TalerConfig from ..blog.content import ARTICLES, get_article_file, get_image_file @@ -113,7 +113,11 @@ def javascript_licensing(): # Cache for paid articles (in the form <session_id>-<article_name>), so we # don't always have to ask the backend / DB, and so we don't have to store # variable-size cookies on the client. -paid_articles_cache = SimpleCache() +try: + paid_articles_cache = UWSGICache(0, "paid_articles") +except ImportError: + paid_articles_cache = SimpleCache() + # Triggers the refund by serving /refund/test?order_id=XY. @@ -170,12 +174,12 @@ def article(article_name, data=None): # We use an explicit session ID so that each payment (or payment replay) is # bound to a browser. This forces re-play and prevents sharing the article # by just sharing the URL. - session_id = flask.session.get("uid") + session_id = flask.session.get("session_id") order_id = flask.request.args.get("order_id") session_sig = flask.request.args.get("session_sig") if not session_id: - session_id = flask.session["uid"] = str(uuid.uuid4()) + session_id = flask.session["session_id"] = str(uuid.uuid4()) cached_order_id = paid_articles_cache.get(session_id + "-" + article_name) if cached_order_id: diff --git a/talerblog/blog/templates/base.html b/talerblog/blog/templates/base.html index 54ceb60..98ce2e3 100644 --- a/talerblog/blog/templates/base.html +++ b/talerblog/blog/templates/base.html @@ -17,6 +17,7 @@ <html data-taler-nojs="true"> <head> + <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Taler Donation Demo</title> <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='web-common/pure.css') }}" /> @@ -49,8 +50,7 @@ <div class="demobar" style="display: flex; flex-direction: column;"> <h1><span class="tt adorn-brackets">Taler Demo</span></h1> <h1><span class="it"><a href="{{ env('TALER_ENV_URL_MERCHANT_BLOG') }}">Shop</a></span></h1> - <p>This is the Essay shop, you can buy articles using an imaginary currency (for now).</p> - <p> + <p>On this page you can buy articles using an imaginary currency (for now). The articles are chapters from Richard Stallman's book "Free Software, Free Society", which is also <a href="http://shop.fsf.org/product/free-software-free-society-2/">published by the FSF</a> |