Can I use a directory to contains a couples app directory?

99封情书 提交于 2019-12-13 03:53:24

问题


Can I use a directory to contains a couples app directory? I mean, my project is very large, and there are many apps in my project. such as apps about admin user, apps about normal user, apps about frontend, apps about ...

So, my project is very clutter, I want to use a group directory to wrap the related apps into it.

I don't know whether this idea is feasible. some friend can help me with this? is there should take care of some other things?

The snapshot red framework is a group apps. I want to group them, who can help me with this?


回答1:


I assume that probably you are using one of the latest versions of Django.

In my case I like to create a folder called apps to keep the project more organized.

This is my project structure example:

and then I am doing this in the settings.py file:

BASE_DIR = os.path.dirname(os.path.abspath(__file__))
PARENT_DIR = os.path.abspath(os.path.join(BASE_DIR, os.pardir))
sys.path.insert(0, os.path.join(PARENT_DIR, 'apps'))

So, I think you could do something similar creating multiple folders to organize your custom apps.

I hope it make sense.



来源:https://stackoverflow.com/questions/47323242/can-i-use-a-directory-to-contains-a-couples-app-directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!