Less annoying gender neutral forms
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Armin Ronacher · committed by Armin Ronacher · parent d3b0edb · Browse files · 8 files·+12 added−12 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
8 files+12 added−12 removed
- other:+12 added−12 removed
Provenance
- Commit
22d468e- Tree
08dfeda- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent
d3b0edb
8 files changed+12 added−12 removed
modified:docs/patterns/errorpages.rst+2 added-2 removed
22 unmodified lines23 24 *403 Forbidden*25 If you have some kind of access control on your website, you will have26 to send a 403 code for disallowed resources. So make sure the user27- is not lost when he or she tries to access a forbidden resource.27+ is not lost when they try to access a forbidden resource.28 29 *410 Gone*30 Did you know that there the "404 Not Found" has a brother named "41031 Gone"? Few people actually implement that, but the idea is that32 resources that previously existed and got deleted answer with 41033 instead of 404. If you are not deleting documents permanently from34 the database but just mark them as deleted, do the user a favour and35- use the 410 code instead and display a message that what he or she was35+ use the 410 code instead and display a message that what they were36 looking for was deleted for all eternity.37 38 *500 Internal Server Error*39 Usually happens on programming errors or if the server is overloaded.38 unmodified linesmodified:docs/patterns/flashing.rst+1 added-1 removed
2 unmodified lines3 Message Flashing4 ================5 6 Good applications and user interfaces are all about feedback. If the user7-does not get enough feedback he or she will probably end up hating the7+does not get enough feedback they will probably end up hating the8 application. Flask provides a really simple way to give feedback to a9 user with the flashing system. The flashing system basically makes it10 possible to record a message at the end of a request and access it next11 request and only next request. This is usually combined with a layout108 unmodified linesmodified:docs/patterns/viewdecorators.rst+1 added-1 removed
6 unmodified lines7 functionality to one or more functions. The :meth:`~flask.Flask.route`8 decorator is the one you probably used already. But there are use cases9 for implementing your own decorator. For instance, imagine you have a10 view that should only be used by people that are logged in to. If a user11-goes to the site and is not logged in, he or she should be redirected to the11+goes to the site and is not logged in, they should be redirected to the12 login page. This is a good example of a use case where a decorator is an13 excellent solution.14 15 Login Required Decorator153 unmodified linesmodified:docs/tutorial/introduction.rst+1 added-1 removed
6 unmodified lines7 less web-2.0-ish name ;) Basically we want it to do the following things:8 9 1. let the user sign in and out with credentials specified in the10 configuration. Only one user is supported.11-2. when the user is logged in he or she can add new entries to the page11+2. when the user is logged in they can add new entries to the page12 consisting of a text-only title and some HTML for the text. This HTML13 is not sanitized because we trust the user here.14 3. the page shows all entries so far in reverse order (newest on top) and15 the user can add new ones from there if logged in.18 unmodified linesmodified:docs/tutorial/views.rst+1 added-1 removed
27 unmodified lines28 29 Add New Entry30 -------------31 32-This view lets the user add new entries if he or she is logged in. This only32+This view lets the user add new entries if they are logged in. This only33 responds to `POST` requests, the actual form is shown on the34 `show_entries` page. If everything worked out well we will35 :func:`~flask.flash` an information message to the next request and36 redirect back to the `show_entries` page::62 unmodified linesmodified:docs/api.rst+1 added-1 removed
154 unmodified lines155 If you have the :attr:`Flask.secret_key` set you can use sessions in Flask156 applications. A session basically makes it possible to remember157 information from one request to another. The way Flask does this is by158 using a signed cookie. So the user can look at the session contents, but159-not modify it unless he or she knows the secret key, so make sure to set that159+not modify it unless they know the secret key, so make sure to set that160 to something complex and unguessable.161 162 To access the current session you can use the :class:`session` object:163 265 unmodified linesmodified:docs/quickstart.rst+4 added-4 removed
124 unmodified lines125 Modern web applications have beautiful URLs. This helps people remember126 the URLs which is especially handy for applications that are used from127 mobile devices with slower network connections. If the user can directly128 go to the desired page without having to hit the index page it is more129-likely he or she will like the page and come back next time.129+likely they will like the page and come back next time.130 131 As you have seen above, the :meth:`~flask.Flask.route` decorator is used132 to bind a function to a URL. Here are some basic examples::133 479 unmodified lines613 abort(401)614 this_is_never_executed()615 616 This is a rather pointless example because a user will be redirected from617-the index to a page he or she cannot access (401 means access denied) but it617+the index to a page they cannot access (401 means access denied) but it618 shows how that works.619 620 By default a black and white error page is shown for each error code. If621 you want to customize the error page, you can use the18 unmodified lines640 :class:`~flask.session` that allows you to store information specific to a641 user from one request to the next. This is implemented on top of cookies642 for you and signs the cookies cryptographically. What this means is that643 the user could look at the contents of your cookie but not modify it,644-unless he or she knows the secret key used for signing.644+unless they know the secret key used for signing.645 646 In order to use sessions you have to set a secret key. Here is how647 sessions work::648 47 unmodified lines696 Message Flashing697 ----------------698 699 Good applications and user interfaces are all about feedback. If the user700-does not get enough feedback he or she will probably end up hating the700+does not get enough feedback they will probably end up hating the701 application. Flask provides a really simple way to give feedback to a702 user with the flashing system. The flashing system basically makes it703 possible to record a message at the end of a request and access it next704 request and only next request. This is usually combined with a layout45 unmodified linesmodified:docs/security.rst+1 added-1 removed
71 unmodified lines72 73 Say you have a specific URL that, when you sent `POST` requests to will74 delete a user's profile (say `http://example.com/user/delete`). If an75 attacker now creates a page that sends a post request to that page with76-some JavaScript he or she just has to trick some users to load that page and76+some JavaScript they just has to trick some users to load that page and77 their profiles will end up being deleted.78 79 Imagine you were to run Facebook with millions of concurrent users and80 someone would send out links to images of little kittens. When users95 unmodified lines