Last active
August 29, 2015 14:20
-
-
Save nicolasmendoza/cc7c7f211214079f9f5b to your computer and use it in GitHub Desktop.
Adding shell plus + pycharm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import logging | |
logging.basicConfig(format="%(levelname)-8s %(asctime)s %(name)s %(message)s", datefmt='%m/%d/%y %H:%M:%S', stream=sys.stdout ) | |
log = logging.getLogger("root") | |
from django.db.models import get_models | |
from django.conf import settings | |
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned | |
logging.config.dictConfig(settings.LOGGING) | |
log.debug("Logging has been initialized at DEBUG") | |
log.setLevel( logging.DEBUG) | |
log.disabled = False | |
for _class in get_models(): | |
if _class.__name__.startswith("Historical"): continue | |
log.debug("Registering model {}".format(_class.__name__)) | |
globals()[_class.__name__] = _class | |
def debug_sql(): | |
from debug_toolbar.management.commands import debugsqlshell | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment