盖世小蜗牛�
2020-12-10 16:32
采纳率: 100%
浏览 86
已结题

uwsgi + django部署,启动后数据模型异常

  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "./serv_api/controller/core_user/urls.py", line 3, in <module>
    from . import views
  File "./serv_api/controller/core_user/views.py", line 7, in <module>
    from core_user.services import accountservice
  File "./core_user/services/accountservice.py", line 3, in <module>
    from core_user.models import User
  File "./core_user/models.py", line 5, in <module>
    class User(models.Model):
  File "/usr/local/python36/lib/python3.6/site-packages/django/db/models/base.py", line 116, in __new__
    "INSTALLED_APPS." % (module, name)
RuntimeError: Model class core_user.models.User doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
 

单独启动django访问正常。使用uwsgi启动,就报这个错。没辙了

 

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

11条回答 默认 最新

  • 禾乃儿_xiuer 2020-12-11 10:11
    最佳回答

    就是uwsgi代理找不到你model的路径,看看你的配置setting.py里的app配置那块,还有就是你导入model的绝对路径问题

     

    评论
    解决 无用
    打赏 举报
查看更多回答(10条)

相关推荐 更多相似问题