2007年02月04日 星期日 10:55
如题 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://python.cn/pipermail/python-chinese/attachments/20070204/afcf58d7/attachment.htm
2007年02月04日 星期日 11:27
On 2/4/07, 3751 <lwm3751在gmail.com> wrote: > 如题 不允许随便删除文件,只有管理员可以删除。有什么需求可以提出来,让管理员帮你们做。 -- I like python! UliPad <>: http://wiki.woodpecker.org.cn/moin/UliPad My Blog: http://www.donews.net/limodou
2007年02月04日 星期日 17:38
python-chinese,您好!
各位同学,今天学Django的时候发现一件奇怪的事情;
成功安装了Django后,我在python shell模式下from django.template import Template。或者Context等的时候import不进去 :S
提示:
Traceback (most recent call last):
File "", line 1, in ?
from django.template import Context
File "D:\Python24\lib\site-packages\django-0.95.1-py2.4.egg\django\template\__init__.py", line 894, in ?
add_to_builtins('django.template.defaultfilters')
File "D:\Python24\lib\site-packages\django-0.95.1-py2.4.egg\django\template\__init__.py", line 891, in add_to_builtins
builtins.append(get_library(module_name))
File "D:\Python24\lib\site-packages\django-0.95.1-py2.4.egg\django\template\__init__.py", line 880, in get_library
mod = __import__(module_name, '', '', [''])
File "D:\Python24\lib\site-packages\django-0.95.1-py2.4.egg\django\template\defaultfilters.py", line 5, in ?
from django.utils.translation import gettext
File "D:\Python24\lib\site-packages\django-0.95.1-py2.4.egg\django\utils\translation\__init__.py", line 3, in ?
if settings.USE_I18N:
File "D:\Python24\lib\site-packages\django-0.95.1-py2.4.egg\django\conf\__init__.py", line 27, in __getattr__
self._import_settings()
File "D:\Python24\lib\site-packages\django-0.95.1-py2.4.egg\django\conf\__init__.py", line 52, in _import_settings
raise EnvironmentError, "Environment variable %s is undefined." % ENVIRONMENT_VARIABLE
EnvironmentError: Environment variable DJANGO_SETTINGS_MODULE is undefined.
请教高手,该如何解决``
致
礼!
李李
py.7在163.com
2007-02-04
2007年02月04日 星期日 18:08
> EnvironmentError: Environment variable DJANGO_SETTINGS_MODULE is undefined. > django需要设置这个环境变量来装入settings.py配置,用来初始化数据库和装入app等。使用 python manage.py shell 会自动设置这个值,并且进入shell环境。 -- I like python! UliPad <>: http://wiki.woodpecker.org.cn/moin/UliPad My Blog: http://www.donews.net/limodou
Zeuux © 2025
京ICP备05028076号