我可以正确地在烧瓶开发模式下运行服务器。
我想我错过了一些params来运行 uwsgi 服务器,以便收到错误消息。
uwsgi --socket 127.0.0.1:4245 --module web --callable app --processes 4 --threads 2
*** Operational MODE: preforking+threaded ***
Traceback (most recent call last):
File "./web.py", line 19, in <module>
from model.release_schedule import ReleaseSchedule
ImportError: No module named model.release_schedule
#!/usr/bin/env python3
# -*- coding: utf8 -*-
from flask import request, url_for
from flask import Flask, request, jsonify
from flask_request_params import bind_request_params
from flask import g
import datetime
import pandas as pd
import pymongo
import json
from webargs import Arg
from webargs.flaskparser import use_args, use_kwargs
import yaml
import time, functools
from pdb import set_trace
from pandas_helper import PandasHelper
import errors
from app_helper import *
from model.release_schedule import ReleaseSchedule
from model.history import History
from model.report_type_symbol import ReportTypeSymbol
from model.weekly_history import WeeklyHistory
from mongo import Mongo
# load config file
APP_CFG = yaml.load(open("app.yml", "r"))
MSG = yaml.load(open("message.yaml", "r"))
答案 0 :(得分:1)
如果要将其用作python包,则需要在模型文件夹中添加__init__.py
。它可能在调试模式下工作,因为父目录位于PYTHONPATH
。