Source

pyptug / webpy / diapos / presentation.html

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
<!DOCTYPE html>
<!--
  Copyright 2010 Google Inc.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

  Original slides: Marcin Wichary (mwichary@google.com)
  Modifications: Ernest Delgado (ernestd@google.com)
                 Alex Russell (slightlyoff@chromium.org)

  landslide modifications: Adam Zapletal (adamzap@gmail.com)
                           Nicolas Perriault (nperriault@gmail.com)
-->
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
    <title>WEB.PY</title>
    <!-- Styles -->
    
    <link rel="stylesheet" media="print" href="file:///usr/lib/python2.7/site-packages/landslide-1.1.1-py2.7.egg/landslide/themes/default/css/print.css">
    <link rel="stylesheet" media="screen, projection" href="file:///usr/lib/python2.7/site-packages/landslide-1.1.1-py2.7.egg/landslide/themes/default/css/screen.css">
    
    
    <!-- /Styles -->
    <!-- Javascripts -->
    
    <script type="text/javascript" src="file:///usr/lib/python2.7/site-packages/landslide-1.1.1-py2.7.egg/landslide/themes/default/js/slides.js"></script>
    
    
    <!-- /Javascripts -->
</head>
<body>
  <div id="blank"></div>
  <div class="presentation">
    <div id="current_presenter_notes">
      <div id="presenter_note"></div>
    </div>
    <div class="slides">
      
      <!-- slide source: slide.md -->
      <div class="slide-wrapper">
        <div class="slide has_code">
          <div class="inner">
            
            <header><h1>WEB.PY</h1></header>
            
            
            <section><p><img alt="PYPTUG" src="file:///home/fdion/bitbucket/pyptug/webpy/diapos/pyptug.png" /></p>
<div class="highlight"><pre><span class="lineno">1</span> <span class="c">#!/usr/bin/env python</span>
<span class="lineno">2</span> <span class="kn">import</span> <span class="nn">web</span>
</pre></div>

<p><font size=32>
    presentation by: Francois Dion
    francois.dion@gmail.com
    http://raspberry-python.blogspot.com<br />
</font></p>
<p><em>November 26th 2012</em></p></section>
            
          </div>
          <div class="presenter_notes">
            <header><h1>Presenter Notes</h1></header>
            <section>
            
            </section>
          </div>
          <footer>
            
            <aside class="source">
              Source: <a href="slide.md">slide.md</a>
            </aside>
            
            <aside class="page_number">
              1/15
            </aside>
          </footer>
        </div>
      </div>
      
      <!-- slide source: slide.md -->
      <div class="slide-wrapper">
        <div class="slide">
          <div class="inner">
            
            <header><h1>WEB.PY</h1></header>
            
            
            <section><p><img alt="PYPTUG" src="file:///home/fdion/bitbucket/pyptug/webpy/diapos/webpy.gif" /></p>
<blockquote>
<p>“Think about the ideal way to write a web app.
Write the code to make it happen.”  </p>
<p>"Django lets you write web apps in Django.
TurboGears lets you write web apps in TurboGears.
Web.py lets you write web apps in Python."
 —  Adam Atlas  </p>
<p>"Guido [van Rossum, creator of Python], you'll probably find
that web.py best suits your style. ... If you don't like it,
I can't imagine which of the other dozens of frameworks out
there you would like."
 —  Phillip J. Eby (WSGI creator)  </p>
</blockquote></section>
            
          </div>
          <div class="presenter_notes">
            <header><h1>Presenter Notes</h1></header>
            <section>
            
            </section>
          </div>
          <footer>
            
            <aside class="source">
              Source: <a href="slide.md">slide.md</a>
            </aside>
            
            <aside class="page_number">
              2/15
            </aside>
          </footer>
        </div>
      </div>
      
      <!-- slide source: slide.md -->
      <div class="slide-wrapper">
        <div class="slide">
          <div class="inner">
            
            <header><h1>Overview</h1></header>
            
            
            <section><ul>
