103 Commits

Author SHA1 Message Date
benoitc
da637dfd13 fix issue #348 .
Rather than testing the parent pd, test if the parent pid is still
alive. Only use it in gevent for now.
2012-06-14 22:56:58 +02:00
Benoit Chesneau
4b59fc351f fix typo 2012-04-26 18:30:01 +02:00
Benoit Chesneau
5f11713678 log HTTP errors in access log. close #317 2012-04-26 18:17:55 +02:00
Wojtek
62ee0859bc fixed random number generation in case of urandom absence 2012-04-12 13:46:51 +02:00
Maxim Kamenkov
16eb657584 Added "validate_class" option validator.
Now you able to use existed type instance or factory method to create and customize class during in-code configuration.

E.g.:
>>> settings.set('worker_class', MyWorkerClass)
>>> settings.set('worker_class', lambda: MyWorkerClass)

All other formats still valid.
2012-03-16 05:52:25 +01:00
benoitc
8e185d38d0 shouldn't be here. 2012-02-19 22:11:39 +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
cc99181cee logging.fileConfig support is back. 2012-02-19 17:07:42 +01:00
benoitc
f168a21dae fix whitespaces 2012-02-19 11:27:46 +01:00
Randall Leeds
0c4021d169 fix #262: typo krange -> xrange 2011-09-22 14:09:33 -04:00
Randall Leeds
6bac0216aa add util.closerange using os module or fallback 2011-09-19 13:42:07 -07:00
benoitc
824801d017 make the Logger pluggable. Allows people to use their own logger by
giving to gunicorn an entry point or a module path.
2011-09-09 00:43:00 +02:00
Paul J. Davis
7ffa097cf7 Use split (not rsplit) to separate MOD:APP info. 2011-06-02 09:17:59 -04:00
Dan Sully
4f96ccedc1 Catch ctypes import errors. 2011-03-23 07:37:40 +01:00
Alex Robbins
974698671a Moved the random seed method into a function.
Added a try/except block to catch NotImplementedErrors for platforms
that don't support urandom.
2011-03-14 23:10:09 -04:00
benoitc
c21578df40 ctypes triggers selinux execmem denial
https://bugzilla.redhat.com/show_bug.cgi?id=488396

fix issue #168. Thanks!
2011-03-06 10:14:52 +01:00
benoitc
7dd7b71523 patch from @davisp, ease the code. 2011-02-25 08:47:46 +01:00
Paul J. Davis
885b530e1a Always log exceptions during request handling.
* Always log the exception locally
  * Still only pass the exception in the HTTP response if
    debug is turned on.
  * Slight cosmetic changes to the actual HTML of the error
    response.
2011-01-29 14:43:18 -05:00
benoitc
cd726f6d8c fix issue #142. Thanks 2011-01-04 09:42:49 +01:00
benoitc
a8e34ac16c send appropriate error status on http parsing. Fix issue #132. 2010-12-12 14:16:31 +01:00
benoitc
53ec6b02a5 split is enough 2010-11-20 22:01:12 +01:00
benoitc
09e243d6f6 ipv6 support in gunicorn. fix ticket #107. 2010-11-20 21:04:03 +01:00
benoitc
bc2d0112a8 use only git shorttag with 'develop' command, also don'ty load it each
time. spotted by @davisp .
2010-11-10 19:28:18 +01:00
benoitc
2ad2a61f0c fix issue #104. 2010-10-29 05:58:09 +02:00
Paul J. Davis
006a8b6e9d Drop Server and Date headers in start_response.
We now treat Server and Date headers as hop-by-hop headers (ie, drop them)
so that they aren't repeated. While not technically hop-by-hop, the WSGI
spec says we should take the role of an origin server.

Fixes #79
2010-08-12 16:11:45 -04:00
benoitc
5108a720f2 use a specific release number for dev depending on git tag 2010-07-31 16:18:13 +02:00
Benoit Chesneau
aca70fbec8 allows worker_class uri shortcut. It's now possible to do :
gunicorn -w 3 -k gevent test:app

