Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WaYdotNET/3884dcbe868aa426fd5641e76ef4559b to your computer and use it in GitHub Desktop.
Save WaYdotNET/3884dcbe868aa426fd5641e76ef4559b to your computer and use it in GitHub Desktop.
Using `shell_plus` in pycharm django console
# 💡 NOTE: This only works if you are pretend to using `Django Console` feature in Pycharm
# Paste codes below into `Build, Execution, Deployment > Console > Django Console > Starting Script`
# requirements: `django_extensions`, `IPython`
import sys
import django
from IPython.core.getipython import get_ipython
from django_extensions.management.notebook_extension import load_ipython_extension
print('Python %s on %s' % (sys.version, sys.platform))
print('Django %s' % django.get_version())
sys.path.extend([WORKING_DIR_AND_PYTHON_PATHS])
if 'setup' in dir(django):
django.setup()
ipython = get_ipython()
load_ipython_extension(ipython)
# NOTE: If you don't use the autoreload feature, don't paste the three lines below
load_ipython_extension(ipython)
ipython.extension_manager.load_extension('autoreload')
ipython.magics_manager.registry['AutoreloadMagics'].autoreload('2')
@AmandaAccalai
Copy link

se non lo sai tu

@WaYdotNET
Copy link
Author

WaYdotNET commented Jul 22, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment