Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
django-deprecate-fields
Advanced tools
This package allows deprecating model fields and allows removing them in a backwards compatible manner.
pip install django-deprecate-fields
Assume the simple following model:
from django.db import models
class MyModel(models.Model):
field1 = models.CharField()
field2 = models.CharField()
In order to remove field1
, it should first be marked as deprecated:
from django.db import models
from django_deprecate_fields import deprecate_field
class MyModel(models.Model):
field1 = deprecate_field(models.CharField())
field2 = models.CharField()
Secondly, makemigrations
should be called, which will change the field to be nullable. Any lingering references to it
in your code will return None
(or optionally any value or callable passed to deprecate_field
as the
return_instead
argument)
Lastly, after the changes above have been deployed, field1
can then safely be removed in the model (plus another
makemigrations
run)
First of all, thank you very much for contributing to this project. Please base
your work on the master
branch and target master
in your pull request.
django-deprecate-fields
is released under the Apache 2.0 License.
FAQs
This package allows deprecating model fields and allows removing them in a backwards compatible manner.
We found that django-deprecate-fields demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.