Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAlx Ki
Python Web Development Techdegree Graduate 14,822 PointsDjango Debug Toolbar with PyCharm
- I installed django debug toolbar to virtual environment.
- I added debug-toolbar to INSTALLED_APPS after django.contrib.staticfiles.
- I added debug_toolbar.middleware.DebugToolbarMiddleware to MIDLEWARE as PyCharm said.
- I tried Django 1.9.6 and 1.10.4. Toolbar 1.6
No errors, no toolbar.
Please, help, Kenneth Love
Alx Ki
Python Web Development Techdegree Graduate 14,822 PointsJeff Muday Thank you for an answer, but unfortunately toolbar is still not appearing.. By the way which IDE do you use?
6 Answers
Jeff Muday
Treehouse Moderator 28,720 PointsI am using WingIDE Personal (paid version under $50). It compares favorably to PyCharm in terms of features and Django awareness, and (in my experience) has a snappier response on its various platform offerings (it works brilliantly as I frequently switch between computers and platforms while on the job and when I work from home). The Linux, Mac, and Windows versions have a nearly identical feel.
The free version of WingIDE 101 is not quite refined enough for a serious Django project, but does work.
Jeff Muday
Treehouse Moderator 28,720 PointsThose changes I suggested did work for me under PyCharm version 4.5.2
Jeff Muday
Treehouse Moderator 28,720 PointsBy the way, WingIDE Personal Edition, now in the 6.x version is FREE. It works great and has "Django awareness". Pycharm has improved quite a bit too from a year ago, but I still favor the Wingware offering.
mykolash
12,955 PointsHi fellows,
let me add just few words.
I've occurred such an issue just after debug_tools installing and setup (seems to be similar to yours):
Exception Type: TypeError
Exception Value: process() missing 1 required positional argument: 'stream'
And fixed it. Tried different debug_tool versions - it's NOT debug_tool issue. Seems to be it's SQLParse issue.
So, I did two things: (Working on Windows10 - but I guess it deals nothing w/ OS)
- Explicit setup of debug_tool: https://django-debug-toolbar.readthedocs.io/en/1.4/installation.html
- Reinstall SQLParse (I had "sqlparse==0.2.3"): (found same bug here: https://github.com/jazzband/django-debug-toolbar/issues/856)
pip uninstall sqlparse
pip install sqlparse==0.9
And that's it. Not sure was it explicit setup or sqlparse reinstall, but now I do have debug_tool panel on FrontEnd and I do NOT want to touch anything! o_O I've spent almost three hours (yep, I'm rookie!) scrutinizing this crippy issue. And it's enough!
No thanx! Just help some other django rookie like me when he/she will need it.
Nathan Partridge
52,420 PointsThanks, your fix of installing the different version of sqlparse worked. However, I found that there was no 0.9 version, but there was a 0.1.9 in the list of available versions that pip returned. So I assumed that some how .1 was left out and installed 0.1.9 which works.
Henrik Christensen
Python Web Development Techdegree Student 38,322 PointsWould you remove
INTERNAL_IPS= ['127.0.0.1']
if you put the project online?
mykolash
12,955 PointsMe personally, I guess yes.
But!
Not only this. DEBUG mode also should be disabled and many more stuff, I guess.
I think we need to ask @KennethLove to add such a course - "Deploying Django project live".
If you're interested - feel free to glance through DjangoGirls (you can notice its sticker on Kenneth's laptop) deploy chapter.
https://tutorial.djangogirls.org/en/deploy/
But, I would recommend you to pass it all from the very beginning - they use PythonAnywhere hosting service. It would take you few hours for all. Barely a day.
Henrik Christensen
Python Web Development Techdegree Student 38,322 PointsThank you very much for the quick respond :-)
I'm still working on my first real project, but I just like to know in advance :-P Yeah it would be nice to have such a course "Deploying Django Project Live".
Alx Ki
Python Web Development Techdegree Graduate 14,822 PointsHi, Henrik Christensen ! There are such workshops, where Kenneth Love explains step by step deploying Django with Heroku and Pythonanywhere! PythonAnyWhere Heroku
Douglas North
10,884 PointsI had a problem for ages but it's usually a silly human error. I was including it into my app urls file, not the main one xD Constantly learning from silly mistakes that cut away 20 minutes of your time.
Alx Ki
Python Web Development Techdegree Graduate 14,822 Pointsi can’t fix this
crisis of confidence questions career questions life
oh it was a typo, cool / stolen from some t-shirt
Attila Kószó
Courses Plus Student 9,312 PointsINTERNAL_IPS = ['127.0.0.1']
don't forget that line
Jeff Muday
Treehouse Moderator 28,720 PointsJeff Muday
Treehouse Moderator 28,720 PointsI am not using PyCharm. Though, I assume you might be hitting a similar snag I had in another IDE.
Captain Obvious (pointing at me) says make sure you install the debug toolbar.
$ pip install django_debug_toolbar
I had to do a couple of edits to the project files to ensure the toolbar worked.
learning_site/settings.py
Even after this, I got a namespace error too, so I had to add this into the urls.py
learning_site/urls.py
I hope this helps, Jeff