Package: khufu_opinion
Introductionkhufu_opinionis a set of paster templates for rapid Pyramid development.  It
makes several framework choices for the developer which are:Pyramidfor the underlying web frameworktraversal based url routingJinja2for the page template language (similar to Django templates)SQLAlchemyfor ORM-based relational database persistenceImportant URL’sSource Control -https://github.com/serverzen/khufu_opinionPyPi Entry -http://pypi.python.org/pypi/khufu_opinionSetting up a New ProjectInstall khufu_opinion into a Python environment (ievirtualenv) with a working
Paster.  Once this has been done, you can create a new khufu_opinion project
by simply running (whereSomethingis the name of your new egg):paster create -t khufu_starter SomethingOnce the template egg has been created you should set it up in develop
mode to start working on your project.cd Something
python setup.py developUsing the New ProjectCommand RunnerBy default a new script namedsomething-managewill be created in thebindirectory of your python envionment.  This script is a command
runner that provides the following:Commands:
    runserver             Run a reloadable development web server.
    loaddata              Add data based on the YAML from filename
    shell                 Launch a Python shell
    syncdb                Ensure all database tables existPasterAdevelopment.inifile will be created inside theSomethingdirectory.  This can be used with the standardpastercommands:# use builtin paster http server
paster serve development.iniDeployment with Apache+mod_wsgiThere is a preconfiguredSomething.wsgifile generated which
is necessary for plugging your app into a mod_wsgi environment.A simple apache virtualhost entry will look like this:<VirtualHost *:80>
    ServerName www.something.com

    WSGIScriptAlias / /path/to/Something.wsgi
</VirtualHost>Developing With the New ProjectBase Frameworkkhufu_opinion is based on thePyramidweb application
framework.  As such, thePyramidapi will always be
the go-to api for working with the web application.  Please
see thePyramid docsfor further details.TemplatingAny file ending with the.jinja2extension located inside
theSomething/something/templatesdirectory will be rendered using
theJinja2templating system.  This template language is
based on the Django templating language.khufu_opinion produces two template files by default, one containing
the overall layout called,layout.jinja2and one for the default main
page called,main.jinja2.Data AccessAll data access is handled by theSQLAlchemyORMframework which wraps
relational databases.  Out of the box, any new project created by khufu_opinion
will have aSQLAlchemydatabase session factory setup.khufu_opinion puts the orm model classes inside themodels.pyPython
file.  The active database session can always be retrieved as thedbattribute on therequestobject.Transaction SupportTransactions are used to ensure all or nothing is performed.  With the
very usefulpyramid_tm,repoze.tm2, andtransactionpackages this can
be accomplished easily inPyramidapplications.khufu_opinion ensures all requests join a new transaction so that if
any error/exception occurs, the transaction is automatically
rolled back.  Any db sessions created via the provided session
factory automatically join this transaction and will be rolled back
in the event an error occurs.TraversalThePyramidweb application framework provides a convenient mechanism
to traverse an object graph and map that graph to url’s.  khufu_opinion stores
it’s traversal mechanism inside of theresources.pyfile.CreditsCreated and maintained by Rocky Burt (rocky AT serverzen DOT com)Changes0.5 - May 14, 2011Now uses khufu_scripttraversalsmodule is nowresources0.2.2 - Feb 20, 2011Renamed from RapidGiza to khufu_opinion0.2.1 - Feb 16, 2011Updated url’s to point to github repo0.2 - Feb 5, 2011switched from Werkzeug to Khufu-Scriptnow using Khufu-SQLAHelper0.1.4 - Dec 1, 2010yet another missing file (won’t happen again)0.1.3 - Nov 30, 2010Added yet another missing file to MANIFEST.in0.1.2 - Nov 29, 2010Changedmake_app()signatureAdded development.ini for out-of-the-box use with Paster serveGenerated projects now include two Paster apps<<project>>:app - Web app with included middleware<<project>>:pyramid-app - Web app without middleware0.1.1 - Nov 29, 2010Fixed MANIFEST.in so sdist contains appropriate files0.1 - Nov 29, 2010Initial version