Generating a non-sequential ID/PK for a Django Model
问题 I'm on the cusp of starting work on a new webapp. Part of this will give users pages that they can customise in a one to many relationship. These pages naturally need to have unique URLs. Left to its own devices, Django would normally assign a standard AUTOINCREMENT ID to a model. While this works fantastically, it doesn't look great and it also makes pages very predictable (something that isn't desired in this case). Rather than 1, 2, 3, 4 I would like set-length, randomly generated