summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorSergey Stankevich <sergey.stankevich@gmail.com>2012-09-09 18:36:30 -0400
committerSergey Stankevich <sergey.stankevich@gmail.com>2012-09-09 18:36:30 -0400
commited137893babebabdfdb5adf44d1a52272093ce8b (patch)
treef611108dc849fe8f4372aac981d7e242d59b957b /templates
Initial import
Diffstat (limited to 'templates')
-rw-r--r--templates/gunicorn.erb35
1 files changed, 35 insertions, 0 deletions
diff --git a/templates/gunicorn.erb b/templates/gunicorn.erb
new file mode 100644
index 0000000..2cf3eed
--- /dev/null
+++ b/templates/gunicorn.erb
@@ -0,0 +1,35 @@
+CONFIG = {
+<% if mode == 'django' -%>
+ 'mode': 'django',
+<% else -%>
+ 'mode': 'wsgi',
+<% end -%>
+<% if virtualenv -%>
+ 'environment': {
+<% if environment -%>
+ 'ENVIRONMENT': '<%= environment %>',
+<% end -%>
+ 'PYTHONPATH': '<%= virtualenv %>'
+ },
+<% end -%>
+ 'working_dir': '<%= dir %>',
+ 'user': 'www-data',
+ 'group': 'www-data',
+<% if virtualenv -%>
+ 'python': '<%= virtualenv %>/bin/python',
+<% else -%>
+ 'python': '/usr/bin/python',
+<% end -%>
+ 'args': (
+<% if !virtualenv and !bind -%>
+ '--bind=unix:/tmp/gunicorn-<%= name %>.socket',
+<% elsif virtualenv and !bind -%>
+ '--bind=unix:<%= virtualenv %>/<%= name %>.socket',
+<% else -%>
+ '--bind=<%= bind %>',
+<% end -%>
+ '--workers=<%= @processorcount.to_i*2 %>',
+ '--timeout=30',
+ 'app:app',
+ ),
+}