fixed pronoun gender in documentation
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Jeffrey Finkelstein · committed by Jeffrey Finkelstein · parent 8e928a2 · Browse files · 8 files·+15 added−15 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+15 added−15 removed
- other:+15 added−15 removed
Provenance
- Commit
12761bd- Tree
c0960da- Author
Jeffrey Finkelstein <jeffrey.finkelstein@gmail.com>- Committer
Jeffrey Finkelstein <jeffrey.finkelstein@gmail.com>- Parent
8e928a2
8 files changed+15 added−15 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 tries to access a resource he cannot access.27+ is not lost when he or she tries 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 was35+ use the 410 code instead and display a message that what he or she was36 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/fileuploads.rst+3 added-3 removed
87 unmodified lines88 filename = "../../../../home/username/.bashrc"89 90 Assuming the number of ``../`` is correct and you would join this with91 the `UPLOAD_FOLDER` the user might have the ability to modify a file on92- the server's filesystem he should not modify. This does require some92+ the server's filesystem he or she should not modify. This does require some93 knowledge about how the application looks like, but trust me, hackers94 are patient :)95 96 Now let's look how that function works:57 unmodified lines154 155 A while ago many developers had the idea to read the incoming file in156 small chunks and store the upload progress in the database to be able to157 poll the progress with JavaScript from the client. Long story short: the158-client asks the server every 5 seconds how much he has transmitted159-already. Do you realize the irony? The client is asking for something he158+client asks the server every 5 seconds how much it has transmitted159+already. Do you realize the irony? The client is asking for something it160 should already know.161 162 Now there are better solutions to that work faster and more reliable. The163 web changed a lot lately and you can use HTML5, Java, Silverlight or Flash17 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 will probably end up hating the7+does not get enough feedback he or she 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 should be redirected to the11+goes to the site and is not logged in, he or she 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/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's logged in. This only32+This view lets the user add new entries if he or she is 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+2 added-2 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 knows the secret key, so make sure to set that to160-something complex and unguessable.159+not modify it unless he or she knows 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 164 .. class:: session281 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 will like the page and come back next time.129+likely he or she 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 480 unmodified lines614 abort(401)615 this_is_never_executed()616 617 This is a rather pointless example because a user will be redirected from618-the index to a page he cannot access (401 means access denied) but it618+the index to a page he or she cannot access (401 means access denied) but it619 shows how that works.620 621 By default a black and white error page is shown for each error code. If622 you want to customize the error page, you can use the18 unmodified lines641 :class:`~flask.session` that allows you to store information specific to a642 user from one request to the next. This is implemented on top of cookies643 for you and signs the cookies cryptographically. What this means is that644 the user could look at the contents of your cookie but not modify it,645-unless he knows the secret key used for signing.645+unless he or she knows the secret key used for signing.646 647 In order to use sessions you have to set a secret key. Here is how648 sessions work::649 47 unmodified lines697 Message Flashing698 ----------------699 700 Good applications and user interfaces are all about feedback. If the user701-does not get enough feedback he will probably end up hating the701+does not get enough feedback he or she will probably end up hating the702 application. Flask provides a really simple way to give feedback to a703 user with the flashing system. The flashing system basically makes it704 possible to record a message at the end of a request and access it next705 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 just has to trick some users to load that page and76+some JavaScript he or she 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