pycharm 将django中多个app放到同个文件夹apps的处理方法 在django中需要创建多个app,这个就需要创建一个apps文件,把所有的app放到同个文件夹,这个比较清楚,看起来也比较规范 首先在项目文件右击—–new–python package创建一个apps文件,把所有的app拖入到apps, 弹出对话框把search for references和open moved files in editor不勾选,点击确认,这个时候运行点击run,会出现运行错误 in check_apps_ready raise AppRegistryNotReady("Apps aren't loaded yet.") django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet. 这时候需要对apps的文件夹右击–选择mark directory as—-选择sources root,再点击run,就可以正常运行了 这个时候基本可以在pycharm中正常使用,但是如果部署的实际环境中就不能这样,需要在setting.py文件中加入 sys.path.insert(0,os.path.join(BASE_DIR,'apps')) 这样就可以在实际部署中正常使用。 以上这篇pycharm 将django中多个app放到同个文件夹apps的处理方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持中文源码网。