Show pageOld revisionsBacklinksAdd to bookExport to PDFBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Pyramid ====== ===== classic ===== ==== Environment ==== library <code> BASE=/lab/ztl cd $BASE virtualenv lib . lib/bin/activate pip install pyramid </code> library activation in active shell (for starting project and running) <code> . lib/bin/activate </code> start project **ztlbrain** <code> pcreate --scaffold alchemy ztlbrain cd ztlbrain python setup.py develop </code> initialize db <code> initialize_ztlbrain_db development.ini </code> run <code> pserve development.ini --reload </code> ===== bower ===== Bower can help to install javascript client side libraries, like angularjs. Install npm and bower at system level <code> sudo apt-get install npm sudo npm install -g bower </code> Install module (library) <code> # cd <project>/<same-level-of-subdir-static> bower install angular-bootstrap </code> Libraries: * angular * angular-bootstrap * angular-wamp * autobahn * bootstrap * jquery * leafelet-bouncemarker * leaflet * Leaflet.label In __init__.py <code> config.add_static_view('bower_components', 'bower_components', cache_max_age=3600) </code> In template <code html> <link href="${request.static_url('ztlbrain:bower_components/bootstrap/dist/css/bootstrap.min.css')}" rel="stylesheet"> <script src="${request.static_url('ztlbrain:bower_components/jquery/dist/jquery.min.js')}"></script> <script src="${request.static_url('ztlbrain:bower_components/angular/angular.min.js')}"></script> <script src="${request.static_url('ztlbrain:bower_components/angular-bootstrap/ui-bootstrap.min.js')}"></script> </code> ===== aio ===== library <code> BASE=/lab/ztl cd $BASE virtualenv lib . lib/bin/activate pip install aiopyramid </code> library activation in active shell (for starting project and running) <code> . lib/bin/activate </code> start project **ztlbrain** <code> pcreate --scaffold aio_websocket ztlbrain cd ztlbrain python setup.py develop </code> initialize db <code> initialize_ztlbrain_db development.ini </code> run <code> gunicorn --paste development.ini </code> ===== yaml ===== Use yaml file as configuration container. See [[http://tzfpyramid-yml.readthedocs.org/en/latest/usage.html|here]] setup.py <code> requires = [ ... 'tzf.pyramid_yml' .... </code> __init__.py <code> config.include('tzf.pyramid_yml') </code> *ini <code> yaml.location = /lab/wega/wegasim env = dev </code> config.yml <code> configurator: serial_code : 'ABCD' serial.port : '/dev/ttyUSB3' serial.speed : 9600 test.serial.port : '/dev/ttyUSB2' test.serial.speed : 9600 wamp.router.url : 'ws://localhost:6001/ws' wamp.router.push : 'http://localhost:6001/push' wamp.realm : 'realm_sim' </code> tips/pyramid.txt Last modified: 2015/08/18 12:32by scipio