| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- from flask import Flask, request, redirect, url_for, render_template
- #from flask.ext.pymongo import PyMongo
- from assets import create_assets
- import os
- class CustomFlask(Flask):
- jinja_options = Flask.jinja_options.copy()
- jinja_options.update(dict(
- variable_start_string='%%',
- variable_end_string='%%',
- ))
- app = CustomFlask(__name__)
- app.config['DEBUG'] = True
- '''app.config['MONGO_DBNAME'] = 'tumcomm_db'
- #app.config['MONGO_HOST'] = '61.19.226.195'
- if os.environ.get('LIVELY_ENV') == 'prod':
- DB_HOST = os.environ.get('DB_HOST', '10.0.3.6')
- app.config['MONGO_HOST'] = DB_HOST
- app.config['UPLOAD_FOLDER'] = '/opt/media'
- app.config['IMG_SV'] = "http://mcot-images.simplico.net"
- app.config['VOD_SV'] = "http://61.19.226.179:1935/vod/_definst_/mp4:media01/"
- app.config['ENV'] = 'prod'
- else:
- app.config['MONGO_HOST'] = 'localhost'
- app.config['UPLOAD_FOLDER'] = '/opt/media'
- app.config['IMG_SV'] = "http://mcot-images.simplico.net"
- app.config['VOD_SV'] = "http://61.19.226.179:1935/vod/_definst_/mp4:media01/"
- app.config['MONGO_CONNECT'] = False
- #mongo = PyMongo(app)
- '''
- create_assets(app)
- @app.route('/', defaults={'path': ''})
- @app.route('/<path:path>')
- def index(path):
- return render_template('index.html')
- #@app.route('/content')
- #def content():
- # return render_template('content.html')
- if __name__ == '__main__':
- app.debug = app.config['DEBUG']
- app.run()
|