![]() ![]() Log.debug("Registering model ".format(_class._name_)) If _class._name_.startswith("Historical"): continue Log.debug("Logging has been initialized at DEBUG") Logging.basicConfig(format="%(levelname)-8s %(asctime)s %(name)s %(message)s", datefmt='%m/%d/%y %H:%M:%S', stream=sys.stdout )įrom import ObjectDoesNotExist, MultipleObjectsReturned Import django print('Django %s' % django.get_version()) import sys print('Python %s on %s' % (sys.version, sys.platform)) Finally, start the new Python Console instance.Īs django.db.models.get_models no longer exists, here's an updated version that will accomplish the same as Christopher Mason's version. Then make changes in Starting script window and apply. To make it work: open P圜harm settings ( CTRL+ S) and head to Django Console section. Installing IPython and changing the last two lines as below gets it done in the most proper way: from import get_ipythonįrom django_extension import load_ipython_extension Print('Django %s' % django.get_version()) ![]() Print('Python %s on %s' % (sys.version, sys.platform)) The code block below is the original Django Console starting script of P圜harm 2019.2: import sys, django ![]() I tried solutions proposed by others, but none of those appeared to solve this issue. I've been looking for a solution to the same problem, and I ended up here. Shell_plus automatically imports all Django model classes, among other things. It seems like the 'Starting script' happens in addition to rather than instead of the default. # appease pyflakes don't ever do this inįrom import execute_from_command_line # settings.py works but does mean some double importing. # settings_local.py, which is called from settings.py. # importing settings, but we usually tinker with sys.path in # The new Django 1.4 default manage.py wants "from django." before Os.tdefault("DJANGO_SETTINGS_MODULE", "settings") I've tried putting the text of the manage command in the 'Starting script' but then I get the folloiwingĭjango_manage_n("/Users/cmason/counsyl/code/website/counsyl/product") Is there a way for me to configure P圜harm to run shell_plus instead of the default shell? ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |