114 Commits

Author SHA1 Message Date
wong2
bbd8b16b6f fix a typo 2013-10-09 16:43:49 +08:00
wong2
8a94f901bc remove unused import 2013-10-09 16:43:34 +08:00
benoitc
4a2eaf202c fix wsgiapp loading 2013-08-27 23:25:16 +02:00
benoitc
b6af364c79 add the --paste option and deprecate gunicorn_paster
Instead of having multiple command line just use the gunicorn one.
gunicorn_django is deprecated as well.
2013-08-27 23:16:35 +02:00
benoitc
f886d86b46 deprecate gunicorn_django 2013-08-27 21:17:33 +02:00
benoitc
bdec5975ef remove any notion of gunicorn in main WSGIApplication
if someone want to use a django application and load a specific module it is
better to use the --env option.
2013-08-27 20:38:49 +02:00
benoitc
82256a93a5 add --chdir option
chdir to specified directory before apps loading.

Ex:

	$ gunicorn --chdir ./examples test:app

fix #384
2013-08-27 16:52:49 +02:00
Randall Leeds
90fb09f618 Don't reload the paster app when run with pserve
Using gunicorn with paster command line causes the application to
load before gunicorn. In this case, there is no choice but to preload
the application. Document this fact.

Fixes #528.
2013-08-06 03:29:58 -07:00
Randall Leeds
cbc55843bd typo 2013-08-05 22:19:02 -07:00
Randall Leeds
ec2ee0b127 Support for python config file option in paster
It is now possible to specify a file with "config" as an application
configuration key in a paste deploy configuration file. This allows
paster applications to use the full range of gunicorn settings even
when using paste/pserve rather than gunicorn_paster.

Fixes #540.
2013-08-05 22:04:43 -07:00
benoitc
cd90653fe3 fix non django application loading
fix error introduced in 423e203db944ea5b250e2816cbeb9c4741cc736f.
2013-06-29 06:25:18 +02:00
Benoit Chesneau
a8ecbd5764 Merge pull request #551 from gauravkumar37/master
Fix to read the settings module specified while running via gunicorn command
2013-06-24 01:25:17 -07:00
Moriyoshi Koizumi
f5847a2a52 give the initial global_conf to loadcontext to initialize the context properly. 2013-06-24 09:26:59 +02:00
Jorge Niedbalski R
c218792fa4 prevent call get_default_config_file if args.config exists 2013-06-22 06:48:01 -07:00
Jorge Niedbalski
cf6e765323 [gunicorn] added ``gunicorn.conf.py`` as default in case of no -c is specified 2013-06-21 15:30:31 -03:00
Jorge Niedbalski
54b4ffb68e try to use cwd() + gunicorn.conf.py as default config if no file is specified . see #52 2013-06-17 16:44:02 -03:00
Gaurav Kumar
423e203db9 Fix to read the settings module specified by --settings or django_settings parameter 2013-06-17 22:15:46 +05:30
benoitc
cc7f595adc Enable stdio inheritance.
Enable inheritance for stdio file descriptors in daemon mode. It allows
you in daemon mode to redirect the output to a file if needed.

By default in daemon mode gunicorn will close all file handle except if
you pass the "-R" options. In this cases STDIO will be preserved.

fix #309
2013-04-23 16:23:46 +02:00
benoitc
c31e0f9ac7 Exit when the config file isn't found.
fix #469
2013-04-21 07:40:06 +02:00
benoitc
038ae7a86c add dd `python -m gunicorn.app.wsgiapp`` support
fix #493
2013-04-21 07:03:59 +02:00
Chris Streeter
e908ec3359 Consistently get CWD across apps and arbiter.
The Arbiter is smart about getting the CWD; first it checks the CWD
environment (which doesn't resolve symlinks), then it falls back to the
python os.getcwd() (which does resolve symlinks). However, the Arbiter
is the only place that does this, which will then do the right thing
when we reexec. However, when reloading the Arbiter, it won't pick up
changes if the symlink has changed.

By changing the *app.py entry points to also use the same method for
determining the CWD, we'll insert a symlink path into the first location
in sys.path. Then our reloaded app will correctly pull in any new
changes.
2013-04-03 11:15:53 +02:00
benoitc
78478de364 fix pythonpath option.
fix #501
2013-04-03 11:09:12 +02:00
Chris Streeter
25283ea262 Fix a Typo 2013-02-19 18:18:41 -08:00
benoitc
dae4d38705 add syslog support.
Add options to setup logging to syslog:

- `--log-syslog`: enable syslog. It default to `/var/run/syslog` on darwin,
  `/var/run/log` on freebsd, `/dev/log` on openbsd and udp://localhost:514 for
  other platforms.
- `--log-syslog-prefix: Pass the parameter to use as the program name
- `--log-syslog-to`: Setup the syslog address to send message. Address startinf
  by udp:// will send to udp, unix:// to a unix socket and tcp:// to tcp (useful
  for rsyslog)

