如何使用 Python 开发 Web 应用程序?
我正在创建一个学校管理系统,用于处理教师和学生的文件上传和下载。此外,还会有大量的数据库写入和读取(例如,学生正在学习哪些课程、学生的成绩等)。
我希望在前端使用 AJAX 模型使用 python 更新动态网页。
在后端,我想使用 python 进行文件处理,读取数据库以向用户显示其内容,当用户在网络应用程序和 memcache 上更新其内容时数据库写入。
我使用的堆栈是...
CentOS + Hadoop + Hypertable + Python
我目前正在浏览 Pyramid 文档,在阅读了几章之后,我不明白金字塔如何帮助我完成我在 PHP 中可以做的事情,如果它确实做到了这一点,为什么这么复杂?
金字塔是正确的工具吗,还是我应该使用web2py?
如果金字塔是最好的工具,我在哪里可以看到金字塔中构建的复杂应用程序的一些示例代码。当我阅读别人的代码时,我往往能最好地理解。
由于不灵活而无法使用 Django
I am creating a school management system that handles file uploads and downloads from teachers and students. Furthermore, there will be a large amount of database writes and reads (e.g. which classes a student is taking, what the student's grades are etc.)
I want dynamic web pages updated with python using an AJAX model on the front end.
On the back end I want to use python for file handling, database reads to show user their content, database writes when a user updates his/her content on the web app and memcache.
The stack I am using is...
CentOS + Hadoop + Hypertable + Python
I am currently going through the Pyramid docs and after going past a few chapters, I don't see how pyramid helps me accomplish what I can do in PHP, and if it does do this, why so complicated?
Is pyramid the right tool, or should I be using web2py?
If pyramid is the best tool, where can I see some sample code of a complex application built in pyramid. I tend to understand best when reading other's code.
Django cannot be used due to inflexibility
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
像 Pyramid 这样的 Web 框架不是像 PHP 这样的 Web 框架。它们是不同的。
复杂性是“经验”的问题。如果您有 PHP 经验,Python 似乎很复杂。如果您有 RoR 经验,PHP 似乎很复杂。一切新事物似乎都很复杂。
Python 有十几个左右功能各异的 Web 框架。它们都不像 PHP。零。它们都会有所不同(并且显得很复杂)。
因此,如果您不喜欢的话。继续前行。有很多选择。继续尝试不同的。
提出具体问题。 “我不明白金字塔如何帮助我完成我在 PHP 中可以做的事情”太模糊,无法进一步讨论。如果您想了解特定的事情,请搜索该特定问题(可能已经有人问过)。如果您没有找到任何内容,请提出特定问题。代码示例提供帮助。
A web framework like Pyramid is not a web framework like PHP. They're different.
Complexity is a matter of "experience". If you're experienced with PHP, Python seems complex. If your experienced with RoR, PHP seems complex. Everything that's new seems complex.
Python has a dozen or so web frameworks of varying capabilities. None of them will look like PHP. Zero. They'll all be different (and appear complex).
Consequently, if you don't like one. Move on. There are a lot of choices. Keep trying different ones.
Ask specific questions. "I don't see how pyramid helps me accomplish what I can do in PHP" is too vague to discuss further. If there's a specific thing you want to know about, search for that specific question (it's probably already been asked). If you don't find anything, ask the specific question. Code samples help.
我强烈建议您使用 Django。
https://www.djangoproject.com/
Django 是完成此类项目的好方法,并且文档非常出色。有一本免费的书,名为 The Django Book,您可以在线阅读。
http://www.djangobook.com/
这本书已经过时了几年。我没有关注 Django,但我很确定这本书仍然有用。使用本书来学习概念,并使用实际的 Django 文档来查找细节。
I highly recommend you use Django.
https://www.djangoproject.com/
Django is a great way to do a project like this, and the documentation is outstanding. There is a free book, called The Django Book, which you can read online.
http://www.djangobook.com/
This book is a few years out of date. I haven't been keeping up with Django but I am pretty sure that the book will still be useful. Use the book to learn the concepts, and use the actual Django documentation to look up specifics.
我在 Django 方面运气很好,它有很好的文档,并且有一些示例可以完全按照您的方式进行操作
I've had some great luck with Django, its pretty well documented and has examples that do exactly what you seem to do