tips:pyramid

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tips:pyramid [2015/06/12 10:41] scipiotips:pyramid [2015/08/18 12:32] (current) – [yml] scipio
Line 37: Line 37:
 </code> </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 ===== ===== aio =====
  
Line 68: Line 107:
 <code> <code>
 gunicorn --paste development.ini 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> </code>
  
  • tips/pyramid.1434098496.txt.gz
  • Last modified: 2015/06/12 10:41
  • (external edit)