python 路径或项目中存在多个 django-apps
我有一个大小合适的 django 项目,当我最初构建它时,我将所有应用程序保存在项目根目录下的 apps
文件夹中。 project/apps/articles
、project/apps/video
等。
过了一段时间,我决定转向最佳实践并使它们更具可重用性,因此我将它们移到了自己单独的位置然后应用程序将它们符号链接到我的 python 路径。每个都有自己的 git 存储库。
我遇到的唯一问题是它们都在自己的仓库中,这很烦人。这种情况经常发生,我们决定更改许多应用程序(大约 7-8 个非第三方应用程序)的某些内容。就像更改管理界面中某些内容的名称或合并诸如“南”之类的内容。我必须处理每个存储库、提交、推送,然后让临时服务器拉取,然后如果一切正常,则将每个应用程序拉入生产环境。只是越来越累了。
自从我编写了所有这些应用程序以来,它们都与该网站一起成长,因此一直有很多变化。我希望一旦一切开始稳定,也许这个问题就会消失,因为大规模的快速变化不会发生那么多。
还有其他人在处理这个问题吗?我已经合并了 pip/freeze 和需求文件,并使用 Fabric 来尝试帮助进行一些重复,虽然它有助于它变得累人。
其他人也是这样做的吗?将自己的应用程序(这可能会对其他人有用)保留为可移植的独立应用程序。我只想将它们拉入主项目以加快我的工作流程。
任何想法表示赞赏。也许我只是懒惰。
I have a decent sized django project and when I originally built it I kept all the apps in an apps
folder under the project root. project/apps/articles
, project/apps/video
etc.
After a while I decided to move to best practices and make them more reusable so I moved them into their own separate apps then symlink'd them to my python path. each one is its own git repo as well.
The only problem I run into is the annoyance of them being all in their own repo. This happens quite often that we decide to change something across many of the apps (roughly 7-8 non-3rd party apps). Like changing the name of something in the admin interface or incorporating something like south. I have to deal with each repo, commit, push, then have staging servers pull, then if all ok then have each app get pulled into production. It's just getting tiring.
Since I wrote all these apps they are all growing togeter with the site so there are many changes all the time. I hoping once everything starts to stablize maybe this issue will just go away since massive rapid changes wont be happening as much.
Is anyone else dealing with this. I've incorporated pip/freeze and requirements files and using fabric to try to help with some of the repitition and while it helps its just getting tiring.
Is this the way other people are doing this as well? Keeping their own apps (which will probably way day be useful to other people) as portatable independent apps. I'm thinging of just pulling them in under the main project to speed up my work flow.
Any thoughts are appreciated. Maybe I'm just being lazy.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你应该看看 git 子模块。我的 django 应用程序位于 apps 子文件夹中,其中一些是 git 子模块。我的主项目绑定到每个子模块存储库中的特定提交,因此它可以单独发展,但也可以轻松更新:
you should look at git submodules. I have my django apps in an apps subfolder, and some of them are git submodules. My main project is bound to a specific commit in each submodule repo so it can evolve separately but can be also be updated easyly :