Summary of some concepts of Python Web programming

Source: Internet
Author: User

I recently read some Python Web frameworks. The web programming of Python is a battle, and the concepts and related "owners" are not as clear as they are in java, I simply make a summary based on my own understanding. I think these concepts should be generic or useful for web programming in other languages.

1. functions that traditional Web servers should possess

◆ Listen to a local port and accept the HTTP request from the client

◆ Handle HTTP requests by yourself or call Other gateways to process requests

◆ Return the processing result to the client based on the HTTP protocol

◆ Other support for HTTP/HTTPS

2. functions that Web Gateway should possess

◆ Gateway does not need to process HTTP protocol details

◆ Gateway accepts environment variables and call parameters as its own Variables

◆ Gateway returns the call result according to the call rule

3. Common functions of Web Framework

Few frameworks complete all these tasks. A general framework usually provides basic functions or specializes in one function. The rest of the functions are implemented by ourselves or we can combine multiple frameworks. Django is said to be very competent, big bag, but the demand is ever-changing, so it is often necessary for programmers to combine other specialized frameworks to complete specific tasks. SSH in java is the truth.

1. Session (Cookie)

2. Authentication/Authorization: AA is a very common function and should be abstracted into the framework for implementation. do not duplicate this hard wheel.

3. Template: templates greatly increase readability and maintainability. A simple and easy to use Template is very important.

4. MVC: MVC is a habit.

5. Menu: Menu navigation is also a common module, preferably implemented by the framework.

6. Pagination: Paging is also a very common function. It should be implemented in advance when developing a specific project.

7. i18n: the framework should provide international solutions

8. DB/ORM: access to databases is common in current projects. Therefore, a good framework should provide simple DB access interfaces to provide better ORM.

9. Workflow?

10. Web Service?

11. Batch Job

12. Verification code?

Others

4. Common Web Application functions

1. login/logout/Account maintenance: Based on the Session and AA functions provided by the Web server or Web framework, login/logout/Account maintenance can be created and logged out based on users.

2. Query/View/Create/Delete/Undelete/Import/: add, Delete, modify, Query, and Import data based on DB/ORM and Pagination.

3. Front verification/Front control (JavaScript): Almost all Front-end verification uses JavaScript. You can consider using a popular JavaScript framework.

4. Back End verification: backend verification

5. theme/UI (CSS): Everyone likes beautiful pages. Unified themes and interfaces are required for each project.

6. Parameter : The project has some system parameters. The page should be provided for the Administrator to maintain these parameters.

7. Code: Code Mapping is the mapping of male M and female F. The page should be provided for the Administrator to maintain these codes.

8. Upload/Download: Upload and Download files. This should be the common module of the COST project.

9. Report (Excel, PDF): Report, which can be generated by code, Report, or third-party Report framework

10. Audit trail: Anyone who performs any operation should have audit. This function varies with each project.

11. Backup/Recovery: fault Recovery?

5. What is Web Middleware?

What is Web Middleware? This guy is installed like a Web Application for the Web Server, and this guy is installed like a Web Server for the Web Application. That is to say, for Web Server, Web Middleware assumes the role of Web Application, and for Web Application, Web Middleware assumes the role of Web Server.

I personally think that many Python Web frameworks are Middleware. for traditional Web servers, playing the role of WSGI-based Application, for our developers, they also play the role of Web Server/Web Framework.

Original article: http://www.iteye.com/topic/1114128

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.