I am django developer recently starting with webapp2 project. My question is how do I enter into debugging mode in webapp2 application using ipdb package as we do in django and flask.
my app structure:
helloapp
- libs/
- stylesheets/
- templates/
- .gitignore
- app.yaml
- index.yaml
- main.py
- webapp2.py
I have installed ipdb in libs folder using
sudo pip install -t github_projects/hellowebapp2/libs ipdb
main.py
from .libs import ipdb
class HelloWebapp2(webapp2.RedirectHandler):
def get(self):
import ipdb; ipdb.set_trace()
Error
/home/kishan/github_projects/hellowebapp2/main.py
ERROR 2016-11-07 06:48:01,566 wsgi.py:263]
Traceback (most recent call last):
File "/usr/lib/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/usr/lib/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler
handler, path, err = LoadObject(self._handler)
File "/usr/lib/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 85, in LoadObject
obj = __import__(path[0])
File "/home/kishan/github_projects/hellowebapp2/main.py", line 12, in <module>
from .libs import ipdb
ValueError: Attempted relative import in non-package
Update
I followed this link now I get different error ImportError: No module named termios
:(