0
我可以正確運行在燒瓶開發模式下的服務器。ImportError:運行uwsgi時沒有模塊
我想我錯過了一些參數運行uwsgi服務器,以便得到錯誤消息。
運行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
web.py
#!/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"))
你應該在模型包中有一個'__init __。py'。 – garnertb
@garnertb cool你解決了這個問題,但是爲什麼我可以在flask調試模式下完美地運行它,而不需要__init__.py – user3675188