/kai/templates/home/features.mako

https://bitbucket.org/bbangert/kai/ · Mako · 108 lines · 84 code · 24 blank · 0 comment · 3 complexity · 8f98d5a972d50a9197fd06c318d91250 MD5 · raw file

  1. <div class="yui-b content">
  2. <h1>Features</h1>
  3. <h2>Comfortable Interactive Debugger</h2>
  4. <p>Programming means making mistakes. And searching for the cause of an error
  5. distracts you from the task at hand and is annoying. Especially in web
  6. applications you usually do not have a fancy debugger at hand that allows you
  7. to view all variables and the piece of code where the error occurred.</p>
  8. <p>Pylons
  9. offers a great online debugger. If your application throws an exception you
  10. will get a traceback on the web page, can view local variables and can even
  11. enter Python statements interactively. Sometimes people even deliberately throw
  12. in a ``raise Exception`` statement to make the application stop at that line so
  13. they can investigate what is going on.</p>
  14. <p>The debugger even works with AJAX
  15. requests as it prints the debug URL on the console for a sub-request that you
  16. can just paste in your browser and debug it. And in case your application
  17. runs on a production server and get into an error situation it will collect
  18. all that information and send your an email.</p>
  19. <h2>Exploring the world: Paster shell</h2>
  20. <p>A Pylons application uses many different Python modules. The environment
  21. in which your application is running seems pretty opaque. Fortunately you can
  22. run the ``paster shell`` which is a normal Python shell (or even an *ipython*
  23. shell if you have it installed) but has access to all the global variables and
  24. utility functions that Pylons offers.</p>
  25. <p>Play with your database models, explore
  26. the "Webhelpers" utilities, browse through the available global variables and
  27. even simulate requests as if you used a browser. And if things work as you
  28. expect you just copy the code into your application.</p>
  29. <h2>Web server built in</h2>
  30. <p>Pylons uses *Paste* for setting up a project, upgrading it to a newer Pylons
  31. version and deploying the application. And it even features a built-in web
  32. server that you can use to develop and test your applications. You don't have to
  33. install an additional web server like Apache to run your application.
  34. Development happens directly on your workstation. And the Paste web server is
  35. even powerful enough that some people use in on production servers.</p>
  36. <h2>Simplifying the development cycle: --reload</h2>
  37. <p>Developing under a web framework means that your framework has to be restarted
  38. once you changed something. If you use the Paste web server you can toss in the
  39. ``--reload`` option so that Paste will monitor your files. Once you save a
  40. changed file it will automatically detect that and reload the framework. Your
  41. development cycle is essentially saving the file and reloading the page in the
  42. browser. It could not be simpler.</p>
  43. <h2>WSGI - ready for production use</h2>
  44. <p>Pylons does not depend on a certain web server. Other frameworks may have a web
  45. server built in - so you depend on its stability, security and features. Pylons
  46. is a WSGI framework which means that it works on any web server that speaks
  47. WSGI. WSGI is a protocol between web servers and web applications - similar to
  48. CGI. Basically any WSGI web application can run with any WSGI web server. And
  49. you can even use WSGI *middleware* which is code you can simply plug between the
  50. web server and the web application to provide features like authentication or
  51. logging.</p>
  52. <h2>Smooth upgrades</h2>
  53. <p>Pylons is a template for your project. It creates a number of files and
  54. directories where your HTML templates, database models and controller code goes
  55. into. You will surely change that template a lot. But what happens when a new
  56. version of Pylons is released? No problem. Pylons can show you the differences
  57. between your files and the new template and you are free to adopt any changes.
  58. So you are always up-to-date without starting from scratch.</p>
  59. <h2>The web developer's toolbox: Webhelpers</h2>
  60. <p>To avoid reinventing the wheel Pylons applications can use the *Webhelpers*
  61. package. It contains functions to deal with HTML tags and HTML forms, they convert
  62. numbers into human-readable forms, deal with RSS feeds and split large outputs
  63. (like database tables) into pages by only a few lines of Python code.</p>
  64. <h2>Beautiful URLs</h2>
  65. <p>Usually you don't have complete control over the URL in web applications. They
  66. look like ``/cgi-bin/myscript.pl?search=weather`` or
  67. ``/customers/settings.php?customerid=123``. Pylons instead uses *Routes*
  68. to map any URL scheme to different parts of your application. So you will
  69. rather end up with user-friendly and memorable URLs like ``/articles/2008``
  70. or ``/products/computer/keyboards``.</p>
  71. <h2>Exchangeable components</h2>
  72. <p>Pylons is open-minded. You can use it with different templating languages and
  73. different database toolkits. A good selection of components is already
  74. configured so that you can get started quickly. But it is really easy to replace
  75. them if they do not match your taste.</p>
  76. <h2>Separated models, views and controllers</h2>
  77. <p>In Pylons you separate the models (your database schema), the views (HTML
  78. templates) and the controllers (your application code). That is called *MVC*
  79. (model, view, controller). Using this MVC approach you can change database
  80. models or the HTML templates without risking to break your application code.</p>
  81. </div>
  82. <%def name="title()">${parent.title()} - ${_('Features')}</%def>
  83. <%inherit file="/layout.mako" />
  84. <%namespace name="widgets" file="/widgets.mako"/>