minor bug fixes

legacy
Steve Nyemba 3 years ago
parent 9438144772
commit 255e9ede59

@ -15,7 +15,7 @@ from flask_session import Session
from flask_cors import CORS
from flask_pymongo import PyMongo
from flask_mongo_sessions import MongoDBSessionInterface
import transport
import stripe
import json
# from StringIO import StringIO
@ -53,18 +53,21 @@ app = Flask(__name__)
CORS(app)
SYS_STORE = CONFIG['store']
LOGGER = transport.factory.instance(**SYS_STORE['logger'])
# @app.route("/donate")
# def _donate() :
# amount = float(request.args['amount']) if 'amount' in request.args else 5.0
# args = {'amount':amount,'context':CONTEXT}
# return render_template('donate.html',**args)
def get_id(id):
return CONFIG['default']['id'] if not id else id
@app.route("/")
def index():
if 'default' in CONFIG:
id = CONFIG['default']['id']
return get_plans_ui(id)
headers = {"content-type":"application/json"}
mystore = store.factory.instance(name='music')
products = mystore.get.products()
@ -234,6 +237,7 @@ def get_plans_ui(id):
This function loads the form for signup and information about the various plans for a given product.
:id name of the products
"""
id = get_id(id) #-- will return default if need be
mystore = store.factory.instance(name=id)
#
# sort plans by
@ -243,7 +247,6 @@ def get_plans_ui(id):
args = {"product":id,"label":label,"description":description,"context":CONTEXT,"plans":mystore.get.plans(),"now":datetime.now().year}
args['product'] = mystore.product
args['theme'] = 'theme-clouds'
# print (mystore.product.keys())
session['cloud-view'] = CONFIG['cloud-view'].replace(':id',id)
session['product'] = mystore.product
return render_template('plans.html',**args)
@ -382,6 +385,7 @@ def init(product):
user = mystore.user
user.init (uid)
# prrint (user.plan.info())
if not user.plan.info() :
mystore.plan.subscribe(email = user.info()['email'])
@ -449,16 +453,16 @@ def features(product):
if __name__ == '__main__' :
#
# setup mongodb session management (not sure why)
app.config['SESSION_TYPE'] = 'mongodb'
app.config['MONGO_URI'] = 'mongodb://localhost:27017'
app.config['SESSION_MONGODB_DB'] = 'sessions'
app.config['SESSION_MONGODB_COLLECT'] = 'store'
mongo = PyMongo(app)
app.session_interface = MongoDBSessionInterface(app,mongo.db, 'store')
#app.config['SESSION_TYPE'] = 'mongodb'
#app.config['MONGO_URI'] = 'mongodb://localhost:27017'
#app.config['SESSION_MONGODB_DB'] = CONFIG['store']['logger']['db']
#app.config['SESSION_MONGODB_COLLECT'] = 'session'
#mongo = PyMongo(app)
#app.session_interface = MongoDBSessionInterface(app,mongo.db, 'store')
app.debug = True ;
app.secret_key = '360-8y-[0v@t10n]+kr81v17y'
app.config['MAX_CONTENT_LENGTH'] = 1600 * 1024 * 1024
Session(app)
#Session(app)
app.run(port=PORT,threaded=True,host='0.0.0.0')
# app.run() #'0.0.0.0',PORT,True,threaded=True)

@ -364,7 +364,7 @@ $(document).ready(function(){
<div align="center">
all rights reserved &copy; {{ now }}, The Phi Technologys
</div>
<div align="center">
<div align="center" class="active" onclick="jx.modal.show({url:'{{context}}/terms'})">
Privacy & Terms
</div>

@ -0,0 +1,22 @@
<meta charset="UTF-8">
<!--
(c) 2018 - The Phi Technology LLC
steve@the-phi.comf.ff/'fum 9 mmmmp m87 b
-->
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1">
<link href="{{ context }}/static/css/default.css" rel="stylesheet" type="text/css">
<link href="{{ context }}/static/css/fa/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<div style="height:100%;">
{% include 'header.html' %}
<p><div class="caption">Terms of Use</div></p>
<p class="border-round text">
The Phi Technology offers a wide range of services and products that are intended to be used to empower end-users.
As such we reserve the rights to cancel/disable/ban any user from using any of our products if we deem they are misusing anyone of our products.
</p>
</div>

@ -8,3 +8,4 @@ flask-mongo-sessions
flask-pymongo
flask-session
git+https://dev.the-phi.com/git/steve/data-transport.git
stripe==2.48.0
Loading…
Cancel
Save