Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
earlgrey0103 committed Oct 26, 2015
1 parent 742840c commit fa3517d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
6 changes: 6 additions & 0 deletions codingpy.ini
Expand Up @@ -7,6 +7,12 @@ callable = application
gevent = 100
master = true
processes = 5
async = 100

# destroy workers blocked for more than 30 seconds
harakiri = 30

memory-report = true

socket = /tmp/codingpy.sock
chmod-socket = 660
Expand Down
7 changes: 3 additions & 4 deletions codingpy/_base.py
Expand Up @@ -3,12 +3,10 @@

# import os
# import sys
from gevent import monkey

monkey.patch_all()

from flask import Flask, send_from_directory, render_template
from flask_wtf.csrf import CsrfProtect
from flask_debugtoolbar import DebugToolbarExtension
# from flask.ext.login import logout_user, current_user

# from .models import User, AnonymousUser
Expand All @@ -20,7 +18,7 @@
__all__ = ['create_app']

csrf = CsrfProtect()
# toolbar = DebugToolbarExtension()
toolbar = DebugToolbarExtension()


def create_app(config_name):
Expand All @@ -33,6 +31,7 @@ def create_app(config_name):
mail.init_app(app)
moment.init_app(app)
csrf.init_app(app)
toolbar.init_app(app)

cache.init_app(app)
bcrypt.init_app(app)
Expand Down
2 changes: 1 addition & 1 deletion codingpy/config.py
Expand Up @@ -11,7 +11,7 @@
class Config:
SITE_NAME = 'codingpy'
SECRET_KEY = os.urandom(32)
# DEBUG_TB_INTERCEPT_REDIRECTS = False
DEBUG_TB_INTERCEPT_REDIRECTS = False

# 是否启用博客模式
# BLOG_MODE = True
Expand Down
4 changes: 0 additions & 4 deletions manage.py
Expand Up @@ -3,10 +3,6 @@
import os
# import sys

from gevent import monkey

monkey.patch_all()

from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand
from flask.ext.assets import Environment, Bundle
Expand Down
4 changes: 4 additions & 0 deletions wsgi.py
@@ -1,6 +1,10 @@
#!usr/bin/env python
# -*- coding: utf-8 -*-

from gevent import monkey

monkey.patch_all()

from gevent.wsgi import WSGIServer
import logging
from logging.handlers import RotatingFileHandler
Expand Down

0 comments on commit fa3517d

Please sign in to comment.