123 Commits

Author SHA1 Message Date
Chris Streeter
7d64a5f44f Fix typo. 2013-11-24 21:52:27 -08:00
benoitc
3452379108 remove useless lines in example 2013-08-27 15:32:01 +02:00
benoitc
4e3428af0e add -e/--env command line argunment
This command line argunment allows someone to pass an environement variable to
gunicorn:

	$ gunicorn --env FOO=1 test:app

With the command line above the application will be able to use the FOO
environment vatriable.
2013-08-27 13:21:53 +02:00
benoitc
dc97e54412 handle io.BytesIO object with file_wrapper
fix #595
2013-08-27 11:45:32 +02: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
5e08c27495 improve STDOUT/STDERR logging redirection.
Instead of faking STDIN/STDERR to a fake object that we close on reopen,
simply redirect them to a file and reopen this one when need.

Should fix most of the issues on #309
2013-04-21 11:31:58 +02:00
benoitc
1198cc2723 handle ssl connections.
gunicorn is now supporting ssl connections:

    $ gunicorn -w3 --certfile=server.crt --keyfile=server.key test:app

works with all supported workers
2012-12-14 10:22:05 +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
91e7d138dc fix header encoding 2012-11-16 10:05:26 +01:00
benoitc
e4fbc805b6 fix error spotted by @andrewsg 2012-10-28 06:56:00 +01:00
benoitc
003c474fe2 handle bytes & native strings
This patch makes sure that we now handle correctly bytes and native
strings on python 3:

- In python 3, sockets are now taking and returning bytes.
- according to PEP3333, headers should be native strings and body in
  bytes.
2012-10-24 13:51:35 +02:00
benoitc
53ce50bc7b obvious syntax fixes preparing python3 support 2012-10-24 12:11:15 +02:00
benoitc
f47d100446 initialize the logging config file with defaults.
Set correct default to the logging config file so we are able to use our
own loggers. While I'm here fix the example.
2012-09-27 19:14:40 +02:00
benoitc
17ce6958e3 fix config example. close #388
The setting named changed. spotted by @boyxuper. Thanks!
2012-08-03 06:31:01 +02:00
benoitc
cdd3e1dc2b check parents if we are in the worker. fix #348 2012-06-27 08:08:57 +02:00
benoitc
ace4a0d6ec qdd development2.ini for tests 2012-06-24 15:42:55 +02:00
benoitc
12a0e55bcf Revert "fix issue #348 ."
This reverts commit da637dfd13b520fc190b86967dfecc06bf97a2b4.
2012-06-19 10:31:06 +02:00
benoitc
118c571898 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-04 21:17:11 +02:00
Christoph Heer
4b62182c48 Fix config file parameter "-C" to "-c" in examples/supervisor.conf 2012-06-01 08:13:04 +02:00
benoitc
6603ec551a fix django wsgi example
The wsgi file generated by django wasn't adding the project to
PYTHONPATH. This change fix it by detecting it based on the wsgi.py
path.
2012-05-15 10:24:39 +02:00
benoitc
f4ddf0f7a7 fix pylons example 2012-05-15 10:11:48 +02:00
benoitc
7a32616407 fixes gevent websocket example . close #343 2012-05-15 00:15:30 +02:00
CMGS
90e698aa3c support websocket hybi13 2012-05-15 00:15:30 +02:00
Benoit Chesneau
5f11713678 log HTTP errors in access log. close #317 2012-04-26 18:17:55 +02:00
benoitc
961eabb332 simplify the code 2012-03-16 21:10:44 +01:00
benoitc
1319543448 use the cached app. 2012-03-01 08:02:15 +01:00
benoitc
ce907348ef close #306 .
We badly called this function `start_server` when it should have been
`when_ready` .
2012-02-29 14:09:49 +01:00
benoitc
5a7c756a98 close #304 .
Intoduce a change in log access format:

- request headers are now added to the log format using the
  {HeaderName}i variable
