Pycharm How to put multiple apps from Django into the same folder apps

Source: Internet
Author: User
This article mainly describes the Pycharm will be in the Django multiple apps to the same folder application processing method, has a certain reference value, now share to everyone, the need for friends can refer to

To create multiple apps in Django, you need to create an apps file that puts all the apps in the same folder, which is clearer and more prescriptive.

First, in the project file right-click the-–new–python package to create an apps file, drag all the apps into apps,

Pop-up dialog box to search for references and open moved files in editor uncheck, click Confirm, this time run click Run, there will be a run error

In Check_apps_ready raise Appregistrynotready ("apps aren ' t loaded yet.") Django.core.exceptions.AppRegistryNotReady:Apps aren ' t loaded yet.

Right click on the Apps folder – Select Mark Directory as--Select sources root and click Run to run

This time can be used normally in pycharm, but if not in the actual environment of the deployment, you need to include in the setting.py file

Sys.path.insert (0,os.path.join (Base_dir, ' apps ')

This allows for normal use in the actual deployment.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.