官术网_书友最值得收藏!

Why Django?

Every web application is different, like a piece of handcrafted furniture. You will rarely find a mass-produced one meeting all your needs perfectly. Even if you start with a basic requirement, such as a blog or a social network, your needs will slowly grow, and you can easily end up with a lot of half-baked solutions duct-taped onto a once-simple cookie cutter solution.

This is why web frameworks such as Django or Rails have become extremely popular. Frameworks speed up development and have all the best practices baked in. However, they are also flexible enough to give you access to just enough plumbing for the job. Today, web frameworks are ubiquitous and most programming languages have at least one end-to-end framework similar to Django.

Python probably has more web frameworks than most programming languages. A quick look at PyPi (Python Package Index) brings up an amazing 13,021 packages related to frameworks. For Django, the total is 5,467 packages.

The Python wiki lists over 54 active web frameworks with the most popular ones being Django, Flask, Pyramid, and Zope. Python also has a wide diversity in frameworks. The compact Bottle micro web-framework is just one Python file that has no dependencies and is surprisingly capable of creating a simple web application.

Despite these abundant options, Django has emerged as a big favorite by a wide margin. Djangosites.org lists over 4,700 sites written in Django, including famous success stories such as Instagram, Pinterest, and Disqus.

As the official description says, Django (https://djangoproject.com) is a high-level Python web framework that encourages rapid development and clean, pragmatic design. In other words, it is a complete web framework with batteries included, just like Python.

The out-of-the-box admin interface, one of Django's unique features, is extremely helpful for early data entry and testing. Django's documentation has been praised for being extremely well-written for an open source project.

Finally, Django has been battle-tested in several high traffic websites. It has an exceptionally sharp focus on security with protection against common attacks such as Cross-site scripting (XSS) and Cross-site request forgery (CSRF).

Although in theory, you can use Django to build any kind of web application, it might not be the best for every use case. For example, to build a real-time interface for web-based chat, you might want to use Tornado, while the rest of your web app can still be done in Django. Choose the right tool for the job.

Some of the built-in features, such as the admin interface, might sound odd if you are used to other web frameworks. To understand the design of Django, let's find out how it came into being.

主站蜘蛛池模板: 海林市| 安新县| 新乐市| 晋宁县| 德江县| 阳信县| 潼南县| 佛山市| 枝江市| 榆树市| 临沂市| 武义县| 且末县| 钦州市| 杭州市| 鄂州市| 沙坪坝区| 延津县| 旬邑县| 会泽县| 西昌市| 敦煌市| 运城市| 四平市| 巴楚县| 桐梓县| 长丰县| 瓦房店市| 穆棱市| 日土县| 林周县| 辉南县| 山阳县| 朔州市| 龙井市| 石家庄市| 奇台县| 喀喇| 乌审旗| 饶平县| 怀安县|