[Django]-Django: better to save a slug to the DB or generate dynamically, if used for lookup?

4👍

I’d always save it to the database if it’s used for lookup: Broken URLs are to be avoided, just in case you need to change the placename. If later you need for any reason to change the slugification algorithm, at least old data won’t break. Etc.

If you need to change slugs later, you can at least deal with the migration while still having the old slugs saved.

👤chryss

Leave a comment