我使用的是Windows8.1和Python2.7,并且我已经在特定的文件路径中设置了所有的文件(希望是正确的),但是每当我运行python manage.py runserver时,我都会收到这个错误。
PS C:\Users\AWelborn\.virtualenvs\truthabouttrees\truth-about-trees> python manage.py runserver
C:\Python27\lib\site-packages\mezzanine\utils\conf.py:59: UserWarning: TIME_ZONE setting is not se
当我在Django中运行测试时,在一次失败之后,我从South得到了几页调试输出,如下所示:
south: DEBUG: south execute "CREATE INDEX "sometable_4d5bad5" ON "video_playable" ("network_id");" with params "[]"
south: DEBUG: south execute "CREATE INDEX "sometable_790e6d98" ON "video_playable
有没有办法将Django表单中的外键字段显示为只读文本框? forms.py
class NewModelForm(forms.ModelForm):
class Meta:
model = Model
fields = ['fk_field', 'other_field']
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['fk_field']
我正在为Django做一个扩展,我想让用户在设置文件中显示一个视图。
但是,如果用户将对视图的调用作为设置文件中的常量,则会产生一个循环依赖项,因为视图使用django.http,它使用设置中的SECRET_KEY:
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.
有办法解决这个问题吗?谢谢。