DEV Community

Discussion on: Building my first Django project with CSS and Static Files

Collapse
 
wesleyjohnson profile image
Wes Johnson

Auto increment primary keys are fairly common, especially in small projects or projects that are internal. Larger projects or when you start exposing things to the public, it makes sense to consider UUIDs, or some other format, for your primary keys. You often don't want people guessing the IDs of other entities in your system, which is easy to do when they're sequential numbers. You can, of course, prevent access to things they're not supposed to have, but obscuring the keys makes it that much more secure.