From cfc8fbe0e1380c06b01643f8310ae59ea0af820b Mon Sep 17 00:00:00 2001 From: Chris Shenton Date: Sat, 21 Oct 2017 15:35:25 +0200 Subject: Quick Tutorial: Replace wsgiref with waitress In setup.py add waitress import. In development.ini use waitress. Adjust line number highlighting. Mention that we're using it early in the tutorial. Addresses #2926 --- docs/quick_tutorial/authorization/development.ini | 4 ++-- docs/quick_tutorial/authorization/setup.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'docs/quick_tutorial/authorization') diff --git a/docs/quick_tutorial/authorization/development.ini b/docs/quick_tutorial/authorization/development.ini index a4586d45f..cae509542 100644 --- a/docs/quick_tutorial/authorization/development.ini +++ b/docs/quick_tutorial/authorization/development.ini @@ -6,5 +6,5 @@ pyramid.includes = tutorial.secret = 98zd [server:main] -use = egg:pyramid#wsgiref -port = 6543 +use = egg:waitress#main +listen = localhost:6543 diff --git a/docs/quick_tutorial/authorization/setup.py b/docs/quick_tutorial/authorization/setup.py index 7a6ff4226..0da300ba0 100644 --- a/docs/quick_tutorial/authorization/setup.py +++ b/docs/quick_tutorial/authorization/setup.py @@ -2,6 +2,7 @@ from setuptools import setup requires = [ 'pyramid', + 'waitress', 'pyramid_chameleon', 'bcrypt' ] @@ -12,4 +13,4 @@ setup(name='tutorial', [paste.app_factory] main = tutorial:main """, -) \ No newline at end of file +) -- cgit v1.2.3 From 088013637dfb4623bc3ea6588b6f08e827fecdd7 Mon Sep 17 00:00:00 2001 From: Chris Shenton Date: Sat, 21 Oct 2017 16:06:03 +0200 Subject: Force emacs not to add newlines gratuitously, un-add them --- docs/quick_tutorial/authorization/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/quick_tutorial/authorization') diff --git a/docs/quick_tutorial/authorization/setup.py b/docs/quick_tutorial/authorization/setup.py index 0da300ba0..808a6f9a9 100644 --- a/docs/quick_tutorial/authorization/setup.py +++ b/docs/quick_tutorial/authorization/setup.py @@ -13,4 +13,4 @@ setup(name='tutorial', [paste.app_factory] main = tutorial:main """, -) +) \ No newline at end of file -- cgit v1.2.3 From 5fc14d6868898d7b6044086638ebe9c2c5ed1b71 Mon Sep 17 00:00:00 2001 From: silum Date: Fri, 3 Nov 2017 19:31:43 +0200 Subject: views.py: prevent exception on unknown user login --- docs/quick_tutorial/authorization/tutorial/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs/quick_tutorial/authorization') diff --git a/docs/quick_tutorial/authorization/tutorial/views.py b/docs/quick_tutorial/authorization/tutorial/views.py index b2dc905c0..3876efb1c 100644 --- a/docs/quick_tutorial/authorization/tutorial/views.py +++ b/docs/quick_tutorial/authorization/tutorial/views.py @@ -45,7 +45,8 @@ class TutorialViews: if 'form.submitted' in request.params: login = request.params['login'] password = request.params['password'] - if check_password(password, USERS.get(login)): + hashed_pw = USERS.get(login) + if hashed_pw and check_password(password, hashed_pw): headers = remember(request, login) return HTTPFound(location=came_from, headers=headers) -- cgit v1.2.3