Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Update Pyramid section to be descriptive of what the framework is. #692

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 28 additions & 15 deletions 43 docs/scenarios/web.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ project as-is, or customized to fit your needs.
There are annual Django conferences `in the United States
<http://djangocon.us>`_ and `in Europe <http://djangocon.eu>`_.

The majority of new Python web applications today are built with Django.
Django is a popular framework and you will find many sites and projects built
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this PR is to be accepted, this change will need to be removed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed because it creates bias for the Python webframework. Django might be popular but it is anything but certain that most web application are built with Django. In fact Python has about 35 web frameworks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this PR is to be accepted, this change will need to be removed.

with on it.

Flask
-----
Expand All @@ -85,9 +86,8 @@ For those that do, there are many
`Extensions <http://flask.pocoo.org/extensions/>`_ available that may
suit your needs. Or, you can easily use any library you want yourself!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this PR is to be accepted, this change will need to be removed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is Flask the default? What makes that statement factually true?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't agree that this change would need to be removed. Why is Flask a "default" choice for any Python web application that isn't a good fit for Django? What exactly about Flask makes it a "default" choice? A "default" choice by whose standards?

This could be reworded as "Flask is a good choice for Python web applications that don't require all of Django's bells and whistles", and it wouldn't exclude every single other framework to the exclusion of Django/Flask.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bertjwregeer that rewording isn't bad. However, the sentence is intended to do exactly what you suggest.


If this PR is to be accepted, this change will need to be removed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I misunderstanding you here? If the intent of the sentence is excluding everything but Flask and Django, why even mention Pyramid?

Also, from Flask docs: "However Flask is just not designed for large applications or asynchronous servers. Flask wants to make it quick and easy to write a traditional web application." Are you seriously saying that Django is the only option for large applications? Or are you simply not in agreement with the Flask docs?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cguardia He mentioned that here:

https://github.com/kennethreitz/python-guide/pull/692#issuecomment-203679472

Let me quote:

This page really only needs to mention Django and Flask. I added Pyramid to be nice to the Pyramid community, [...]

So he wants to be nice to the Pyramid community, yet the entire thing reads like "Pyramid is not used so you shouldn't either". A backhanded compliment if you will.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section's purpose is to recommend the following:

  • Almost everyone uses Django. Here's what it's great for.
  • If you don't want to use Django, use Flask. It's fantastic.
  • Here's a few others (e.g. pyramid, tornado) for the unlikely event that you're still looking for something else.

As mentioned elsewhere on this page, Pyramid could easily be left out of this document, as could tornado (as web2py is). However, I think they are both worthy of mention, with attention brought towards the fact of why they wouldn't otherwise be included.

Flask is default choice for any Python web application that isn't a good
fit for Django.

Flask is a common choice over Django because it is for developers who like
minimalistic approach.

Tornado
--------
Expand All @@ -102,14 +102,27 @@ I do not recommend using Tornado unless you think you need it.
Pyramid
--------

`Pyramid <http://www.pylonsproject.org/>`_ is a lot like Django, except
with a heavier focus on modularity. It comes with a smaller number of
libraries ("batteries") built-in, and encourages users to extend its
base functionality.
`Pyramid <http://www.pylonsproject.org/>`_ lies somewhere between a big
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This paragraph existed in the guide for a while, and was re-written as the original paragraph you are suggesting to replace. What exact information does this pice of text provide that the version your are suggestion be replaced does not? I would prefer to add an additional sentence instead of using this block.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pyramid is not at all like Django. It does not make sense to make that comparisson. Django is monolithic, Pyramid is anything but. Django tightly couple it's ORM, its Models, Admin and Form management. Pyramid does none of that and has no opinions about the Resources it uses with only one of them being SQLAlchemy,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggesting it's a lot like Django does a huge disservice to anyone reading the guide. Unlike Django Pyramid is not kitchen sink included. We allow users to pick and chose from the vast Python eco-system so that they can use best of breed tools without requiring explicit framework support.

Pyramid also follows Python packaging standards more closely, which leads to better code re-use across projects, and can work a lot like Flask or Django, and as projects grow Pyramid more easily grows with them, so start Flask like, and over time grow to use the Django like functionality, no rewrites required.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats what "a heavier focus on modularity" is intended to address. Let's focus on rewording that sentence, then.

framework like Django and the microframeworks. Instead, it practices a modular
approach where you can specify include any libraries as needed which provides a
great deal of extensibility. By contrast to Django which includes everything in
one package (though you might not need to use it all).

Notably, Pyramid provides a lot of adapters to existing libraries. For example,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole paragraph should be able to be reduced to a sentence or two.

it supports nearly all the templating languages Python has to offer and
it's modular approach allows you use more then one. Same is true of it's
database support. You can use SQLAlchemy, Mongo, ZoDB all in the same
application without much trouble.

Additionally, Pyramid has a huge focus on complete
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This paragraph is needless. Trying to keep these sections succinct.

`documentation <http://docs.pylonsproject.org/en/latest/docs/pyramid.html>`__
and boast 100% unittest coverage.

**Support** can also be found in the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This paragraph is needless. Trying to keep these sections succinct.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It the same size as Django and Flask sections actually. Reword it as you wish.

`documentation <http://docs.pylonsproject.org/en/latest/index.html#support-desc>`__.

Pyramid does not have a large user base, unlike Django and Flask. It's a
capable framework, but not a very popular choice for new Python web
applications today.
Pyramid is a good choice for developers who like flexibility of their
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's important to note here that Pyramid's userbase and community is significantly smaller than the other frameworks mentioned. Code quality is far from the the only qualifier when selecting a web framework.

application including what they need and nothing extra.

Web Servers
:::::::::::
Expand Down Expand Up @@ -452,16 +465,16 @@ you can replace it with a more terse and readable syntax that uses the pattern
But keep in mind that the full `<span tal:replace="expression">Default Text</span>`
syntax also allows for default content in the unrendered template.

Being from the Pyramid world, Chameleon is not widely used.
Integration with Chameleon is available for a number of popular web frameworks
including Plone/Zope2, Pyramid, Django and Grok.
See: https://chameleon.readthedocs.org/en/latest/integration.html
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not proper link syntax for this project. This link is also generally needless, as long as we're linking to the overall documentation.


Mako
----

`Mako <http://www.makotemplates.org/>`_ is a template language that compiles to Python
for maximum performance. Its syntax and api is borrowed from the best parts of other
templating languages like Django and Jinja2 templates. It is the default template
language included with the `Pylons and Pyramid <http://www.pylonsproject.org/>`_ web
frameworks.
templating languages like Django and Jinja2 templates.

An example template in Mako looks like:

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.