ie. removing the need of using egg:gunicorn before.
2010-07-23 10:57:21 +02:00
Paul J. Davis
3ad7c1b395 Make WSGI app names are now evaled in the module namespace.
This allows people to pass info from the command line to a WSGI
application. See examples/alt_spec.py for code that uses this
method. Example invocation:

    $ gunicorn 'alt_spec:load("my arg here")'

Notice the single quotes to avoid shell escape semantics.

Closes #56
Closes #40
2010-07-08 00:12:15 -04:00
benoitc
f8fac58d73 some fixes discovered with pyflakes 2010-05-23 00:44:53 +02:00
Paul J. Davis
036f8b50d9 Major refactor of the configuration mechanics.
* All configuration and bootup is handled by the Application objects.

* There is now a strict ordering on the precedence of configuration
settings:

  1. Each option is given a default value of some sort in options.ini

  2. Any detectable framework configuration settings override the hard
     coded defaults for options. Currently, only Paster applications
     have support for this.

  3. Anything that is specified in a Gunicorn configuration file (by
     default gunicorn.conf.py) overrides what was possibly set by a
     framework specific configuration source.

  4. Anything specified on the command line reins supreme. The command
     line is the final authority on a given configuration option.
     Though, not all configuration options are available via command
     line.

* Configuration metadata is pulled from an options.ini. In the future I'll
use this to build the example gunicorn.conf.py and the config.rst file
in docs/site/config.rst.

I haven't tested the differences thoroughly. The next item on my agenda
is to figure out a way to start testing Gunicorn that doesn't make my
eyes bleed.
2010-05-19 13:39:37 -04:00
Paul J. Davis
0c935d06c7 Got the Sync and Eventlet workers running. 2010-04-15 21:20:17 -04:00
Paul J. Davis
51f1f22665 Refactoring worker code.
Also went through gunicorn.main lightly.
2010-04-15 20:08:28 -04:00
Paul J. Davis
014d711bd7 Fix PEP 333 compliance for the write callable. 2010-03-23 14:58:10 -04:00
benoitc
d63b6015ef useless line, and handle only ValueError 2010-03-17 01:10:10 +01:00
benoitc
06d58ae1c4 oups revert this change in util 2010-03-16 22:15:32 +01:00
benoitc
23927f39b1 allows custom arbiter 2010-03-16 22:12:26 +01:00
Paul J. Davis
61a84eece3 Be more considerate to future me.
Sergey points out that its more proper to |= with the current value of
the fd flags. I concur.
2010-03-15 22:59:26 -04:00
Paul J. Davis
09b5dd2ad1 Fix close_on_exec bug.
Reported by Sergey Shepelev. I changed his patch slightly because of the
man page language. As I read things, the close on exec flag is separate
from the F_SETFL flags.
2010-03-15 22:12:54 -04:00
benoitc
c785be0780 new parser using StringIO, faster than concatenate strings. Lot of fixes
in TeeInput.
2010-03-06 20:47:39 +01:00
benoitc
54d1a8a5dc fix iter 2010-03-05 18:20:58 +01:00
benoitc
c67800e1c7 I don't see any good reason to keep Status here. Also since we are
HTTP/1.1 make sure to use correct status line
2010-03-04 19:46:38 +01:00
benoitc
4a56af4a2b typo. 2010-03-04 19:29:22 +01:00
benoitc
8622604f44 remove race condition 2010-03-04 19:23:37 +01:00
benoitc
6ca87c5cf4 right length 2010-03-04 18:58:27 +01:00
benoitc
77ea9ea78a recv_info seems slower that just concatening string. let's create a
branch to test it.
2010-03-04 18:48:39 +01:00
benoitc
a0d8a16b86 improve read_partial 2010-03-04 18:07:45 +01:00
benoitc
6deeeecc80 clean the code 2010-03-01 08:57:46 +01:00
benoitc
49c02c8c4c fix chunked encoding. It's ok now but we need unitests 2010-03-01 01:03:24 +01:00
benoitc
29fd1cf48f empty line 2010-02-28 22:46:35 +01:00
benoitc
d92364af71 new read_partial function. We also now use buffer in parser. 2010-02-28 22:46:35 +01:00