My first web app (Python): use CGI, or a framework like Django?

后端 未结 5 1794
野性不改
野性不改 2021-02-05 18:11

I don’t want to burden you all with the details, but basically I’m a 2nd year compsci student with no Web dev experience.

Basically I want to create a small “web app” t

5条回答
  •  时光取名叫无心
    2021-02-05 18:28

    It appears most python web development seems to be done by frameworks these days. There are a couple reasons for this:

    1. a plethora of mature tools. Django has built in user auth, built in database management, built in sessions, built in just about everything ORM which lets you seamlessly supports a couple databases.

    2. Built in webservers. The larger python frameworks like django and pylons have built in webservers. Django has a very simple webserver python manage.py startserver (that simple) That makes it extremely easy to create and debug applications. It is single threaded so dropping a debugger into it is painless

    3. Huge communities. If you have a django question it will be answered very quickly the so community is huge.

    The django tutorial will introduce you to all the major aspects of development. It is only 4 pages and you will be able to get your app going a lot simpler than having to read, learn and fiddle with an apache setup. https://docs.djangoproject.com/en/dev/intro/tutorial01/

    Although django for right now might be overkill if your app is just going to be 1 form and a script to process it. Because of its seamless testing framework it is quite easy to grow any project. I have never used flask or bottle or the other microframeworks, but I would keep in mind where your project will be in the future.

    As for where django fits into this, it is a full stack framework encompassing presentation (templates), data management (server orm), authentication, middleware, forms ... everything necessary to create a completely inclusive web application. Django and almost all other python frameworks implement the wsgi standard. It is an interface that allows for interoperation between webservers. http://en.wikipedia.org/wiki/Web_Server_Gateway_Interface it is pretty dry and you will never have to interface it directly. That is what these frameworks do under the hood.

提交回复
热议问题