我的团队将Django网站升级到1.7。我创建了一个新的virtualenv,pip安装了要求,一切看起来很好,我在新的virtualenv中有django 1.7。
导入django django.VERSION (1,7,4,'final',0)
但是当我尝试在本地运行新分支时,我得到了这个......
(venv1)josh@josh:~/project$ ./manage.py runnserver_plus
/home/josh/.virtualenvs/venv1/local/lib/python2.7/site-packages/dotenv.py:53: UserWarning: Not reading ./.env - it doesn't exist.
warnings.warn("Not reading {0} - it doesn't exist.".format(dotenv))
Traceback (most recent call last):
File "./manage.py", line 11, in <module>
from configurations.management import execute_from_command_line
File "/home/josh/.virtualenvs/venv1/local/lib/python2.7/site-packages/configurations/management.py", line 3, in <module>
importer.install(check_options=True)
File "/home/josh/.virtualenvs/venv1/local/lib/python2.7/site-packages/configurations/importer.py", line 35, in install
importer = ConfigurationImporter(check_options=check_options)
File "/home/josh/.virtualenvs/venv1/local/lib/python2.7/site-packages/configurations/importer.py", line 54, in __init__
self.validate()
File "/home/josh/.virtualenvs/venv1/local/lib/python2.7/site-packages/configurations/importer.py", line 82, in validate
raise ImproperlyConfigured(self.error_msg.format(self.namevar))
django.core.exceptions.ImproperlyConfigured: Configuration cannot be imported, environment variable DJANGO_CONFIGURATION is undefined.
所以只是为了咯咯笑,我做了一点......
(venv1)josh@josh:~/project$ source dev.env
它并没有完全解决问题,但是当我现在运行服务器时..
(venv1)josh@josh:~/project$ ./manage.py runserver_plus
/home/josh/.virtualenvs/venv1/local/lib/python2.7/site-packages/dotenv.py:53: UserWarning: Not reading ./.env - it doesn't exist.
warnings.warn("Not reading {0} - it doesn't exist.".format(dotenv))
/home/josh/fizzbuzz/fizzbuzz/fizzbuzz/tagging/managers.py:10: RemovedInDjango18Warning: `ModelTagManager.get_query_set` method should be renamed `get_queryset`.
/home/josh/fizzbuzz/fizzbuzz/fizzbuzz/tagging/forms.py:11: RemovedInDjango18Warning: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is deprecated - form TagAdminForm needs updating
/home/josh/.virtualenvs/venv1/local/lib/python2.7/site-packages/django/forms/widgets.py:143: RemovedInDjango18Warning: `PermissionAdmin.queryset` method should be renamed `get_queryset`.
.__new__(mcs, name, bases, attrs))
/home/josh/fizzbuzz/fizzbuzz/fizzbuzz/common/forms.py:97: RemovedInDjango18Warning: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is deprecated - form AddressForm needs updating
class AddressForm(forms.ModelForm, FizzbuzzDisplayFormMixin):
/home/josh/fizzbuzz/fizzbuzz/fizzbuzz/clients/admin.py:25: RemovedInDjango18Warning: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is deprecated - form PaymentModelForm needs updating
class PaymentModelForm(forms.ModelForm):
/home/josh/fizzbuzz/fizzbuzz/fizzbuzz/bookkeeper/admin.py:9: RemovedInDjango18Warning: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is deprecated - form InvoiceForm needs updating
class InvoiceForm(forms.ModelForm):
Validating models...
System check identified no issues (0 silenced).
Django version 1.7.4, using settings 'fizzbuzz.settings'
Development server is running at http://127.0.0.1:8000/
Using the Werkzeug debugger (http://werkzeug.pocoo.org/)
Quit the server with CONTROL-C.
* Running on http://127.0.0.1:8000/
* Restarting with reloader
/home/josh/.virtualenvs/venv1/local/lib/python2.7/site-packages/dotenv.py:53: UserWarning: Not reading ./.env - it doesn't exist.
warnings.warn("Not reading {0} - it doesn't exist.".format(dotenv))
/home/josh/fizzbuzz/fizzbuzz/fizzbuzz/tagging/managers.py:10: RemovedInDjango18Warning: `ModelTagManager.get_query_set` method should be renamed `get_queryset`.
/home/josh/fizzbuzz/fizzbuzz/fizzbuzz/tagging/forms.py:11: RemovedInDjango18Warning: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is deprecated - form TagAdminForm needs updating
/home/josh/.virtualenvs/venv1/local/lib/python2.7/site-packages/django/forms/widgets.py:143: RemovedInDjango18Warning: `PermissionAdmin.queryset` method should be renamed `get_queryset`.
.__new__(mcs, name, bases, attrs))
/home/josh/fizzbuzz/fizzbuzz/fizzbuzz/common/forms.py:97: RemovedInDjango18Warning: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is deprecated - form AddressForm needs updating
class AddressForm(forms.ModelForm, FizzbuzzDisplayFormMixin):
/home/josh/fizzbuzz/fizzbuzz/fizzbuzz/clients/admin.py:25: RemovedInDjango18Warning: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is deprecated - form PaymentModelForm needs updating
class PaymentModelForm(forms.ModelForm):
/home/josh/fizzbuzz/fizzbuzz/fizzbuzz/bookkeeper/admin.py:9: RemovedInDjango18Warning: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is deprecated - form InvoiceForm needs updating
class InvoiceForm(forms.ModelForm):
Validating models...
System check identified no issues (0 silenced).
Django version 1.7.4, using settings 'fizzbuzz.settings'
Development server is running at http://127.0.0.1:8000/
Using the Werkzeug debugger (http://werkzeug.pocoo.org/)
..但服务器确实运行并解决了所有这些错误。
我试图找出所有这些意味着什么,尝试删除并重新安装我的virtualenv / virtualenvwrapper,我只是不知道这里发生了什么。下面的警告只是由于升级需要解决django代码问题,还是它们可能仍然存在问题?
非常感谢任何帮助。