DjangoAdminHackers / django-linkcheck

An app that will analyze and report on links in any model that you register with it. Links can be bare (urls or image and file fields) or embedded in HTML (linkcheck handles the parsing). It's fairly easy to override methods of the Linkcheck object should you need to do anything more complicated (like generate URLs from slug fields etc).
BSD 3-Clause "New" or "Revised" License
75 stars 26 forks source link

Document change of `MAX_URL_LENGTH` setting #139

Open timobrembeck opened 1 year ago

timobrembeck commented 1 year ago

Changing the MAX_URL_LENGTH setting requires a database migration of the Url model. Since this is not completely straight forward (or am I missing something?), I would add the recommended workflow for this to the README.

Similar as described in #137, I see two ways of dealing with this:

Since both options don't seem ideal to me, I think we could also think about setting a sensible (?) but fixed value and don't allow this value to be configured?

claudep commented 1 year ago

I guess the basic issue is that the maximum possible length depends on the database backend, particularly with MySQL which have issues with longer lengths (https://docs.djangoproject.com/en/4.1/ref/databases/#character-fields). Same MySQL issue if we'd like to make it a TextField, due to unique=True.

As per the monkeypatching described above, there is https://docs.djangoproject.com/en/4.1/ref/settings/#std-setting-MIGRATION_MODULES.