简体   繁体   English

整合Django专案首页的最佳方法

[英]Best way to integrate your Django project homepage

What would be considered the best practice for integrating your website's homepage in your Django project? 将网站首页集成到Django项目中的最佳做法是什么?

Should you make a new application, naming it "homepage" and place the view for it in there? 您是否应该制作一个新应用程序,将其命名为“主页”并将其视图放置在其中? Or is it considered a waste of space to create an entire application just for that? 还是仅为此目的创建整个应用程序就浪费了空间? Or should you just stick it somewhere in one of your applications randomly? 还是应该将其随机粘贴在您的应用程序之一中? Or is there some other better option I'm not seeing? 还是我没有看到其他更好的选择?

Along with the homepage, you're going to encounter other things that don't really fit into an application, such as shared utils, base templates, about page, contact page, etc. 除了主页之外,您还将遇到其他应用程序中并不真正适合的事情,例如共享工具,基本模板,关于页面,联系页面等。

For these things it's generally best to put them into an application that is general to the project, I name my general application "main". 对于这些事情,通常最好将它们放入项目通用的应用程序中,我将通用应用程序命名为“ main”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM