Skip to content

Commit

Permalink
Merge pull request #128 from derektamsen/master
Browse files Browse the repository at this point in the history
adding ability to set custom app module load path for gunicorn
  • Loading branch information
stankevich committed Oct 11, 2014
2 parents b8cab1c + 81894f7 commit df3d734
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ Manages Gunicorn virtual hosts.

**environment** - Set ENVIRONMENT variable. Default: none

**appmodule** - Set the application module name for gunicorn to load when not using Django. Default: app:app

**template** - Which ERB template to use. Default: python/gunicorn.erb

```puppet
Expand All @@ -182,6 +184,7 @@ Manages Gunicorn virtual hosts.
dir => '/var/www/project1/current',
bind => 'unix:/tmp/gunicorn.socket',
environment => 'prod',
appmodule => 'app:app',
template => 'python/gunicorn.erb',
}
```
Expand Down
6 changes: 6 additions & 0 deletions manifests/gunicorn.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
# [*environment*]
# Set ENVIRONMENT variable. Default: none
#
# [*appmodule*]
# Set the application module name for gunicorn to load when not using Django.
# Default: app:app
#
# [*template*]
# Which ERB template to use. Default: python/gunicorn.erb
#
Expand All @@ -39,6 +43,7 @@
# environment => 'prod',
# owner => 'www-data',
# group => 'www-data',
# appmodule => 'app:app',
# template => 'python/gunicorn.erb',
# }
#
Expand All @@ -57,6 +62,7 @@
$environment = false,
$owner = 'www-data',
$group = 'www-data',
$appmodule = 'app:app',
$template = 'python/gunicorn.erb',
) {

Expand Down
2 changes: 1 addition & 1 deletion templates/gunicorn.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ CONFIG = {
'--workers=<%= @processorcount.to_i*2 %>',
'--timeout=30',
<% if @mode != 'django' -%>
'app:app',
'<%= @appmodule %>',
<% end -%>
),
}

0 comments on commit df3d734

Please sign in to comment.