<li>Intro</li>
<li>CGI</li>
<li>Frameworks</li>
<li>Web.py</li>
<li>Where</li>
<li>Features</li>
<li>Templates</li>
<li>Database</li>
<li>Forms</li>
<li>Debugging</li>
<li>Experimental</li>
<li>More</li>
</ul></section>
            
          </div>
          <div class="presenter_notes">
            <header><h1>Presenter Notes</h1></header>
            <section>
            
            </section>
          </div>
          <footer>
            
            <aside class="source">
              Source: <a href="slide.md">slide.md</a>
            </aside>
            
            <aside class="page_number">
              3/15
            </aside>
          </footer>
        </div>
      </div>
      
      <!-- slide source: slide.md -->
      <div class="slide-wrapper">
        <div class="slide">
          <div class="inner">
            
            <header><h1>Intro</h1></header>
            
            
            <section><h2>The web</h2>
<p>Web applications are about URLs and VERBS. And HTML.</p>
<pre><code>http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html

GET, HEAD

POST, PUT, DELETE

TRACE, CONNECT
</code></pre>
<h2>And I</h2>
<p>Started doing interactive, dynamic web applications over 20 years ago. There was not too much available back then. The HTML was trivial, but the rest, not quite. </p>
<p>I wrote my own libraries to make it easier to deal with those HTTP verbs and URLs. Did the first web site for the Montreal Jazz Festival using C. Worked with Perl too, but no Python until a few years later. </p>
<p>A book in 1996... <em>Internet Programming with Python</em></p></section>
            
          </div>
          <div class="presenter_notes">
            <header><h1>Presenter Notes</h1></header>
            <section>
            
            </section>
          </div>
          <footer>
            
            <aside class="source">
              Source: <a href="slide.md">slide.md</a>
            </aside>
            
            <aside class="page_number">
              4/15
            </aside>
          </footer>
        </div>
      </div>
      
      <!-- slide source: slide.md -->
      <div class="slide-wrapper">
        <div class="slide has_code">
          <div class="inner">
            
            <header><h1>CGI</h1></header>
            
            
            <section><h2>HTTP1.1</h2>
<p>When we type in a browser <em>server/script.cgi</em>, we <em>GET http://server/script.cgi</em></p>
<div class="highlight"><pre><span class="lineno">1</span> <span class="c">#!/usr/local/bin/python</span>
<span class="lineno">2</span> <span class="k">print</span> <span class="s">&quot;Content-type: text/html&quot;</span>
<span class="lineno">3</span> <span class="k">print</span>
<span class="lineno">4</span> <span class="k">print</span> <span class="s">&quot;Hello, world!&quot;</span>
</pre></div>

