optparse.make_option method is deprecated in Django 1.10
See original GitHub issueRunning 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:
def add_arguments(self, parser):
parser.add_argument('--force', action='store_true', help='Force cron runs')
parser.add_argument('--silent', action='store_true', help='Do not push any message on console')
Issue Analytics
- State:
- Created 8 years ago
- Reactions:2
- Comments:7 (2 by maintainers)
Top Results From Across the Web
optparse — Parser for command line options
Deprecated since version 3.2: The optparse module is deprecated and will not be developed further; development will continue with the argparse module.
Read more >Django Deprecation Timeline
This document outlines when various pieces of Django will be removed or altered in a backward incompatible way, following their deprecation, ...
Read more >Django: Support for string view arguments to url() is ...
Django : Support for string view arguments to url() is deprecated and will be removed in Django 1.10 · Welcome to stack overflow....
Read more >optparse: Command Line Option Parser
This function is used to create an instance of a parser object which when combined with the parse_args, make_option, and add_option methods is...
Read more >https://mirrors.zju.edu.cn/opensuse/history/202001...
This change affects the following SSHClientConnection methods: ... Update to 1.9.2: * Prevented deprecation warnings with Django 3.0.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Works perfectly! Thank you very much for the prompt resolution.
The fix is deployed https://pypi.python.org/pypi/django-cron/