Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python manage.py runserver --ipdb error #45

Open
wangzhaohe opened this issue May 5, 2018 · 3 comments
Open

python manage.py runserver --ipdb error #45

wangzhaohe opened this issue May 5, 2018 · 3 comments

Comments

@wangzhaohe
Copy link

(py36dj20) swot@pp:~/pp/zlhopesun$ python manage.py runserver --ipdb
Performing system checks...

System check identified no issues (0 silenced).
May 06, 2018 - 02:15:34
Django version 2.0.4, using settings 'XService.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

GET /custom_login/
function "LoginView" in generic/base.py:54
args: ()
kwargs: {}

/home/swot/venv/py36dj20/lib/python3.6/site-packages/IPython/frontend.py:21: ShimWarning: The top-level frontend package has been deprecated since IPython 1.0. All its subpackages have been moved to the top IPython level.
"All its subpackages have been moved to the top IPython level.", ShimWarning)
Internal Server Error: /custom_login/
Traceback (most recent call last):
File "/home/swot/venv/py36dj20/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner
response = get_response(request)
File "/home/swot/venv/py36dj20/lib/python3.6/site-packages/django/core/handlers/base.py", line 119, in _get_response
response = middleware_method(request, callback, callback_args, callback_kwargs)
File "/home/swot/venv/py36dj20/lib/python3.6/site-packages/django_pdb/middleware.py", line 83, in process_view
p = get_ipdb()
File "/home/swot/venv/py36dj20/lib/python3.6/site-packages/django_pdb/utils.py", line 15, in get_ipdb
return ipdb.main.Pdb(def_colors)
AttributeError: module 'ipdb.main' has no attribute 'Pdb'
[06/May/2018 02:19:18] "GET /custom_login/ HTTP/1.1" 500 82881
/home/swot/venv/py36dj20/lib/python3.6/site-packages/IPython/html.py:14: ShimWarning: The IPython.html package has been deprecated since IPython 4.0. You should import from notebook instead. IPython.html.widgets has moved to ipywidgets.
"IPython.html.widgets has moved to ipywidgets.", ShimWarning)

@HassenPy
Copy link
Owner

HassenPy commented May 6, 2018

hey there @wangzhaohe,
Thanks for reporting this, it turns out this happens when you use ipdb 0.11, to work around this you should use ipdb 0.10 for now, you can ignore the ShimWanrning too.
can you confirm this works with ipdb 0.10?

@wangzhaohe
Copy link
Author

It can run into ipdb shel now after pip install ipdb=0.10

But line 67 is not the view line. How can I go to my view line?
thanks!


GET /?ipdb
function "LoginView" in generic/base.py:54
args: ()
kwargs: {}

/home/swot/venv/py36dj20/lib/python3.6/site-packages/IPython/frontend.py:21: ShimWarning: The top-level frontend package has been deprecated since IPython 1.0. All its subpackages have been moved to the top IPython level.
"All its subpackages have been moved to the top IPython level.", ShimWarning)

/home/swot/venv/py36dj20/lib/python3.6/site-packages/django/core/handlers/base.py(67)make_view_atomic()
65
66 def make_view_atomic(self, view):
---> 67 non_atomic_requests = getattr(view, '_non_atomic_requests', set())
68 for db in connections.all():
69 if db.settings_dict['ATOMIC_REQUESTS'] and db.alias not in non_atomic_requests:

ipdb> /home/swot/venv/py36dj20/lib/python3.6/site-packages/IPython/html.py:14: ShimWarning: The IPython.html package has been deprecated since IPython 4.0. You should import from notebook instead. IPython.html.widgets has moved to ipywidgets.
"IPython.html.widgets has moved to ipywidgets.", ShimWarning)

ipdb>

@erny
Copy link

erny commented Sep 11, 2019

The attached fix to PR #49 from @gitaarik works for ipdb 0.12 and ipython 5.8. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants