How to Safely Upgrade a Package in Django (e.g., django-jalali from 1.0.2 to 2.0.0) Without Breaking Existing Code?
I'm currently working on upgrading an older Django project and I have both a specific and a general question about package upgrades.
🔍 Specific Question:
I’m using django-jalali-date==1.0.2
in one of my older projects, and I'd like to upgrade it to 2.0.0
because of some important improvements and features.
But before I do that, I want to be sure this won't break anything — especially in forms, models, templates, or static files ({{ form.media }}
, template filters like |to_jalali
, etc.).
So, how can I safely compare the two versions, test compatibility, and ensure everything keeps working as expected?
- Are there any known breaking changes between these versions?
- How can I verify if imports like
JalaliDateField
,AdminJalaliDateWidget
, or template tags still work? - Any advice on testing or migration steps would be great!
🔁 General Question:
More broadly, what’s the best way to safely upgrade any Python/Django package without risking regressions?
What strategies do you use when upgrading major versions (e.g., from v1.x.x
to v2.x.x
)?
For example:
- Do you manually check changelogs and diffs?
- Do you run tests or use tools like
pipdeptree
,pytest
, ordiff
tools? - Do you create a staging environment first?
- Any tips for checking backward compatibility (BC)?
I’d love to hear your experiences, tools, or workflows that help you manage package upgrades confidently.
Thanks in advance for your help! Any shared experience or checklist is highly appreciated.
Best regards,