-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
optparse.make_option method is deprecated in Django 1.10 #75
Comments
Doesn't it break backward-compatibility? Looks like it did. Because @bctiemann do you know recommended way to check Django version and depending on it define or not define attributes and functions? |
I'm not sure if there's a canonical way, but what if you check whether the add_arguments method is defined in the BaseCommand superclass? |
@bctiemann thanks for your suggestion! |
Django 1.10 has now been released, and this issue no longer is a deprecation warning; it breaks django-cron on Django 1.10. Upon running the
Could a fixed release be made available? That would be greatly appreciated! BTW, it seems to be common to check Django's version using if django.get_version().split('.') < ['1', '10']:
# old version friendly code
else:
# new version friendly code |
@akhayyat - acknowledged and we'll work on a fix asap. |
The fix is deployed https://pypi.python.org/pypi/django-cron/ |
Works perfectly! Thank you very much for the prompt resolution. |
Running runcrons:
.../venv/lib/python2.7/site-packages/django/core/management/base.py:265: RemovedInDjango110Warning: OptionParser usage for Django management commands is deprecated, use ArgumentParser instead
RemovedInDjango110Warning)
Looks like all you need to do is replace the "option_list" block at the top of the Command class with:
The text was updated successfully, but these errors were encountered: