Using python to develop web application

前端 未结 9 781
小鲜肉
小鲜肉 2021-01-30 07:38

I have been doing some work in python, but that was all for stand alone applications. I\'m curious to know whether any offshoot of python supports web development?

Would

相关标签:
9条回答
  • 2021-01-30 08:00

    If you really don't want to delve into the frameworks - and you should, I heartily recommend Django or Pylons - there's still need to go down the road of CGI. This is a totally out-of-date technology, not to mention slow and inefficient.

    There is a standard way of building Python web applications, and it's called WSGI. If you want to roll your own web app from scratch, this is absolutely the way to go.

    That said, if you're just starting out, really you should go with one of the frameworks.

    0 讨论(0)
  • 2021-01-30 08:04

    There are quite a few web frameworks for python out there, but the only one I've used is Django, and I really like it.

    If you've got a few hours, do the tutorial, I promise you, you'll enjoy it :)

    0 讨论(0)
  • 2021-01-30 08:05

    Python can be used for web development, but there isn't a special language extension or anything in the language that will handle all the HTML generation or that works like PHP.

    It's pretty much run through some sort of interpreter on a web server (CGI, mod_python, etc.).

    I would recommend looking into Python Web Application Frameworks or how to write Python CGI scripts.

    0 讨论(0)
  • 2021-01-30 08:07

    There are a couple of choices for web development. From my experience, your choice will again be dependent on your application. I used django and web.py in production and I am about to deploy an app based on pylons.

    Django hides a lot of choices (comes with its ORM and templating). The documentation is extensive and well-written. There are many reusable app available for django, but you will likely to invest a little time in integrating them seamlessly. One thing mentioned on djangocon 08 was the fact, that there is cool stuff in django, which can't be easily accessed in non-django projects.

    web.py impressed me by its raw simplicity. Before I knew it, I wrote a small app (78 lines quasi-wiki) in it.

    pylons feels like in the middle of both. I can use sqlalchemy and jinja, all in all a pleasant experience for the start.

    0 讨论(0)
  • 2021-01-30 08:14

    As others have mentioned, one of the more prominent python "offshoots" as you call them would be Django. It is a rather powerful framework that allows you to quickly and securely build web applications. The first place to look would be their overview which gives some insight as to what Django does as a framework.

    Going through their tutorial taught me alot about the prominent Model-View-Controler design pattern and how it may be used in a web-development context. I found it a great way to start writing an application that worked and learn by improving it.

    0 讨论(0)
  • 2021-01-30 08:16

    Now that everyone has said Django, I can add my two cents: I would argue that you might learn more by looking at the different components first, before using Django. For web development with Python, you often want 3 components:

    1. Something that takes care of the HTTP stuff (e.g. CherryPy)

    2. A templating language to create your web pages. Mako is very pythonic and works with Cherrpy.

    3. If you get your data from a database, an ORM comes in handy. SQLAlchemy would be an example.

    All the links above have good tutorials. For many real-world use-cases, Django will be a better solution than such a stack as it seamlessly integrates this functionality (and more). And if you need a CMS, Django is your best bet short of Zope. Nevertheless, to get a good grasp of what's going on, a stack of loosely coupled programs might be better. Django hides a lot of the details.

    0 讨论(0)
提交回复
热议问题