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 12:16] – [bower] scipiotips:pyramid [2015/08/18 12:32] (current) – [yml] scipio
Line 47: Line 47:
 </code> </code>
  
-Install pyramid_bowerstatic and add it to setup.py+Install module (library)
 <code> <code>
-pip install pyramid_bowerstatic+# cd <project>/<same-level-of-subdir-static> 
 +bower install angular-bootstrap
 </code> </code>
  
-Install module (library)+Libraries: 
 +  * angular   
 +  * angular-bootstrap   
 +  * angular-wamp   
 +  * autobahn   
 +  * bootstrap   
 +  * jquery   
 +  * leafelet-bouncemarker   
 +  * leaflet   
 +  * Leaflet.label 
 + 
 +In __init__.py
 <code> <code>
-bower install ui-bootstrap+config.add_static_view('bower_components', 'bower_components', cache_max_age=3600)
 </code> </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 89: 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.1438683399.txt.gz
  • Last modified: 2015/08/04 12:16
  • by scipio