It seems to me that the `ImportError` can safely be caught so that core
commands that don't need settings can be executed. If the settings are
accessed later on (either because the command
[https://github.com/django/django/blob/abaf0ab4a444977dc8ac07b9b63256814c352245/django/core/management/__init__.py#L198
can't be found] or the command uses the settings), the `ImportError` will
be reraised.
--
Ticket URL: <https://code.djangoproject.com/ticket/28791>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Hrishikesh Barman):
Hi Marten,
This seems like a valid enhancement to me. I reproduced the bug and is
valid.
Can I start contributing to this?
I have a question, how do I test if my changes work? Do I have to install
the cloned and modified django everytime I make a modification?
Also, how to go about writing tests for this?
--
Ticket URL: <https://code.djangoproject.com/ticket/28791#comment:1>
* cc: Hrishikesh Barman (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/28791#comment:2>
* type: Bug => Cleanup/optimization
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/28791#comment:3>
* cc: Adam (Chainz) Johnson (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/28791#comment:4>
* owner: nobody => Hrishikesh Barman
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/28791#comment:5>
Comment (by Hrishikesh Barman):
I've sent a pull request for this ticket,
https://github.com/django/django/pull/9367
It's failing a flake8 test, I ran the tests locally.
Please let me know about any further changes.
--
Ticket URL: <https://code.djangoproject.com/ticket/28791#comment:6>
* needs_better_patch: 0 => 1
* has_patch: 0 => 1
* needs_tests: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/28791#comment:7>
Comment (by Hrishikesh Barman):
The improved patch for this ticket is here:
https://github.com/django/django/pull/9367
--
Ticket URL: <https://code.djangoproject.com/ticket/28791#comment:8>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"c6864a01b25591d3a709da8071413b69c9e35341" c6864a01]:
{{{
#!CommitTicketReference repository=""
revision="c6864a01b25591d3a709da8071413b69c9e35341"
Fixed #28791 -- Allowed commands that don't require settings to work if
the DJANGO_SETTINGS_MODULE doesn't exist.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28791#comment:9>