2013-06-19 198 views
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' 
) 

感谢

我的项目结构

回答