Skip to content

Commit a078a46

Browse files
committed
meinheld
1 parent 8f41a28 commit a078a46

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ crayons = "*"
1010
maya = "*"
1111
Flask-Compress = "*"
1212
Flask-Cache = "*"
13+
meinheld = "*"

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ if __name__ == "__main__":
2525
common.serve()
2626
```
2727

28-
Next:
28+
Next:
2929

30-
- Put a `favicon.ico` in your `static` folder.
30+
- Put a `favicon.ico` in your `static` folder.
3131
- Enjoy!
3232

3333
## Nicities
@@ -39,17 +39,17 @@ HTTP Headers:
3939

4040
Other nice things:
4141

42-
- `@common.cache.cached(timeout=50)` decorator for caching views in memory.
42+
- `@common.cache.cached(timeout=50)` decorator for caching views in memory.
4343
- Favicon support (`/favicon.ico` redirects to `/static/favicon.ico`).
4444

45-
## Web Server: Gunicorn
45+
## Web Server: Gunicorn + Meinheld
4646

47-
Automatically uses Gunicorn for production (when `Flask.debug = False`), Flask's dev server for development.
47+
Automatically uses Gunicorn + Meinheld for production (when `Flask.debug = False`), Flask's dev server for development.
4848

4949
Configuration environment variables:
5050

51-
- `WEB_CONCURRENCY` for specifying the number of synchronous gunicorn workers.
52-
- `PORT` for binding to a specific port.
51+
- `WEB_CONCURRENCY` for specifying the number of synchronous gunicorn workers.
52+
- `PORT` for binding to a specific port.
5353

5454
## File Server: WhiteNoise
5555

@@ -60,4 +60,4 @@ Flask-Common automatically configures [WhiteNoise](http://whitenoise.evans.io) t
6060
app.config['COMMON_FILESERVER_DISABLED'] = 1
6161
app.config['COMMON_POWERED_BY_DISABLED'] = 1
6262
app.config['COMMON_PROCESSED_TIME_DISABLED'] = 1
63-
63+

flask_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,6 @@ def serve(self, workers=None, **kwargs):
140140
print(crayons.yellow('Booting Gunicorn...'))
141141

142142
# Start the web server.
143-
server = GunicornServer(self.app, workers=workers or number_of_gunicorn_workers(), **kwargs)
143+
server = GunicornServer(self.app, workers=workers or number_of_gunicorn_workers(), worker_class='egg:meinheld#gunicorn_worker', **kwargs)
144144
server.run()
145145

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
'WhiteNoise',
3434
'crayons',
3535
'maya',
36-
'flask_cache'
36+
'flask_cache',
37+
'meinheld'
3738
],
3839
classifiers=[
3940
'Environment :: Web Environment',

0 commit comments

Comments
 (0)