我可以使用目录包含情侣应用目录吗? [英] Can I use a directory to contains a couples app directory?

查看:52
本文介绍了我可以使用目录包含情侣应用目录吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用目录包含情侣应用目录吗?我的意思是,我的项目很大,并且我的项目中有很多应用程序.例如关于管理员用户的应用程序,关于普通用户的应用程序,关于前端的应用程序,关于...的应用程序

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?

推荐答案

我假设您正在使用的是Django的最新版本.

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

就我而言,我想创建一个名为apps的文件夹,以使项目更井井有条.

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

这是我的项目结构示例:

This is my project structure example:

然后在settings.py文件中执行此操作:

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.

我希望这是有道理的.

这篇关于我可以使用目录包含情侣应用目录吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