This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

jinjaconfig

A jinja2 renderer receiving a JSON string from commandline. Useful for generating config files in deployment environments.

Installation

Install jinja config

pip install jinjaconfig

Install from sources

pip install git+https://bitbucket.org/luisfernando/jinjaconfig.git

Usage

usage: jinjaconfig [-h] --values [values] [file]

A jinja2 renderer receiving arguments from commandline. Useful for generating
config files in deployment enviroments

positional arguments:
  file               template to parse

optional arguments:
  -h, --help         show this help message and exit
  --values [values]  json encoded values

Basic Use

  1. Pass arguments from command line

    jinjaconfig example.conf --values="{"celery":{"task":"mytask","path":"/home/x/Env/myenv/bin/celery"},
    "num_procs":2,"user":"user","workdir":"/home/x/app/app/","logs":{"error":"/home/x/app/logs/err.log",
    "log":"/home/x/app/logs/log.log"}}"
    
  2. Pass arguments from a file (*NIX, Bash) and output to file

    jinjaconfig example.conf --values="`cat arguments.json`" > result.conf
    

example.conf

; ==================================
;  configuration example
; ==================================

[program:celery]
; Set full path to celery program if using virtualenv
command={{ celery.path }} worker -A {{ celery.task }}

directory={{ workdir }}
user={{ user }}
numprocs={{ num_procs }}
stdout_logfile={{ logs.log }}
stderr_logfile={{ logs.error }}
autostart=true
autorestart=true
startsecs=10

; Need to wait for currently executing tasks to finish at shutdown.
; Increase this if you have very long running tasks.
stopwaitsecs = 600

; When resorting to send SIGKILL to the program to terminate it
; send SIGKILL to its whole process group instead,
; taking care of its children as well.
killasgroup=true

; if rabbitmq is supervised, set its priority higher
; so it starts first
priority=998

arguments.json

{
   "celery" : {
      "task" : "mytask",
      "path" : "/home/x/Env/myenv/bin/celery"
   },
   "num_procs" : 2,
   "user" : "user",
   "workdir" : "/home/x/app/app/",
   "logs" : {
      "error" : "/home/x/app/logs/err.log",
      "log" : "/home/x/app/logs/log.log"
   }
}

Authors:

Release History

Release History

0.1.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
jinjaconfig-0.1.1.tar.gz (3.4 kB) Copy SHA256 Checksum SHA256 Source Aug 15, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting