[Django] #22949: django-admin.py startproject required settings

68 views
Skip to first unread message

Django

unread,
Jul 3, 2014, 6:07:03 AM7/3/14
to django-...@googlegroups.com
#22949: django-admin.py startproject required settings
-------------------------------+--------------------------
Reporter: anonymous | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: master
Severity: Normal | Keywords: django-admin
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------
DJANGO_SETTINGS_MODULE not set, but starproject not may create new
project, required setting variables.


bash-4.3# export | grep DJANGO_SETTINGS_MODULE
bash-4.3# ls
django-admin.py
bash-4.3# python -c "import django; print(django.get_version())"
1.8.dev20140703043303
bash-4.3# ./django-admin.py startproject myproject
Traceback (most recent call last):
File "./django-admin.py", line 5, in <module>
management.execute_from_command_line()
File "/usr/lib64/python2.7/site-
packages/django/core/management/__init__.py", line 330, in
execute_from_command_line
utility.execute()
File "/usr/lib64/python2.7/site-
packages/django/core/management/__init__.py", line 304, in execute
django.setup()
File "/usr/lib64/python2.7/site-packages/django/__init__.py", line 20,
in setup
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
File "/usr/lib64/python2.7/site-
packages/django/django/conf/__init__.py", line 46, in __getattr__
self._setup(name)
File "/usr/lib64/python2.7/site-
packages/django/django/conf/__init__.py", line 40, in _setup
% (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting
LOGGING_CONFIG, but settings are not configured. You must either define
the environment variable DJANGO_SETTINGS_MODULE or call
settings.configure() before accessing settings.

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

Django

unread,
Jul 3, 2014, 9:10:42 AM7/3/14
to django-...@googlegroups.com
#22949: django-admin.py startproject required settings
-------------------------------------+-------------------------------------

Reporter: anonymous | Owner: nobody
Type: Bug | Status: new
Component: Core (Management | Version: master
commands) | Resolution:
Severity: Normal | Triage Stage:
Keywords: django-admin | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by anonymous):

* needs_better_patch: => 0
* component: Uncategorized => Core (Management commands)
* needs_tests: => 0
* needs_docs: => 0


Comment:

Problem not exist in 1.7b4, but exist in 1.7c1 and master.

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

Django

unread,
Jul 3, 2014, 9:44:58 AM7/3/14
to django-...@googlegroups.com
#22949: django-admin.py startproject required settings
-------------------------------------+-------------------------------------

Reporter: anonymous | Owner: nobody
Type: Bug | Status: new
Component: Core (Management | Version: master
commands) | Resolution:
Severity: Normal | Triage Stage:
Keywords: django-admin | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by timo):

Could you clarify the steps to reproduce the issue? I had no problem with
the following:
{{{
$ mkvirtualenv django-test-22949
$ pip install https://www.djangoproject.com/download/1.7c1/tarball/
$ django-admin.py startproject myproject
}}}

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

Django

unread,
Jul 3, 2014, 11:03:19 AM7/3/14
to django-...@googlegroups.com
#22949: django-admin.py startproject required settings
-------------------------------------+-------------------------------------

Reporter: anonymous | Owner: nobody
Type: Bug | Status: new
Component: Core (Management | Version: master
commands) | Resolution:
Severity: Normal | Triage Stage:
Keywords: django-admin | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by anonymous):

I work via GIT

bash-4.3# cd /usr/src/devel/django
bash-4.3# git checkout master
Already on 'master'


bash-4.3# python -c "import django; print(django.get_version())"

1.8.dev20140703114252
bash-4.3# cd /sites/test_dj


bash-4.3# ./django-admin.py startproject myproject
Traceback (most recent call last):
File "./django-admin.py", line 5, in <module>
management.execute_from_command_line()
File "/usr/lib64/python2.7/site-
packages/django/core/management/__init__.py", line 330, in
execute_from_command_line
utility.execute()
File "/usr/lib64/python2.7/site-
packages/django/core/management/__init__.py", line 304, in execute
django.setup()
File "/usr/lib64/python2.7/site-packages/django/__init__.py", line 20,
in setup
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
File "/usr/lib64/python2.7/site-
packages/django/django/conf/__init__.py", line 46, in __getattr__
self._setup(name)
File "/usr/lib64/python2.7/site-
packages/django/django/conf/__init__.py", line 40, in _setup
% (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting
LOGGING_CONFIG, but settings are not configured. You must either define
the environment variable DJANGO_SETTINGS_MODULE or call
settings.configure() before accessing settings.

bash-4.3# cd /usr/src/devel/django
bash-4.3# git checkout 1.7c1
Note: checking out '1.7c1'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

git checkout -b new_branch_name

HEAD is now at 78bff08... [1.7.x] Bump version number for 1.7 RC 1.
bash-4.3# cd /sites/test_dj


bash-4.3# python -c "import django; print(django.get_version())"

1.7c1


bash-4.3# ./django-admin.py startproject myproject
Traceback (most recent call last):
File "./django-admin.py", line 5, in <module>
management.execute_from_command_line()
File "/usr/lib64/python2.7/site-

packages/django/core/management/__init__.py", line 385, in
execute_from_command_line
utility.execute()
File "/usr/lib64/python2.7/site-
packages/django/core/management/__init__.py", line 354, in execute


django.setup()
File "/usr/lib64/python2.7/site-packages/django/__init__.py", line 20,
in setup
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
File "/usr/lib64/python2.7/site-
packages/django/django/conf/__init__.py", line 46, in __getattr__
self._setup(name)
File "/usr/lib64/python2.7/site-
packages/django/django/conf/__init__.py", line 40, in _setup
% (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting
LOGGING_CONFIG, but settings are not configured. You must either define
the environment variable DJANGO_SETTINGS_MODULE or call
settings.configure() before accessing settings.

bash-4.3# cd /usr/src/devel/django
bash-4.3# git checkout 1.7b4
Previous HEAD position was 78bff08... [1.7.x] Bump version number for 1.7
RC 1.
HEAD is now at 95cf172... Bumped version number for release.
bash-4.3# cd /sites/test_dj


bash-4.3# python -c "import django; print(django.get_version())"

1.7b4
bash-4.3# ./django-admin.py startproject myproject
bash-4.3#

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

Django

unread,
Jul 3, 2014, 12:48:45 PM7/3/14
to django-...@googlegroups.com
#22949: django-admin.py startproject required settings
-------------------------------------+-------------------------------------
Reporter: anonymous | Owner: nobody
Type: Bug | Status: closed

Component: Core (Management | Version: master
commands) | Resolution: invalid

Severity: Normal | Triage Stage:
Keywords: django-admin | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by claudep):

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


Comment:

I think the problem is you are mixing versions of Django between a
checkout and the system-wide install. It appears you have checked out
Django in /usr/src/devel/django. But then, the traceback shows that the
executed code is in /usr/lib64/python2.7/site-packages/django/.
I would suggest that you remove the system-wide django package and work
with virtualenvs instead.

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

Django

unread,
Jul 3, 2014, 2:15:29 PM7/3/14
to django-...@googlegroups.com
#22949: django-admin.py startproject required settings
-------------------------------------+-------------------------------------

Reporter: anonymous | Owner: nobody
Type: Bug | Status: new
Component: Core (Management | Version: master
commands) | Resolution:
Severity: Normal | Triage Stage:
Keywords: django-admin | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by anonymous):

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


Comment:

Hmm..sorry, but I not mixing versions of django, 'cause only have symbolic
link from /usr/src/devel/django to /usr/lib64/python2.7/site-
packages/django/

I check now with virtualenv- and not problem with django-admin.
But without virtualenv with system-wide install - i have problem as write
earlier.
Don't know how it's critically, but in 1.7b4 not problem, in later
versions - exist.
Please check without virtialenv.

--
Ticket URL: <https://code.djangoproject.com/ticket/22949#comment:5>

Django

unread,
Jul 3, 2014, 2:34:33 PM7/3/14
to django-...@googlegroups.com
#22949: django-admin.py startproject required settings
-------------------------------------+-------------------------------------

Reporter: anonymous | Owner: nobody
Type: Bug | Status: new
Component: Core (Management | Version: master
commands) | Resolution:
Severity: Normal | Triage Stage:
Keywords: django-admin | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by claudep):

I just tried with master, installing it system-wide, but was not able to
reproduce your issue. I'm out of ideas.

--
Ticket URL: <https://code.djangoproject.com/ticket/22949#comment:6>

Django

unread,
Jul 3, 2014, 2:52:29 PM7/3/14
to django-...@googlegroups.com
#22949: django-admin.py startproject required settings
-------------------------------------+-------------------------------------

Reporter: anonymous | Owner: nobody
Type: Bug | Status: new
Component: Core (Management | Version: master
commands) | Resolution:
Severity: Normal | Triage Stage:
Keywords: django-admin | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by timo):

anonymous, if you can bisect to the commit where the behavior changed in
might help.

--
Ticket URL: <https://code.djangoproject.com/ticket/22949#comment:7>

Django

unread,
Jul 4, 2014, 8:41:18 AM7/4/14
to django-...@googlegroups.com
#22949: django-admin.py startproject required settings
-------------------------------------+-------------------------------------

Reporter: anonymous | Owner: nobody
Type: Bug | Status: new
Component: Core (Management | Version: master
commands) | Resolution:
Severity: Normal | Triage Stage:
Keywords: django-admin | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by anonymous):