<p>Eventually, a module was written</p>
<div class="highlight"><pre><span class="lineno"> 1</span> <span class="kn">import</span> <span class="nn">cgi</span>
<span class="lineno"> 2</span> <span class="kn">import</span> <span class="nn">cgitb</span><span class="p">;</span> <span class="n">cgitb</span><span class="o">.</span><span class="n">enable</span><span class="p">()</span>  <span class="c"># for troubleshooting</span>
<span class="lineno"> 3</span> <span class="k">print</span> <span class="s">&quot;Content-type: text/html&quot;</span>
<span class="lineno"> 4</span> <span class="k">print</span>
<span class="lineno"> 5</span> <span class="k">print</span> <span class="s">&quot;&quot;&quot;&lt;html&gt;&lt;head&gt;&lt;title&gt;Sample CGI Script&lt;/title&gt;&lt;/head&gt;</span>
<span class="lineno"> 6</span> <span class="s">&lt;body&gt;&lt;h3&gt; Sample CGI Script &lt;/h3&gt;&quot;&quot;&quot;</span>
<span class="lineno"> 7</span> <span class="n">form</span> <span class="o">=</span> <span class="n">cgi</span><span class="o">.</span><span class="n">FieldStorage</span><span class="p">()</span>
<span class="lineno"> 8</span> <span class="n">message</span> <span class="o">=</span> <span class="n">form</span><span class="o">.</span><span class="n">getvalue</span><span class="p">(</span><span class="s">&quot;message&quot;</span><span class="p">,</span> <span class="s">&quot;(no message)&quot;</span><span class="p">)</span>
<span class="lineno"> 9</span> <span class="k">print</span> <span class="s">&quot;&quot;&quot;&lt;p&gt;Previous message: </span><span class="si">%s</span><span class="s">&lt;/p&gt;</span>
<span class="lineno">10</span> <span class="s">&lt;p&gt;form&lt;form method=&quot;post&quot; action=&quot;index.cgi&quot;&gt;</span>
<span class="lineno">11</span> <span class="s">&lt;p&gt;message: &lt;input type=&quot;text&quot; name=&quot;message&quot;/&gt;&lt;/p&gt;&lt;/form&gt;</span>
<span class="lineno">12</span> <span class="s">&lt;/body&gt;&lt;/html&gt;&quot;&quot;&quot;</span> <span class="o">%</span> <span class="n">cgi</span><span class="o">.</span><span class="n">escape</span><span class="p">(</span><span class="n">message</span><span class="p">)</span>
</pre></div>

<p><em>fast forward to 2012</em></p></section>
            
          </div>
          <div class="presenter_notes">
            <header><h1>Presenter Notes</h1></header>
            <section>
            
            </section>
          </div>
          <footer>
            
            <aside class="source">
              Source: <a href="slide.md">slide.md</a>
            </aside>
            
            <aside class="page_number">
              5/15
            </aside>
          </footer>
        </div>
      </div>
      
      <!-- slide source: slide.md -->
      <div class="slide-wrapper">
        <div class="slide">
          <div class="inner">
            
            <header><h1>Frameworks</h1></header>
            
            
            <section><p>Almost 60 frameworks of all types on python.org</p>
<p>Over 100 projects over the years</p>
<p>Full frameworks have everything and the kitchen sink.</p>
<h2>Big, Popular:</h2>
<p>Zope (was), Django (current)</p>
<h2>Micro:</h2>
<p>At the other end, the micro-frameworks (bottle, itty, werkzeug...)</p>
<h2>Other options</h2>
<p>Web (app) servers that are also frameworks (CherryPy, Tornado...)</p>
<p>And of course, the bare metal stuff: cgi is still around, so is fastcgi (python-fcgi) and wsgi.</p>
<p>So many templating engines, so many database engines...</p>
<p>In the middle of all this...</p></section>
            
          </div>
          <div class="presenter_notes">
            <header><h1>Presenter Notes</h1></header>
            <section>
            
            </section>
          </div>
          <footer>
            
            <aside class="source">
              Source: <a href="slide.md">slide.md</a>
            </aside>
            
            <aside class="page_number">
              6/15
            </aside>
          </footer>
        </div>
      </div>
      
      <!-- slide source: slide.md -->
      <div class="slide-wrapper">
        <div class="slide has_code">
          <div class="inner">
            
            <header><h1>web.py</h1></header>
            
            
            <section><p>http://webpy.org</p>
<p>web.py is a web framework for Python that is as simple as it is powerful. It has been around since 2006. </p>
<h2>Completely free</h2>
<p>web.py is in the public domain; you can use it for whatever purpose with absolutely no restrictions.</p>
<h2>It scales</h2>
<p>web.py was originally published while Aaron Swartz worked at reddit.com. It powered that site, receiving millions of pageviews daily.</p>
<h2>Flexibility</h2>
<p>It is an anti-framework framework (!)</p>
<p>It does not get in your way, does not force you into a specific way of doing things (ie. MVC)</p>
<p>At a minimum:</p>
<div class="highlight"><pre><span class="lineno">1</span> <span class="kn">import</span> <span class="nn">web</span>
</pre></div>
</section>
            
          </div>
          <div class="presenter_notes">
            <header><h1>Presenter Notes</h1></header>
            <section>
            
            </section>
          </div>
          <footer>
            
            <aside class="source">
              Source: <a href="slide.md">slide.md</a>
            </aside>
            
            <aside class="page_number">
              7/15
            </aside>
          </footer>
        </div>
      </div>
      
      <!-- slide source: slide.md -->
      <div class="slide-wrapper">
        <div class="slide">
          <div class="inner">
            
            <header><h1>Where to get it</h1></header>
            
            
            <section><p>Official release is on pypi, version 0.37:</p>
