[Django] #29114: Please make `django-admin shell` easier to use.

5 просмотров
Перейти к первому непрочитанному сообщению

Django

не прочитано,
5 февр. 2018 г., 10:08:1005.02.2018
– django-...@googlegroups.com
#29114: Please make `django-admin shell` easier to use.
-------------------------------------+-------------------------------------
Reporter: pannous | Owner: nobody
Type: | Status: new
Uncategorized |
Component: | Version: 2.0
Uncategorized | Keywords: django-admin
Severity: Normal | manage.py shell repl
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Please make `manage.py shell` work out of the box:

> django-admin shell
django.core.exceptions.ImproperlyConfigured: Requested setting USE_I18N,
but settings are not configured. You must either define the environment
variable DJANGO_SETTINGS_MODULE or call settings.configure() before
accessing settings.

> manage.py shell
django.core.exceptions.ImproperlyConfigured: Requested setting USE_I18N
...

After 20 minutes I found the 'solution' to the this problem, but the
second issue is unresolved:

django-admin shell --settings=poll.settings
TypeError: catch_config_error() missing 1 required positional argument

full log:
```
django-admin shell --settings=poll.settings
Traceback (most recent call last):
File "/usr/local/bin/django-admin", line 11, in <module>
sys.exit(execute_from_command_line())
File "/usr/local/lib/python3.5/dist-
packages/django/core/management/__init__.py", line 371, in
execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.5/dist-
packages/django/core/management/__init__.py", line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.5/dist-
packages/django/core/management/base.py", line 288, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.5/dist-
packages/django/core/management/base.py", line 335, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.5/dist-
packages/django/core/management/commands/shell.py", line 99, in handle
return getattr(self, shell)(options)
File "/usr/local/lib/python3.5/dist-
packages/django/core/management/commands/shell.py", line 35, in ipython
from IPython import start_ipython
File "/usr/local/lib/python3.5/dist-packages/IPython/__init__.py", line
54, in <module>
from .core.application import Application
File "/usr/local/lib/python3.5/dist-
packages/IPython/core/application.py", line 23, in <module>
from traitlets.config.application import Application,
catch_config_error
File "/usr/local/lib/python3.5/dist-
packages/traitlets/config/__init__.py", line 6, in <module>
from .application import *
File "/usr/local/lib/python3.5/dist-
packages/traitlets/config/application.py", line 120, in <module>
class Application(SingletonConfigurable):
File "/usr/local/lib/python3.5/dist-
packages/traitlets/config/application.py", line 291, in Application
def initialize(self, argv=None):
```

--
Ticket URL: <https://code.djangoproject.com/ticket/29114>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

не прочитано,
5 февр. 2018 г., 13:59:4105.02.2018
– django-...@googlegroups.com
#29114: Please make `django-admin shell` easier to use.
-------------------------------------+-------------------------------------
Reporter: pannous | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 2.0
Severity: Normal | Resolution:
Keywords: django-admin | Triage Stage:
manage.py shell repl | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Old description:

New description:

--

Comment (by Ramiro Morales):

Please prove more details on what steps you've performed before reaching
this point. like:

* How have you installed Django
* Have you installed it in such a way that `django-admin.py` got copied to
`/usr/local/bin` or is it a remnant from another installation?
* Des your Django project already have some apps added to `INSTALLED_APPS`
or is it a recently created
* Was this Django project working before?

The traceback seems to have been cut but there traces of a `'traitlets'`
Django application. Is it an app of yours or a third party one? Can you
try the `manage.py` commands you posted without removing that app first
from the Django project? Or maybe create a new project and try the
commands there si yo can detect if the problem is actually caused by
Django and not by broken/out of date apps.


Please reopen if yo can provide such information.

--
Ticket URL: <https://code.djangoproject.com/ticket/29114#comment:1>

Django

не прочитано,
5 февр. 2018 г., 14:00:1705.02.2018
– django-...@googlegroups.com
#29114: Please make `django-admin shell` easier to use.
-------------------------------------+-------------------------------------
Reporter: pannous | Owner: nobody
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: 2.0
Severity: Normal | Resolution: needsinfo

Keywords: django-admin | Triage Stage:
manage.py shell repl | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ramiro Morales):

* status: new => closed
* resolution: => needsinfo


--
Ticket URL: <https://code.djangoproject.com/ticket/29114#comment:2>

Django

не прочитано,
5 февр. 2018 г., 14:10:3505.02.2018
– django-...@googlegroups.com
#29114: Please make `django-admin shell` easier to use.
-------------------------------------+-------------------------------------
Reporter: pannous | Owner: nobody
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: 2.0
Severity: Normal | Resolution: needsinfo
Keywords: django-admin | Triage Stage:
manage.py shell repl | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by pannous):

pip uninstall traitlets

not sure what it is or how it was involved, maybe indirectly via
~/.pythonstartup.py

completely new user, completely new installation via
`pip install django`

`django-admin startproject poll`

`django-admin runserver --settings=poll.settings` works
`django-admin runserver ` doesn't work

this ticket can remain closed

now add scaffold/generators and I'm happy newbie;)

--
Ticket URL: <https://code.djangoproject.com/ticket/29114#comment:3>

Django

не прочитано,
6 февр. 2018 г., 09:17:3706.02.2018
– django-...@googlegroups.com
#29114: `django-admin shell` TypeError crash with ipython installed

-------------------------------------+-------------------------------------
Reporter: pannous | Owner: nobody
Type: Bug | Status: closed
Component: Core (Management | Version: 2.0
commands) | Resolution:
Severity: Normal | worksforme

Keywords: django-admin | Triage Stage:
manage.py shell repl | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* component: Uncategorized => Core (Management commands)
* type: Uncategorized => Bug
* resolution: needsinfo => worksforme


Comment:

For what it's worth, I couldn't reproduce the reported crash:
{{{
$ PYTHONPATH=. django-admin shell --settings=mysite.settings
Python 3.5.5 (default, Feb 4 2018, 21:11:55)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]:
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29114#comment:4>

Ответить всем
Отправить сообщение автору
Переслать
0 новых сообщений