Problem exist after commit 4865326f2200aa1c480526feef5428cf780ab3c6

commit 4865326f2200aa1c480526feef5428cf780ab3c6
Author: Aymeric Augustin <aymeric....@m4x.org>
Date: Tue May 27 18:57:53 2014 +0200

example:
bash-4.3# git checkout 4865326f2200aa1c480526feef5428cf780ab3c6
HEAD is now at 4865326... Fixed #22699 -- Configure default settings in
some management commands.
bash-4.3#
bash-4.3# ./django-admin.py


Traceback (most recent call last):
File "./django-admin.py", line 5, in <module>
management.execute_from_command_line()
File "/usr/lib64/python2.7/site-

packages/django/core/management/__init__.py", line 432, in
execute_from_command_line
utility.execute()
File "/usr/lib64/python2.7/site-
packages/django/core/management/__init__.py", line 401, in execute


django.setup()
File "/usr/lib64/python2.7/site-packages/django/__init__.py", line 20,
in setup
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
File "/usr/lib64/python2.7/site-
packages/django/django/conf/__init__.py", line 46, in __getattr__
self._setup(name)
File "/usr/lib64/python2.7/site-
packages/django/django/conf/__init__.py", line 40, in _setup
% (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting
LOGGING_CONFIG, but settings are not configured. You must either define
the environment variable DJANGO_SETTINGS_MODULE or call
settings.configure() before accessing settings.

Previous commit- all normal.
commit 2e613ea5c52d4d12e071987178af18c0371d6e2f
Author: Moayad Mardini <moay...@gmail.com>
Date: Mon May 26 23:09:17 2014 +0300


Example:

bash-4.3#
bash-4.3# git checkout 2e613ea5c52d4d12e071987178af18c0371d6e2f
Previous HEAD position was 4865326... Fixed #22699 -- Configure default
settings in some management commands.
HEAD is now at 2e613ea... Fixed #22675 -- makemigrations --dry-run to
output migrations to stdout.
bash-4.3#
bash-4.3# ./django-admin.py
Usage: django-admin.py subcommand [options] [args]

Options:
-v VERBOSITY, --verbosity=VERBOSITY
Verbosity level; 0=minimal output, 1=normal
output,
2=verbose output, 3=very verbose output
--settings=SETTINGS The Python path to a settings module, e.g.
"myproject.settings.main". If this isn't provided,
the
DJANGO_SETTINGS_MODULE environment variable will
be
used.
--pythonpath=PYTHONPATH
A directory to add to the Python path, e.g.
"/home/djangoprojects/myproject".
--traceback Raise on exception
--no-color Don't colorize the command output.
--version show program's version number and exit
-h, --help show this help message and exit

Type 'django-admin.py help <subcommand>' for help on a specific
subcommand.

Available subcommands:

[django]
check
compilemessages
createcachetable
dbshell
diffsettings
dumpdata
flush
inspectdb
loaddata
makemessages
makemigrations
migrate
runfcgi
runserver
shell
sql
sqlall
sqlclear
sqlcustom
sqldropindexes
sqlflush
sqlindexes
sqlmigrate
sqlsequencereset
squashmigrations
startapp
startproject
syncdb
test
testserver
validate
Note that only Django core commands are listed as settings are not
properly configured (error: Requested setting INSTALLED_APPS, but settings


are not configured. You must either define the environment variable
DJANGO_SETTINGS_MODULE or call settings.configure() before accessing

settings.).

bash-4.3#


Thank you very much for your job. Django is great software.

--
Ticket URL: <https://code.djangoproject.com/ticket/22949#comment:8>

Django

unread,
Jul 4, 2014, 12:17:33 PM7/4/14
to django-...@googlegroups.com
#22949: django-admin.py startproject required settings
-------------------------------------+-------------------------------------
Reporter: anonymous | Owner: aaugustin
Type: Bug | Status: assigned

Component: Core (Management | Version: master
commands) | Resolution:
Severity: Release blocker | Triage Stage:

Keywords: django-admin | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by aaugustin):

* owner: nobody => aaugustin
* status: new => assigned
* severity: Normal => Release blocker


Comment:

I shall look into this.

--
Ticket URL: <https://code.djangoproject.com/ticket/22949#comment:9>

Django

unread,
Jul 5, 2014, 7:35:25 PM7/5/14
to django-...@googlegroups.com
#22949: django-admin.py startproject required settings
-------------------------------------+-------------------------------------
Reporter: anonymous | Owner: aaugustin
Type: Bug | Status: assigned
Component: Core (Management | Version: master
commands) | Resolution:
Severity: Release blocker | Triage Stage:
Keywords: django-admin | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by andrewgodwin):

Have we established if this is a problem in 1.7c1 or not? Need to know if
it's a 1.7 release blocker.

--
Ticket URL: <https://code.djangoproject.com/ticket/22949#comment:10>

Django

unread,
Jul 5, 2014, 8:37:16 PM7/5/14
to django-...@googlegroups.com
#22949: django-admin.py startproject required settings
-------------------------------------+-------------------------------------
Reporter: anonymous | Owner: aaugustin
Type: Bug | Status: assigned
Component: Core (Management | Version: 1.7-rc-1

commands) | Resolution:
Severity: Release blocker | Triage Stage:
Keywords: django-admin | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timo):

* version: master => 1.7-rc-1


Comment:

Yes, the referenced commit was backported to stable/1.7.x.

@anonymous, are there any contents in `/sites/test_dj` The fact that you
run `./django-admin.py` seems to suggest its existence there? Normally
`django-admin.py` is added to your PATH when you install Django so you
omit `./`.

I tried
{{{
$ cd ~/code/django/django/bin
$ ./django-admin.py
}}}
but still didn't reproduce the error.

--
Ticket URL: <https://code.djangoproject.com/ticket/22949#comment:11>

Django

unread,
Jul 5, 2014, 9:31:00 PM7/5/14
to django-...@googlegroups.com
#22949: django-admin.py startproject required settings
-------------------------------------+-------------------------------------
Reporter: anonymous | Owner: aaugustin
Type: Bug | Status: assigned
Component: Core (Management | Version: 1.7-rc-1
commands) | Resolution:
Severity: Release blocker | Triage Stage:
Keywords: django-admin | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by anonymous):

No. In /sites/test_dj i don't have any contents, only symlink to django-
admin.py
But I confirm, then in virtualenv not have problem.
Now try in standard place of django-admin.py in django tree. Same
situation
You may see output.

bash-4.3# ls
django-2to3.py django-admin.py profiling unique-messages.py


bash-4.3# git checkout master
Already on 'master'

bash-4.3# ./django-admin.py


Traceback (most recent call last):
File "./django-admin.py", line 5, in <module>
management.execute_from_command_line()
File "/usr/lib64/python2.7/site-
packages/django/core/management/__init__.py", line 330, in
execute_from_command_line
utility.execute()
File "/usr/lib64/python2.7/site-
packages/django/core/management/__init__.py", line 304, in execute
django.setup()
File "/usr/lib64/python2.7/site-packages/django/__init__.py", line 20,
in setup
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
File "/usr/lib64/python2.7/site-
packages/django/django/conf/__init__.py", line 46, in __getattr__
self._setup(name)
File "/usr/lib64/python2.7/site-
packages/django/django/conf/__init__.py", line 40, in _setup
% (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting
LOGGING_CONFIG, but settings are not configured. You must either define
the environment variable DJANGO_SETTINGS_MODULE or call
settings.configure() before accessing settings.

bash-4.3# git checkout 2e613ea5c52d4d12e071987178af18c0371d6e2f
Note: checking out '2e613ea5c52d4d12e071987178af18c0371d6e2f'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

git checkout -b new_branch_name

HEAD is now at 2e613ea... Fixed #22675 -- makemigrations --dry-run to

Available subcommands:

properly configured (error: Requested setting INSTALLED_APPS, but settings


are not configured. You must either define the environment variable
DJANGO_SETTINGS_MODULE or call settings.configure() before accessing

settings.).
bash-4.3#

--
Ticket URL: <https://code.djangoproject.com/ticket/22949#comment:12>

Django

unread,
Jul 5, 2014, 9:54:51 PM7/5/14
to django-...@googlegroups.com
#22949: django-admin.py startproject required settings
-------------------------------------+-------------------------------------
Reporter: anonymous | Owner: aaugustin
Type: Bug | Status: assigned
Component: Core (Management | Version: 1.7-rc-1
commands) | Resolution:
Severity: Release blocker | Triage Stage:
Keywords: django-admin | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by anonymous):

I now remove symlink to django from site-packages, clone repo from git,
python setup.py build install, and all normal ok.
Please close ticket.
May be problem repeat with another user.

--
Ticket URL: <https://code.djangoproject.com/ticket/22949#comment:13>

Django

unread,
Jul 6, 2014, 3:12:06 AM7/6/14
to django-...@googlegroups.com
#22949: django-admin.py startproject required settings
-------------------------------------+-------------------------------------
Reporter: anonymous | Owner: aaugustin
Type: Bug | Status: closed

Component: Core (Management | Version: 1.7-rc-1
commands) | Resolution: invalid

Severity: Release blocker | Triage Stage:
Keywords: django-admin | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by aaugustin):

* status: assigned => closed
* resolution: => invalid


--
Ticket URL: <https://code.djangoproject.com/ticket/22949#comment:14>

Reply all
Reply to author
Forward
0 new messages