Django 可重用应用程序
我遇到了许多关于 Django 项目和可重用应用程序之间差异的资源,最突出的是 DjangoCon 谈话 和 Pinax 项目。
然而,作为一个新手,编写自己的项目和可重用的软件似乎有点具有挑战性。我不太明白模型如何去哪里(以及应用程序如何变得灵活和宽容)、模板去哪里以及不同的应用程序如何融合在一起。
是否有关于使用可重用应用程序创建项目的教程?良好实践页面?最理想的是,一个具有自己的应用程序的示例项目(而不是依赖于外部应用程序)?
我的目标是了解项目的架构以及应用程序之间的交互,而不仅仅是构建可重用的应用程序。我在网上遇到的大多数教程都是关于构建可重用的应用程序,或构建一个简单的单一博客应用程序,该应用程序仅对内置或 django.contrib 模块具有外部依赖关系。
I came across many resources about the difference between Django projects and reusable apps, most prominently the DjangoCon talk, and Pinax Project.
However, being a newbie, writing my own projects and reusable software seems to a bit challenging. I don't quite understand how where models go (and how apps can be flexible and permissive), where the templates go, and how the different apps mesh together.
Are there any tutorials on creating a project with reusable apps? Good practices page? Most preferably, a sample project with its own apps (rather than depend on external apps)?
I am aiming to understand the architecture of a project and interaction between apps rather than just building reusable apps. Most tutorials I came across online are about building a reusable app, or building a simple monothelic blog app that only has external dependencies on builtin or django.contrib modules.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
James Bennett 的 实用 Django 项目 很好地涵盖了这些主题甚至包括专门关于“编写可重用 Django 应用程序”的一章,其中介绍了将书中的示例项目之一拆分为自己的应用程序的示例。
James Bennett's Practical Django Projects does a pretty good job of covering those topics in general and even includes a chapter specifically on "Writing Reusable Django Applications" that goes through an example of splitting one of the example projects in the book out into its own app.
您可以观看视频 (DjangoCon 2008:可重用应用程序) - http://www.youtube。 com/watch?v=A-S0tqpPga4 并了解如何使用它。
Google、djangosnippets、git 等有很多可重用的应用程序。最流行的是:
阅读示例文档并节省您的开发时间。祝你好运!
You can watch video (DjangoCon 2008: Reusable Apps) - http://www.youtube.com/watch?v=A-S0tqpPga4 and get the idea, how to use it.
There are a lot of reusapbe apps at Google, djangosnippets, git, etc. Most popular:
Read samples docs and save your dev-time. Good luck!
如果您想查看“可重用应用程序相互交互的示例项目”,没有比下载 Pinax 更好的地方了,克隆他们的示例项目之一(只需遵循文档)并仔细阅读代码。
If you want to see "sample projects with reusable apps interacting with each other," there's no better place to go than downloading Pinax, cloning one of their sample projects (just follow the docs) and reading through the code carefully.