1
我想將我的本地unix服務器上運行良好的應用程序部署到OpenShift雲。我在那裏註冊並簽出git存儲庫。但我現在不知道該怎麼做。在這個倉庫 應用程序有以下結構:將Flask應用程序部署到OpenShift
/libs
/app.py
/setup.py
/wsgi
static/
application
,但我不知道我應該複製我的項目中哪些文件進行修改。是繼
/domain.wsgi
/domain/
app.py
infrastructure.py
models/
static/
templates/
views/
domain.wsgi
import sys, os
current_dir = os.path.abspath(os.path.dirname(__file__))
sys.path.append(current_dir)
from domain.app import app as application
app.py
from infrastructure import app
import views.index
import views.login
import views.logout
import models.sa
infrastructure.py
from flask import Flask, g
from flask.ext.sqlalchemy import SQLAlchemy
from models.sa import get_user_class, UserQuery
from models.database import db_session
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://.............'
db = SQLAlchemy(app)
## Set SQL Alchemy to automatically tear down
@app.teardown_request
def shutdown_session(exception=None):
db_session.remove()
# Instantiate authentication
User = get_user_class(db.Model)
# config
app.config.update(
DEBUG = True,
SECRET_KEY = 'xxxxxxxxx'
)
感謝
我的項目結構