appengine网站架构指南?

I've created unmaintainable websites using PHP because it was so easy to do things quick and dirty. I don't want to do the same thing with Python/Django on Google's appengine.

Is there any good architecture references for creating websites using Django and appengine? (E.g. where to put business logic, where to put data access logic, how to cleanly separate the views, how to do unit testing, etc.)

#0

If you decide to not use Django, these hints from Werkzeug team might be interesting. This application structure takes what's best from Django but gives you complete freedom over actual layout (no need to have models.py even if you do not have any model in application...).

#1

Django by its nature will make it harder to put things in the wrong places. That is one of the cool things about the new generation of MVC frameworks, you have to work at it to create a ball of mud.

#2

As already mentioned, by choosing Django, you have already taken a big step in avoiding spaghetti. Django provides you with an MVC framework (Model Template View to be Django specific). Thus, your job now is to study and properly follow the MVC design pattern which Django is guiding you with. Where you place your business logic will depend on your specific application and requirements. In some cases, some business logic is placed closer to the data in the models, and in other times its placed in the controller. Furthermore, GAE doesn't require Django and in some cases GAE's webapp framework should suffice.

推荐文章

如何安全更新实时网站

如何安全更新实时网站

推荐文章

Creating a Plugin for Netflix Security Monkey

Creating a Plugin for Netflix Security Monkey

推荐文章

soap4r自定义头

soap4r自定义头

推荐文章

常用 ElastiCache 使用案例以及 ElastiCache 如何提供帮助

常用 ElastiCache 使用案例以及 ElastiCache 如何提供帮助

推荐文章

在我的ASP.NET应用程序中强制执行许可条款

在我的ASP.NET应用程序中强制执行许可条款

推荐文章

Hibernate在查询后调用实体上的公共方法,为什么?

Hibernate在查询后调用实体上的公共方法,为什么?

推荐文章

Domain Driven Design for Everyone Else

Domain Driven Design for Everyone Else

推荐文章

如何使“选择”上的HTML单选按钮变为粗体?

如何使“选择”上的HTML单选按钮变为粗体?

推荐文章

Oracle 11G单实例安装

Oracle 11G单实例安装

推荐文章

如何访问iframe父元素?

如何访问iframe父元素?

推荐文章

7 Hardest Node.js Interview Questions & Answers

7 Hardest Node.js Interview Questions & Answers

推荐文章

为何Redis要比Memcached好用

为何Redis要比Memcached好用

推荐文章

数据网格颜色更改+c#

数据网格颜色更改+c#

推荐文章

为什么ToDictionary与LINQ to SQL一起使用时会生成编译器错误?

为什么ToDictionary与LINQ to SQL一起使用时会生成编译器错误?

推荐文章

Making the most of Marketo with UI extensions and Lambda functions

Making the most of Marketo with UI extensions and Lambda functions

推荐文章

如何在ASP.NET中存储会话数据?

如何在ASP.NET中存储会话数据?