Category Archives: Tech

Organizing Django Tests into Folders

Django comes with a nice testing  rig that lets you individually test each app.  By using a combination of pyunit & Django’s testing tools, you’ll be able to whip up a testing suite for each of your site’s apps (more information here: http://docs.djangoproject.com/en/dev/topics/testing/) However there is some strangeness as to how Django expects the tests to [...]
Also posted in Django, python | Tagged , , , | Leave a comment

Django Unit Test Failure in auth Package

We’ve been using the django.contrib.auth app to handle all of our user login/logout/registration/etc. needs, and it has worked great for us so far.  However, when we tried to run the unit tests for our project we found 10 or so errors with regards to the auth package itself. At first, I thought it was because we [...]
Also posted in Django | Tagged , , , , , | Leave a comment

Confirm Password Change

I was working with Django’s view.password_change today when I encountered the dialog box above.  As far as I could tell all of my information was being passed to Django correctly; but for reasons unknown to me I was still getting this “Confirm Password Change” message. After a bit of Googling, I found out that this is [...]
Posted in Tech | Tagged , , | Leave a comment

Incomplete Execution of Callbacks on JQuery POST

In JQuery, you can use the $.post() function to make a client-side AJAX request (more info here). If you want to POST JSON objects to your server, you basically want to do something like this: $.post( URL, [data], [CALLBACK FUNCTION], "json") In the project that I’m working on, I’m rendering a table using JQuery + DataTables plugin. [...]
Also posted in Javascript | Tagged , , , , , , | Leave a comment

Passing Parameters to a Function on HTML Events

Let’s say I have some function foo that needs to be called when some HTML element is clicked: function foo(a, b) { : : : } : i = 100; j = 200; element.setAttribute("onclick", "foo(i, j)"); In the example above, the Javascript interperter will see the line element.setAttribute("onclick", "foo(i, j)"); and automatically figure [...]
Also posted in Javascript | Tagged , , , , , , , | Leave a comment