- response headers are now handled using the {HeaderName}o variables
- headers name are insensitive
- non existent keys in the log access format are replaced by '-'
2012-02-25 14:44:38 +01:00
benoitc
f67993eb87 fix testing.
Note: it was also a good way to test HUP on master. worked like a charm.
2012-02-21 12:34:50 +01:00
benoitc
98f57f3daf add admin so we can test with SQL eventually 2012-02-20 22:17:36 +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
fd3fae1afd add app to test django 1.4 2012-02-19 22:09:32 +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
85c60c26b5 redirect stdout & stderr to logging error file when output is different
from '-' . Useful to collect some errors.
2012-02-19 16:07:51 +01:00
Randall Leeds
f02b0d9cca update longpoll examples
Add a longpoll example for tornado and terminate the lines we send with
a '\n'.
2011-11-07 17:14:37 -08:00
benoitc
3acf75338f add accesslog example 2011-09-28 12:36:43 +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
benoitc
66f7271c5f Use our own logger object to log events in gunicorn. While I'm here add
the possibility to manage an access log compatible with apache combined
log format. reopening files is also handled. Also, this change fix
issues #237 and #190.

For the sake of simplicity logging file have been removed

--logfile option has become --error-logfile, by default "-"

Following options have been added:

--access-logfile, the access log file path. By default None. If set
access logs will bre written to defined output

eg:

$ gunicorn -w3 --access-logfile=- test:app
2011-08-21 19:36:52 [84572] [INFO] Starting gunicorn 0.13.0
2011-08-21 19:36:52 [84572] [INFO] Listening at: http://127.0.0.1:8000
(84572)
2011-08-21 19:36:52 [84572] [INFO] Using worker: sync
2011-08-21 19:36:52 [84573] [INFO] Booting worker with pid: 84573
2011-08-21 19:36:52 [84574] [INFO] Booting worker with pid: 84574
2011-08-21 19:36:52 [84575] [INFO] Booting worker with pid: 84575
127.0.0.1 - - [21/Aug/2011:19:37:04] "GET / HTTP/1.1" 200 14 "-"
"curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r
zlib/1.2.5"
2011-08-21 21:08:58 +02:00
benoitc
17b47a376b get settings module name on fork rather than on app initialization. It
allows people to use relative path in their projects. fix issues #219,
and #213
2011-08-21 07:31:58 +02:00
benoitc
0f53a83f49 main problem of current run_gunicorn reload behaviour is that settings
aren't correctly reloaded. First attempt to remove it from sys.modules
introduced more problem than it solved.

This new attempt, just get the module, reload it and populate currently
loaded settings with new values.
2011-06-25 10:28:27 +02:00
Keegan Carruthers-Smith
133a85e4ee Updated docs to reflect the proper alternative syntax for specifying a worker class. 2011-06-25 09:19:05 +02:00
benoitc
76aef105d5 fix django example to work with 1.3 . 2011-05-18 18:22:55 +02:00
WoLpH
179b87639c removed python string formatting from logging to enable log message grouping 2011-05-11 23:11:36 +02:00
benoitc
c17f7230e8 refactor sendfile and add an example. 2011-05-11 23:11:02 +02:00
benoitc
fcab6bc144 after multiple attempts it's easier to just reload the app. People using
mange.py have to use USR2 signal if they want to upgrade the django
version instread of HUP. On the other hand, upgrading django version
with HUP is possible with gunicorn_django command.
2011-05-11 23:11:02 +02:00
benoitc
239010a476 update doc 2011-03-23 07:46:55 +01:00
benoitc
374bb7bfff add pyramid app example 2011-03-23 07:32:37 +01:00
Neil Chintomby
06987d3702 add server hook "on_starting" to allow socket patching to allow gevent worker reloading. 2011-03-14 23:28:33 -04:00
Justin Quick
76a0d7ae83 typo 2011-02-05 10:50:37 +08:00