<pre><code>$ sudo easy_install web.py
</code></pre>
<p>or
    $ sudo pip install web.py</p>
<p>Development version (last active 12 days ago)</p>
<pre><code>$ git clone git://github.com/webpy/webpy.git
$ ln -s `pwd`/webpy/web .
</code></pre>
<p>There are also various forks and variations out there.</p>
<p>It is available on <em>Google App Engine (GAE)</em>, with one special instruction when using <em>templetor</em>. Templates have to be compiled:</p>
<pre><code>$ python web/template.py --compile templates
</code></pre>
<p><strong>code demo</strong> (<em>/pyptug/webpy/gae/<strong>init</strong>.py</em>)</p></section>
            
          </div>
          <div class="presenter_notes">
            <header><h1>Presenter Notes</h1></header>
            <section>
            
            </section>
          </div>
          <footer>
            
            <aside class="source">
              Source: <a href="slide.md">slide.md</a>
            </aside>
            
            <aside class="page_number">
              8/15
            </aside>
          </footer>
        </div>
      </div>
      
      <!-- slide source: slide.md -->
      <div class="slide-wrapper">
        <div class="slide">
          <div class="inner">
            
            <header><h1>Features</h1></header>
            
            
            <section><p>Hello, World.</p>
<p>URL: /hello</p>
<p>VERB: GET</p>
<p>Mapping of URLs is through a tuple:</p>
<pre><code>URL = ( 'regexp', classname,
'regexp', classname,
...
)
</code></pre>
<p>Tuple garantees precedence.</p>
<p>If class is dynamic or defined later, can use string ( 'classname' ) instead of class itself. regexp is regular expression ( ex: <em>'/[a-z][a-z]/.</em>'<em> would match any URL starting with two letters, such as </em>/en/something* )</p>
<p><strong>demo</strong> (<em>/pyptug/webpy/helloworld</em>)</p></section>
            
          </div>
          <div class="presenter_notes">
            <header><h1>Presenter Notes</h1></header>
            <section>
            
            </section>
          </div>
          <footer>
            
            <aside class="source">
              Source: <a href="slide.md">slide.md</a>
            </aside>
            
            <aside class="page_number">
              9/15
            </aside>
          </footer>
        </div>
      </div>
      
      <!-- slide source: slide.md -->
      <div class="slide-wrapper">
        <div class="slide">
          <div class="inner">
            
            <header><h1>Templates</h1></header>
            
            
            <section><p>Directly: mako, jinja 2, cheetah, genshi, templetor<br />
Easily: wheezy.template, tempita, tenjin, to name a few</p>
<p><em>Templetor</em> is native.</p>
<p>A template is a string or document, with variables that can be substituted. Optionally, has keywords. </p>
<p>Templetor uses python variables and keywords, but with a $ sign to differentiate from the template.</p>
<p>To use a dollar sign, use $$.</p>
<p><strong>demo</strong> (<em>/pyptug/webpy/templetor</em>)</p></section>
            
          </div>
          <div class="presenter_notes">
            <header><h1>Presenter Notes</h1></header>
            <section>
            
            </section>
          </div>
          <footer>
            
            <aside class="source">
              Source: <a href="slide.md">slide.md</a>
            </aside>
            
            <aside class="page_number">
              10/15
            </aside>
          </footer>
        </div>
      </div>
      
      <!-- slide source: slide.md -->
      <div class="slide-wrapper">
        <div class="slide">
          <div class="inner">
            
            <header><h1>Database</h1></header>
            
            
            <section><p>Directly: sqlite, mysql, firebird, mssql, postgresql, oracle</p>
