我在Google App Engine中启动了一个应用程序,就在它出现的时候,用它来玩玩技术,并从事一个我已经考虑了很长时间但从未开始的宠物项目。结果是BowlSK。然而,随着它的发展和特性的增加,组织工作变得非常困难-主要是因为这是我的第一个python项目,在我开始工作之前我对它一无所知。
我所拥有的:
的.html模板的
示例:
http://www.bowlsk.com/映射到HomePage (默认包),模板位于"index.html“
http://www.bowlsk.com/games/view-series.html?series=7130映射到ViewSeriesPage (同样是默认包),模板位于“ViewSeriesPage/view-Series.html”
真的很恶心。我该如何重构?我有两个想法:
索引主文件夹包含: appdef、
- Subfolder for code. Does this have to be my first package?
- Subfolder for templates. Folder heirarchy would match package heirarchy
- Individual subfolders for css, images, js, etc.
- Subfolder for code + templates. This way I have the handler class right next to the template, because in this stage, I'm adding lots of features, so modifications to one mean modifications to the other. Again, do I have to have this folder name be the first package name for my classes? I'd like the folder to be "src", but I don't want my classes to be "src.WhateverPage"
有没有最佳实践?我只是简单地开始尝试这些东西,看看哪个看起来更好,但是pyDev的重构支持似乎不能很好地处理包移动,所以让所有这些东西重新工作起来可能是一项不平凡的任务。
https://stackoverflow.com/questions/48458
复制相似问题