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/08/04 11:32] – [aio] scipiotips:pyramid [2015/08/18 12:32] (current) – [yml] scipio
Line 41: Line 41:
 Bower can help to install javascript client side libraries, like angularjs. Bower can help to install javascript client side libraries, like angularjs.
  
-Install pyramid_bowerstatic and add it to setup.py+Install npm and bower at system level
 <code> <code>
-pip install pyramid_bowerstatic+sudo apt-get install npm 
 +sudo npm install -g bower
 </code> </code>
  
 Install module (library) Install module (library)
 <code> <code>
-bower install ui-bootstrap+# cd <project>/<same-level-of-subdir-static> 
 +bower install angular-bootstrap
 </code> </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 83: 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.1438680736.txt.gz
  • Last modified: 2015/08/04 11:32
  • by scipio