<p>For session and user management it is also possible to use a plain disk store, memcached, redis, riak or mongodb (examples on the webpy google group)</p>
<p>web.db provides a thin layer atop the native python drivers for each relational database (sqlite3, mysqldb, kinterbasdb, pymssql, psycopg2, cx_oracle)</p>
<p>Not an ORM (sqlalchemy, sqlobject, Storm)</p>
<p>But look into MRO or smartersql before going to these</p>
<p>web.db has <em>insert</em>, <em>select</em>, <em>update</em>, <em>delete</em>, and <em>query</em>.</p>
<p>It also has support for transactions:</p></section>
            
          </div>
          <div class="presenter_notes">
            <header><h1>Presenter Notes</h1></header>
            <section>
            
            </section>
          </div>
          <footer>
            
            <aside class="source">
              Source: <a href="slide.md">slide.md</a>
            </aside>
            
            <aside class="page_number">
              11/15
            </aside>
          </footer>
        </div>
      </div>
      
      <!-- slide source: slide.md -->
      <div class="slide-wrapper">
        <div class="slide has_code">
          <div class="inner">
            
            
            <section><div class="highlight"><pre><span class="lineno"> 1</span> <span class="kn">import</span> <span class="nn">web</span>
<span class="lineno"> 2</span> 
<span class="lineno"> 3</span> <span class="n">db</span> <span class="o">=</span> <span class="n">web</span><span class="o">.</span><span class="n">database</span><span class="p">(</span><span class="n">dbn</span><span class="o">=</span><span class="s">&quot;postgres&quot;</span><span class="p">,</span> <span class="n">db</span><span class="o">=</span><span class="s">&quot;webpy&quot;</span><span class="p">,</span> <span class="n">user</span><span class="o">=</span><span class="s">&quot;foo&quot;</span><span class="p">,</span> <span class="n">pw</span><span class="o">=</span><span class="s">&quot;&quot;</span><span class="p">)</span>
<span class="lineno"> 4</span> <span class="n">t</span> <span class="o">=</span> <span class="n">db</span><span class="o">.</span><span class="n">transaction</span><span class="p">()</span>
<span class="lineno"> 5</span> <span class="k">try</span><span class="p">:</span>
<span class="lineno"> 6</span>     <span class="n">db</span><span class="o">.</span><span class="n">insert</span><span class="p">(</span><span class="s">&#39;person&#39;</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="s">&#39;foo&#39;</span><span class="p">)</span>
<span class="lineno"> 7</span>     <span class="n">db</span><span class="o">.</span><span class="n">insert</span><span class="p">(</span><span class="s">&#39;person&#39;</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="s">&#39;bar&#39;</span><span class="p">)</span>
<span class="lineno"> 8</span> <span class="k">except</span><span class="p">:</span>
<span class="lineno"> 9</span>     <span class="n">t</span><span class="o">.</span><span class="n">rollback</span><span class="p">()</span>
<span class="lineno">10</span>     <span class="k">raise</span>
<span class="lineno">11</span> <span class="k">else</span><span class="p">:</span>
<span class="lineno">12</span>     <span class="n">t</span><span class="o">.</span><span class="n">commit</span><span class="p">()</span>
</pre></div>

<p>As can be seen here, it is not only for web applications.</p>
<p>Let us consider two non web applications using web.db:</p>
<p><strong>demo</strong> (<em>/pyptug/webpy/gui</em>)</p>
<p><strong>demo</strong> (<em>/pyptug/webpy/mailing</em>)</p></section>
            
          </div>
          <div class="presenter_notes">
            <header><h1>Presenter Notes</h1></header>
            <section>
            
            </section>
          </div>
          <footer>
            
            <aside class="source">
              Source: <a href="slide.md">slide.md</a>
            </aside>
            
            <aside class="page_number">
              12/15
            </aside>
          </footer>
        </div>
      </div>
      
      <!-- slide source: slide.md -->
      <div class="slide-wrapper">
        <div class="slide">
          <div class="inner">
            
            <header><h1>Forms</h1></header>
            
            
            <section><p>The form module of web.py allows the ability to generate html forms, get user input, and validate it</p>
<p>We will consider 3 ways of using them.</p>
<p>First, completely with Python code, then purely in HTML and finally, a combination of both.</p>
<p>The last demo not only uses a combination of both, but also showcases how Ajax can be used in a form and how to do REST style queries.</p>
<p><strong>demo</strong> (<em>/pyptug/webpy/forms</em>)</p></section>
            
          </div>
          <div class="presenter_notes">
            <header><h1>Presenter Notes</h1></header>
            <section>
            
            </section>
          </div>
          <footer>
            
            <aside class="source">
              Source: <a href="slide.md">slide.md</a>
            </aside>
            
            <aside class="page_number">
              13/15
            </aside>
          </footer>
        </div>
      </div>
      
      <!-- slide source: slide.md -->
      <div class="slide-wrapper">
        <div class="slide">
          <div class="inner">
            
            <header><h1>Debugging</h1></header>
            
            
            <section><p>Various options are available when it comes to debugging.</p>
<p>At a low level, with Python with dtrace support (Solaris, OpenIndiana, BSD, OS/X)</p>
<p>Through web.debug=True</p>
<pre><code>&lt;type 'exceptions.NameError'&gt; at /
global name 'nonsense' is not defined
Python  /home/fdion/bitbucket/pyptug/webpy/debug/de1.py in GET,     line 7
Web     GET http://localhost:8080/
Traceback (innermost first)

/home/fdion/bitbucket/pyptug/webpy/debug/de1.py in GET
    nonsense ...
▶ Local vars
/usr/lib/python2.7/site-packages/web.py-0.37-py2.7.egg/web/application.py in handle_class
    return tocall(*args) ...
▶ Local vars
</code></pre>
<p>...</p>
<p>Session dump, logging, sendmail, <em>profiler</em>, <em>external debuggers</em></p>
<p><strong>demo</strong> (<em>/pyptug/webpy/debug</em>)</p></section>
            
          </div>
          <div class="presenter_notes">
            <header><h1>Presenter Notes</h1></header>
            <section>
            
            </section>
          </div>
          <footer>
            
            <aside class="source">
              Source: <a href="slide.md">slide.md</a>
            </aside>
            
            <aside class="page_number">
              14/15
            </aside>
          </footer>
        </div>
      </div>
      
      <!-- slide source: slide.md -->
      <div class="slide-wrapper">
        <div class="slide">
          <div class="inner">
            
            <header><h1>More</h1></header>
            
            
            <section><h2>Experimental</h2>
<ul>
<li>untwisted</li>
<li>backgrounder</li>
<li>uwt</li>
</ul>
<h2>Standard</h2>
<ul>
<li>http (utils), ex: url()</li>
<li>httpserver (cherrypy)</li>
<li>net (utils), ex: validipaddr()</li>
<li>session</li>
<li>utils, ex: Storage, Counter, Memoize</li>
<li>webapi, ex: HTTPError, cookies</li>
<li>webopenid</li>
<li>wsgi</li>
</ul>
<h2>To consider</h2>
<ul>
<li>deployment (reverse proxies, cgi, fcgi, wsgi, cache, lb...)</li>
<li>testing</li>
<li>integration</li>
<li>backup</li>
<li>source control</li>
</ul></section>
            
          </div>
          <div class="presenter_notes">
            <header><h1>Presenter Notes</h1></header>
            <section>
            
            </section>
          </div>
          <footer>
            
            <aside class="source">
              Source: <a href="slide.md">slide.md</a>
            </aside>
            
            <aside class="page_number">
              15/15
            </aside>
          </footer>
        </div>
      </div>
      
    </div>
  </div>
  
  <div id="toc" class="sidebar hidden">
    <h2>Table of Contents</h2>
    <table>
      <caption>Table of Contents</caption>
      
      <tr id="toc-row-1">
        <th><a href="#slide1">WEB.PY</a></th>
        <td><a href="#slide1">1</a></td>
      </tr>
      
      
      <tr id="toc-row-2">
        <th><a href="#slide2">WEB.PY</a></th>
        <td><a href="#slide2">2</a></td>
      </tr>
      
      
      <tr id="toc-row-3">
        <th><a href="#slide3">Overview</a></th>
        <td><a href="#slide3">3</a></td>
      </tr>
      
      
      <tr id="toc-row-4">
        <th><a href="#slide4">Intro</a></th>
        <td><a href="#slide4">4</a></td>
      </tr>
      
      
      <tr id="toc-row-5">
        <th><a href="#slide5">CGI</a></th>
        <td><a href="#slide5">5</a></td>
      </tr>
      
      
      <tr id="toc-row-6">
        <th><a href="#slide6">Frameworks</a></th>
        <td><a href="#slide6">6</a></td>
      </tr>
      
      
      <tr id="toc-row-7">
        <th><a href="#slide7">web.py</a></th>
        <td><a href="#slide7">7</a></td>
      </tr>
      
      
      <tr id="toc-row-8">
        <th><a href="#slide8">Where to get it</a></th>
        <td><a href="#slide8">8</a></td>
      </tr>
      
      
      <tr id="toc-row-9">
        <th><a href="#slide9">Features</a></th>
        <td><a href="#slide9">9</a></td>
      </tr>
      
      
      <tr id="toc-row-10">
        <th><a href="#slide10">Templates</a></th>
        <td><a href="#slide10">10</a></td>
      </tr>
      
      
      <tr id="toc-row-11">
        <th><a href="#slide11">Database</a></th>
        <td><a href="#slide11">11</a></td>
      </tr>
      
      
      <tr id="toc-row-12">
        <th><a href="#slide12">-</a></th>
        <td><a href="#slide12">12</a></td>
      </tr>
      
      
      <tr id="toc-row-13">
        <th><a href="#slide13">Forms</a></th>
        <td><a href="#slide13">13</a></td>
      </tr>
      
      
      <tr id="toc-row-14">
        <th><a href="#slide14">Debugging</a></th>
        <td><a href="#slide14">14</a></td>
      </tr>
      
      
      <tr id="toc-row-15">
        <th><a href="#slide15">More</a></th>
        <td><a href="#slide15">15</a></td>
      </tr>
      
      
    </table>
  </div>
  
  <div id="help" class="sidebar hidden">
    <h2>Help</h2>
    <table>
      <caption>Help</caption>
      <tr>
        <th>Table of Contents</th>
        <td>t</td>
      </tr>
      <tr>
        <th>Exposé</th>
        <td>ESC</td>
      </tr>
      <tr>
        <th>Full screen slides</th>
        <td>e</td>
      </tr>
      <tr>
        <th>Presenter View</th>
        <td>p</td>
      </tr>
      <tr>
        <th>Source Files</th>
        <td>s</td>
      </tr>
      <tr>
        <th>Slide Numbers</th>
        <td>n</td>
      </tr>
      <tr>
        <th>Toggle screen blanking</th>
        <td>b</td>
      </tr>
      <tr>
        <th>Show/hide slide context</th>
        <td>c</td>
      </tr>
      <tr>
        <th>Notes</th>
        <td>2</td>
      </tr>
      <tr>
        <th>Help</th>
        <td>h</td>
      </tr>
    </table>
  </div>
  <script>main()</script>
</body>
</html>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.