Al 16/08/12 17:20, En/na Sells, Fred ha escrit:
It seems to import OK, see below:
more manage.bat
\alltools\python26\python manage.py %1 %2 %3 %4 %5
C:\all\projects\AccTherapySchedulerServer\AccTherapySite>manage shell
C:\all\projects\AccTherapySchedulerServer\AccTherapySite>\alltools\python26\python
manage.py shell
Python 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
import django_extensions
dir(django_extensions)
['VERSION', '__builtins__', '__doc__', '__file__', '__name__', '__package__',
'__path__', '__version__', 'str_version']
django_extensions.VERSION
(0, 9)
----------------however if I run manage help I see the following which does not
seem like it has extensions------
Available subcommand
cleanup
compilemessages
...
test
testserver
validate
right, django-extensions' commands are missing.
Now this is a W7 system I use for development FWIW.
I have no experience developing on w7. I have tested it on linux with a
clean virtualenv (python 2.6.2, django 1.3 and django-extensions 0.9)
and it works fine.
If I run 'python' by itself I can get the django commands but not the
d-e ones:
$ python
Python 2.6.2 (r262:71600, May 21 2009, 18:30:52)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from django.core.management import get_commands
>>> get_commands().keys()
['compilemessages', 'dumpdata', 'startproject', 'sqlcustom',
...
'loaddata', 'cleanup', 'sqlindexes']
If I run 'python manage.py shell' I get both django and d-e commands:
$ python manage.py shell
Python 2.6.2 (r262:71600, May 21 2009, 18:30:52)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django.core.management import get_commands
>>> get_commands().keys()
['show_urls', 'generate_secret_key', 'set_fake_passwords',
...
'describe_form', 'cleanup', 'sqlindexes']
That makes me believe that the problem is somewhat related with the
settings not being (properly) loaded. Could you try:
$ python manage.py shell
Python 2.6.2 (r262:71600, May 21 2009, 18:30:52)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django.conf import settings
>>> settings.INSTALLED_APPS
['django.contrib.auth', 'django.contrib.contenttypes',
'django.contrib.sessions', 'django.contrib.sites',
'django.contrib.messages', 'django.contrib.staticfiles',
'django_extensions']
>>> import os
>>> os.environ["DJANGO_SETTINGS_MODULE"]
'foo.settings'
I expect that you'll get an ImportError exception (your environment is
not properly configured) or that 'django_extensions' is missing (the
wrong settings.py is being loaded).
Regards
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.