Skip to content

Instantly share code, notes, and snippets.

@lorne-luo
Last active March 17, 2020 10:03
Show Gist options
  • Save lorne-luo/a0599713778f1bd9f6424e8e1855cd98 to your computer and use it in GitHub Desktop.
Save lorne-luo/a0599713778f1bd9f6424e8e1855cd98 to your computer and use it in GitHub Desktop.
django_extensions' shell_plus for Pycharm's python console
# open Pycharm settings->Build,Execution,Deployment->Console->Django Console
# 1.add env var: DJANGO_SETTINGS_MODULE -> settings.settings
# 2.copy below into Starting script
# open preferences->keymap->search `Python Console`->create new shortcut `cmd + 3`
from pprint import pprint
from django_extensions.management.shells import import_objects
from django.core.management.color import no_style
from datetime import datetime
globals().update(import_objects({"dont_load": [], "quiet_load": False}, no_style()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment