I'm trying out django-template-repl for debugging a template issue and it's pretty awesome.
One of the features of the tool is that you can go:
python manage.py templateshell -u /admin/
and pull up the context for that url location.
Unfortunately no matter what configuration of /admin/ or other urls in my site I try to pull up, I always get
/Library/Python/2.6/site-packages/template_repl/utils.py(11)pdb_with_context()->None
I am running it with the optional --pdb flag to see if I'm getting context in. And oh, my tab completion doesn't work either. :(
Any ideas on what I'm doing wrong? Thanks in advance
Finally got around to trying the solution codysoyland put up in the comments section. Sure enough, you need to have ipdb installed for this functionality to work. Now it works great.
Related
I have a situation where I get Chrome's performance logs after running some automated tests. Then I parse it with a script I made to get a HAR file (http://www.softwareishard.com/blog/har-12-spec/).
Everything runs works correctly most of the times, but every now and then I get a request that has no answer (whether I stopped the page loading before it gets complete, or something else). I tried leaving the "response" object blank for this request, but this is required. After that, I tried removing the object, but it is required too.
What should I do in those cases? Can anyone advice?
Well, after some debug i found out that requests that have no answer do not go to HAR. At least that is what WebPageTest does and what I did.
I am trying to log into a site,
https://www.telenor.no/privat/minesider/logginnfelles.cms?skin=telenor, with my user credentials. That site then redirects to https://www.telenor.no/privat/minesider/minside/minSide.cms.
I have tried all the different propsed solutions that I have found, but nothing has worked so far.. Is there someone out there that has a solution? Would be greatly appreciated!
Not sure how your attempting to log into the website, but here's an article that shows how it's done in python. Maybe post your code on here so we can get an idea of what's going on.
How can I login to a website with Python?
I looked for it for a while without being able to find a single solution.
And I am using nephila django-cms blog. Thus when I edit an article content with ckeditor I can select my youtube plugin and add it.
10% of the time it works. Lol. The rest of time I have a browser error and this :
File "/var/www/webapps/lib/python3.4/site-packages/treebeard/mp_tree.py",
line 359, in process
newobj.path = self.node.get_last_child()._inc_path()
AttributeError: 'NoneType' object has no attribute '_inc_path'
And it happens when I click on the plugin. It doesn't even have time to show up.
Does someone has any clue about it ?
EDIT: I change a bit the problem since I can't use any plugin that I included with CKEditor.
EDIT 2: if it can help, here the detail returning by the server :
"POST /en/admin/djangocms_blog/post/add-plugin/ HTTP/1.1" 500 59276
EDIT 3: If anyone has any idea about a way of debugging it, I would take it. Just so you know, I wasn't coding when it happened. The project is very big and since it happens internally with CKEditor I am completely stuck.
I believe we solved this through the github issues.
The fix was to upgrade to djangocms-text-ckeditor 2.7.1 (latest 2.7 release).
This is first question here and I will try to follow the guidelines to the best of my understanding. ( Also, English is not my first language )
I made a little project using Django, a job search website and i'm running it with DEBUG set to True ( not advised I know, but I wanted to know the cause if anything went wrong )
The admin section and homepage ( and another one ) are working correctly, but the search page gives me a 400 error page. Bad Request (400).
The only difference with the other working page is that the search contains a form. The "heroku logs" doesnt give more detail about the error. Any advice about where I should look for the cause of the problem ?
Everything works correctly locally, I only get the 400 error once it's pushed on heroku. Help ?
As requested, Here are the urls of the search page:
url(r'^search/$',search,name="job-search"), #I use this to collect the search parameter
url(r'^search/(?P<domain>\w+)/(?P<level>\w+)/$',results,name="job-result"), # **Where the 400 error happens** , this is the result page
Make sure your method has some decorator that prevents access to it, like: #ajax_required
Hey,
I've been using Django 1.2.1 for some time now and came across Django Debug Toolbar just the other day. It looks really useful and I'm really eager to try some stuff out.
I installed exactly how the readme said. Step by Step. I put the middleware at the end just in case things get caught up but I'm using quite standard middleware (common, sessions, auth and csrf). However, it won't show up on any of my pages. I've tried moving the middleware but to the same effect.
It seems as if I've installed something wrong. But, when I load up the Admin Section of django, the toolbar springs up. I'm not sure what I'm doing wrong. Can the content of my pages effect the toolbar coming up? It's outputting in the mime text/html...
Anyway, any help is greatly appreciated. Thanks in advance.
Here's my Settings.py: pastebin.com/Hu8TgANt
Debug toolbar requires that there's at least a closing </body> tag in the response HTML.
This tag can be changed by changing settings.DEBUG_TOOLBAR_CONFIG['INSERT_BEFORE']
http://django-debug-toolbar.readthedocs.org/en/latest/configuration.html#toolbar-options
A few tipps without knowing your code:
'debug_toolbar.middleware.DebugToolbarMiddleware' should be your last or second to last middle ware entry (not 100% sure how it works out with the flatpagefallback middleware)
'debug-toolbar' as last in the list of INSTALLED_APPS
Double check if the toolbar's assets are loaded
Make sure all toolbar settings are set. (DEBUG_TOOLBAR_CONFIG, INTERNAL_IPS) etc.
The error should be something in there. I know of other problems related getting the toolbar displayed on flatpages so if you only checked on flatpages I suggest you try it on another module.
I had the same problem here, and eventually arrived at this post... Anyway, in my case what I noticed was that I had a javascript error in one of my js included libraries. And that breaked the js interpretation flow. When I fixed the javascript error, the django toolbar worked.
That explains why it worked in the admin pages, but not in my app pages.
Missing INTERNAL_IPS key in settings.py impacts toolbar visibility. Adding this resolves the issue:
INTERNAL_IPS = ('127.0.0.1',)
In my case, I was using Google Material Design Lite as the frontend framework,
which has the style definition,
*[hidden]{
display:none!important;
}
this style is applied to Debug Toolbar's elements which result in displaying nothing.
a quick workaround was to change the MDL's style definition (only possible on local stylesheets, not with cdn hosted) to
*[hidden]{
display:none;
}
I had a similar issue. The solution was closing a div as a non-empty HTML element.
From this
<body>
...
<div id="map-canvas"/>
...
</body>
to this
<body>
...
<div id="map-canvas"></div>
...
</body>
Hope it helps!
In my case the error was very simple.
I removed the footer and it worked like a charm!
Hope this solves an issue for somebody else.