Fix paramater ordering for django,  Simplify parameter creation to a single place.

The test pass on base repository for this and I think it simplifies the code.

There is a bit of a hack due to python not allowing to change immutable variable on outer scope. 

This has not been tested for django yet, even though the fix was for it.