-
-
Save andrelcunha/fbb11b5064b00585ebaa5b7d728b2603 to your computer and use it in GitHub Desktop.
Use PyCharm community Python Console as Django Shell.
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
# Change the run script on `settings> Build Execution and Deployment > Console > Python Console` to | |
# hoping you have your settings at project/project/settings.py (if not, change accordingly;) | |
import os,sys,django;sys.path.extend([WORKING_DIR_AND_PYTHON_PATHS]) | |
os.environ['DJANGO_SETTINGS_MODULE'] = WORKING_DIR_AND_PYTHON_PATHS.split('/')[-1]+'.settings' | |
print('Python {0} on {1} using {2} as settings'.format(sys.version, sys.platform, os.environ['DJANGO_SETTINGS_MODULE'])) | |
django.setup() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment