question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

optparse.make_option method is deprecated in Django 1.10

See original GitHub issue

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:

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:closed
  • Created 8 years ago
  • Reactions:2
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
akhayyatcommented, Sep 14, 2016

Works perfectly! Thank you very much for the prompt resolution.

1reaction
maxim-khtcommented, Sep 14, 2016
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found