我应该使用什么 - Mako 还是 Django?
我正在制作一个网站,当电影或电脑游戏发布时,该网站会向用户发送邮件。它并不太复杂 - 用户可以注册、选择电影/音乐或流派并保存设置。当电影/音乐发布时 - 它会向用户发送邮件。还有一些其他功能,但这就是要点。
现在,我已经使用 Python 了一段时间,但主要是在控制台应用程序领域。对于 Web:我应该使用什么,Web 框架 Django 还是模板引擎 Mako?
我似乎无法在两者之间做出决定。 :(
谢谢
I'm making a website that mail users when a movie or a pc game has released. It isn't too complex - users can sign up, choose movies/music or a genre and save the settings. When the movie/music is released - it mails the user. Some other functionality too but this is the jist.
Now, I've been working with Python for a bit but mainly in the area of console apps. For web: what should I use, the web framework Django or the templating engine Mako?
I can't seem to decide between the two. :(
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
问自己这个问题:你从这个项目中得到了什么?你想学什么?
如果您想以困难的方式了解 Web 服务器的具体细节:根据需要使用 Mako 和其他有用的构建块构建您自己的 Web 框架。正如 @pulegium 所说,您必须选择如何处理 HTTP 层和数据库层。
如果您想快速启动并运行网站:请使用 Django。它有详细的文档记录,并且是一个一体化的解决方案。我发现它的管理界面是一个真正的杀手。 Django 不提供部署工具;您必须编写脚本或使用部署解决方案来更新服务器上的代码。
如果你想变得更懒:使用 Google App Engine。 (默认遵守 BigTable 的规则,这与流行的关系数据库系统有很大不同。)GAE 负责 Web 应用程序的安装和部署、日志记录、版本控制以及运行时需要处理的其他内容一个网站。您还可以在 GAE 上使用 Django。
Ask yourself this question: What are you getting out of this project? What do you want to learn?
If you want to know the nuts and bolts of a web server the hard way: concoct your own web framework using Mako and other useful building blocks as needed. As @pulegium says, you'll have to choose how to handle the HTTP layer and database layer.
If you want to get a website up and running quickly: do use Django. It's well documented and is an all-in-one solution. I've found its admin interface to be a real killer. What Django doesn't provide is tools for deployment; you'll have to write a script or use a deployment solution to update your code on the server.
If you want to be more lazy: use Google App Engine. (With the silent agreement to follow the rules of the BigTable, which is quite different from popular relational database systems.) GAE takes care of installation and deployment of your web app, logging, versioning and other stuffs you need to take care of when running a website. You can also use Django on GAE.
姜戈。因为它会照顾所有细节(url 映射、请求对象处理等),并且还向您隐藏数据库访问。如果您愿意,您可以使用 SQLite DB,因此不需要 MySQL 或其他“适当的”数据库。如果您只使用模板引擎,则必须自己处理 HTTP 层。还有数据库的东西。
Django. Because it takes care for all bits and pieces (url mapping, request object handling etc) and hides the DB access from you as well. If you want you can use SQLite DB so no need for MysQL or other "proper" DBs. If you were using just template engine you'd have to take care of HTTP layer yourself. And the DB stuff as well.
我已经使用 mako 一段时间了,并且还尝试在 google appengine 中掌握 django。
如果您是 python 专家...绝对选择 Mako。我发现 django 令人沮丧,因为它的语法不允许我编写非常好的 pythonic 代码。我将在为时已晚之前将 Mako 放入我的 appengine 项目中!
I have used mako for some time and have also tried to get to grips with django in google appengine.
If you are a python whizz... definitely opt for Mako. I'm finding django frustrating as the syntax doesn't allow me to do really nice pythonic code. I'm going to drop Mako into my appengine project before it's too late!