Tag « django »
Changing the primary key of a model in Django
I had to change the primary key of a django model, and I wanted to create a migration for this. The previous model was using django ids.
The migrations will need to do the following things:
- Create a new
uuid
field/column in the database - Iterate over the existing items …
Profiling and speeding up Django and Pytest
Éloi made a pull request on IHateMoney to speedup the tests, with some great tooling for pytest that I wasn’t aware of:
- pytest-xdist allows to run tests in
parallel, using
-n auto
- pytest-profiling makes it easy to get the call stack and time the function calls that take most …