Skip to content

Instantly share code, notes, and snippets.

@viruthagiri
Last active September 28, 2017 16:23
Show Gist options
  • Select an option

  • Save viruthagiri/3012f4c7a09102b51112 to your computer and use it in GitHub Desktop.

Select an option

Save viruthagiri/3012f4c7a09102b51112 to your computer and use it in GitHub Desktop.
Auto import Django models into Pycharm Console
#Pycharm settings -> Project settings -> Console -> Django console
from django.db.models.loading import get_models
for m in get_models():
exec "from %s import %s" % (m.__module__, m.__name__)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment