pycharm How to put multiple apps in Django into the same folder apps

不言
Release: 2018-06-01 14:49:28
Original
2546 people have browsed it

This article mainly introduces how pycharm puts multiple apps in Django into the same folder apps. It has a certain reference value. Now I share it with you. Friends in need can refer to it

If you need to create multiple apps in django, you need to create an apps file and put all the apps in the same folder. This is clearer and looks more standardized.

First of all, Right-click the project file--new-python package to create an apps file, drag all apps into apps,

will pop up a dialog box and select search for references and Uncheck open moved files in editor, click Confirm. At this time, click run, and a running error will appear

in check_apps_ready
 raise AppRegistryNotReady("Apps aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
Copy after login

At this time, you need to right the apps folder Click – select mark directory as – select sources root, then click run, and it will run normally

At this time, it can basically be used normally in pycharm, but if deployed This cannot be the case in the actual environment. You need to add

sys.path.insert(0,os.path.join(BASE_DIR,'apps'))
Copy after login

to the setting.py file so that it can be used normally in actual deployment.

The above is the detailed content of pycharm How to put multiple apps in Django into the same folder apps. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template