[pyramid] Add a "pyramid" instance configuration type
In a new module 'cubicweb.pyramid.config' we define a "pyramid" instance
configuration type. The noticeable feature of this configuration is that it
manages a 'development.ini' file that gets installed in application home
(along with `.conf` file). This file is templated and includes generated
values for secrets of session and authtk tokens.
This means that we can just call:
pserve etc/cubicweb.d/<appname>/development.ini
or
gunicorn --paste etc/cubicweb.d/<appname>/development.ini -b :8080
just after instance creation to get a pyramid instance running without having
to hack around a 'pyramid.ini' file.
This patch drops 'development.ini' from skeleton and moves it in
cubicweb/pyramid so that it gets installed at instance creation which is more
appropriate than in cube creation.
The new configuration class sets "cubicweb.bwcompat" setting to false so it is
not intended to replace the "all-in-one" configuration type (which would
require a bit more work). This configuration is close to the the 'repository'
configuration type with just a couple of options from WebConfiguration that
are needed for Pyramid (anonymous user/password plus some miscellaneous
options that I'm not so sure are really needed). Note, in particular, that we
do not pull CORS settings to be injected as a WSGI middleware like in
wsgi_application_from_cwconfig() since I believe this should be left as an
end-user responsibility and since this can be defined in a standard way in
paste configuration. This configuration inherits from ServerConfiguration but
registers the same appobjects as WebConfiguration.
In cubicweb.web.request._CubicWebRequestBase, we guard against access to
"uiprops" and "datadir_url" of the config because this new "pyramid" config
does not have these (this does not make sense without bwcompat mode). At some
point, we should either avoid using `cw_request`'s pyramid request attribute
or make cubicweb's web request really independant of existing implementation
and drop these assumptions.
.. -*- coding: utf-8 -*-
Formation Python-CubicWeb 5 jours
==================================
Bases Python
------------
Syntaxe de base
~~~~~~~~~~~~~~~
:durée: 1j
Modèle objet
~~~~~~~~~~~~
:durée: 0.5j
Traitement de chaînes
~~~~~~~~~~~~~~~~~~~~~
:durée: 0.3j
Formattage de chaînes
Unicode
Entrées/Sorties
~~~~~~~~~~~~~~~
:durée: 0.2j
Fichiers
`StringIO`
Structures avancées
~~~~~~~~~~~~~~~~~~~
:durée: 0.5j
`object`, `super`
iterateurs
générateurs
list comprehension / generator expression
descripteurs, properties (`classmethod`, `property`)
décorateurs
Développement CubicWeb
-----------------------
Mise en place d'un environnement de développement CubicWeb
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:durée: 0.5j
Introduction mercurial
Installation de CubicWeb et de ses dépendances (debian !)
Postgres
Notion de template et d'instance
L'outil `cubicweb-ctl`
Création du modèle
Création d'une instance de développement
Fondements CubicWeb
~~~~~~~~~~~~~~~~~~~
:durée: 0.1j
Vocabulaire
Le langage RQL
Client/Serveur
Définition du modèle de données
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:durée: 0.4j
Définition d'entité
Définition de relation
Persistence du schéma
Migration de schéma
Fondements du framework CubicWeb
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:durée: 0.1j
La classe `appobject`
La base de registres
Chargement dynamique des classes
Manipulation des données stockées
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:durée: 0.4j
Les classes `Entity` et `AnyEntity`
Paramétrages et extensions spécifiques
Écriture de tests unitaires
Définition de vues
~~~~~~~~~~~~~~~~~~
:durée: 0.5j
Les classes de base des vues
Les vues prédéfinies dans la librairie
Les patrons
Vues binaires ou autre
Écriture de tests unitaires
Tests automatiques
Autres composants de l'interface web
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:durée: 0.5j
Actions
Component, VComponent
Forms, Controller
Eproperty