fix #452 .
2012-12-25 06:19:06 +01:00
benoitc
ac1af72922 s/optparse/argparse 2012-12-25 06:19:06 +01:00
Adnane Belmadiaf
20cd49595a PEP8 fixes 2012-12-24 09:53:03 +01:00
benoitc
b7b51adf13 allows gunicorn to bind to multiple address
Allows gunicorn to listen on different interface. It can be either ipv6,
unix or ipv4 sockets.

Ex:

    gunicorn -w3 -b 127.0.0.1:8001 -b 127.0.0.1:8000 -b [::1]:8000 test:app

fix #444
2012-12-14 10:18:39 +01:00
benoitc
f724c53e17 make sure to add the current dir to sys.path as well. close #322 2012-11-19 08:33:05 +01:00
benoitc
9fb0d9669c expose --pythonpath command to all modes . fix #433
--pythonpath may also be useful in other commands, so expose it to all.
2012-11-07 09:52:49 +01:00
benoitc
d06380d1f0 fix module detection. fix #322
Gunicorn has now the possibility to directly pass the settings env as
argument but it was breaking the old way to do it when giving a path to
the settings file instead.
2012-11-06 05:51:57 +01:00
benoitc
8d453fb341 all tests pass under python 3 2012-10-24 22:07:35 +02:00
benoitc
60644b12af miscellaneous fixes 2012-10-24 14:24:19 +02:00
benoitc
53ce50bc7b obvious syntax fixes preparing python3 support 2012-10-24 12:11:15 +02:00
benoitc
fad7353d51 allows gunicorn to load a pre-compiled app. close #316
Patch adapted from the one submitted from @rbdrbd with a small change to
reuse the code.
2012-08-26 21:46:20 +02:00
benoitc
2cdc7a9cfb always load the application if possible. fix #358 2012-06-01 08:34:18 +02:00
benoitc
5e37c89017 don't try to set the script as the process group. fix #355
Setting gunicorn as the process group prevent exit from the shell.
2012-05-25 13:40:29 +02:00
benoitc
1faea03263 found the settings file in eahc nested folders. Fix issue #340 2012-05-16 08:45:35 +02:00
benoitc
8835b5f04d break immediately if we found the project path. 2012-05-16 08:23:07 +02:00
benoitc
1efb622938 the app was initialized 2 times. close #324
thanks @fafhrd91 for the diff
2012-05-15 00:21:43 +02:00
benoitc
da11bce9a7 detect if AdminHandler can be imported. close #333 2012-05-14 23:17:12 +02:00
Benoit Chesneau
6cffb5b473 no mre AdminMediaHandler class in django 1.4 . close #333 2012-04-17 14:07:36 +02:00
benoitc
fa341c6531 pyflakes pass. 2012-02-21 14:53:17 +01:00
benoitc
3902729ff8 remove spurious print. 2012-02-21 14:26:05 +01:00
benoitc
161c8c03cb monkey patch django. close #293 .
This patch make sure that we use real threads to get the ident which is
going to happen if we are using gevent or eventlet.
2012-02-21 14:24:55 +01:00
benoitc
cc26270783 close #170 .
add --check-config option to check the config and app loading.
2012-02-20 11:13:59 +01:00
benoitc
cc43f89ef5 compatibility with django 1.4 and more related fixes.
- handle new way to launch applications in django 1.4
- simplify the way we discover the project path and settings
- add --pythonpath & --settings options for django applications
- still compatible with older versions (>=1.1)
-handle DJANGO_SETTINGS_MODULE env.

close #283, #275, #274, #241
2012-02-19 21:56:41 +01:00
benoitc
f168a21dae fix whitespaces 2012-02-19 11:27:46 +01:00
Kristian Øllegaard
ba730b1f18 In reload_django_settings "re" is used, but not imported.
fix issue #250. Thanks!
2011-09-15 22:13:55 +02:00
Kristian Øllegaard
e8aaf84c63 A fix to make the newest gunicorn work with older projects, that doesn't have LOGGING_CONFIG 2011-09-08 10:54:57 +02:00
benoitc
428c7a3b5e put back logging confing in gunicorn_paster. spotted by @oit on github.
thanks!
2011-08-22 09:45:06 +02:00