django-upgrade

Django upgrade from 1.10 to 1.11 DeprecationWarning

偶尔善良 提交于 2020-08-20 11:49:47
问题 I am trying to upgrade my project from Django 1.10 to 1.11: >>> django.VERSION (1, 10, 0, 'final', 1) When I run python -Wall manage.py test, I get the following error message: C:\Users\Environments\lib\site-packages\django\contrib\auth\base_user.py:52: DeprecationWarning: __class__ not set defining 'AbstractBaseUser' as <class 'django.contrib.auth.base_user.AbstractBaseUser'>. Was __classcell__ propagated to type.__new__? class AbstractBaseUser(models.Model): I have looked around but could

Django upgrade from 1.10 to 1.11 DeprecationWarning

怎甘沉沦 提交于 2020-08-20 11:46:16
问题 I am trying to upgrade my project from Django 1.10 to 1.11: >>> django.VERSION (1, 10, 0, 'final', 1) When I run python -Wall manage.py test, I get the following error message: C:\Users\Environments\lib\site-packages\django\contrib\auth\base_user.py:52: DeprecationWarning: __class__ not set defining 'AbstractBaseUser' as <class 'django.contrib.auth.base_user.AbstractBaseUser'>. Was __classcell__ propagated to type.__new__? class AbstractBaseUser(models.Model): I have looked around but could

Django upgrade from 1.10 to 1.11 DeprecationWarning

爱⌒轻易说出口 提交于 2020-08-20 11:45:59
问题 I am trying to upgrade my project from Django 1.10 to 1.11: >>> django.VERSION (1, 10, 0, 'final', 1) When I run python -Wall manage.py test, I get the following error message: C:\Users\Environments\lib\site-packages\django\contrib\auth\base_user.py:52: DeprecationWarning: __class__ not set defining 'AbstractBaseUser' as <class 'django.contrib.auth.base_user.AbstractBaseUser'>. Was __classcell__ propagated to type.__new__? class AbstractBaseUser(models.Model): I have looked around but could

Django upgrade from 1.8 to 1.9 is breaking on model import in init

痞子三分冷 提交于 2020-04-30 06:57:27
问题 I have run into the same problem that @JohnnyQ has commented on here. My __init__.py is referring to multiple imports that in-turn are referring to models and these are required. The code works perfectly fine with django 1.8.x but breaks when Django is upgraded to 1.9.x. I am guessing it to be some class-loading sequence issue. What has changed in 1.9 w.r.t to model imports in apps triggering the AppRegistryNotReady exception? The traceback is here: Traceback (most recent call last): File "

Django upgrade from 1.8 to 1.9 is breaking on model import in init

╄→гoц情女王★ 提交于 2020-04-30 06:57:05
问题 I have run into the same problem that @JohnnyQ has commented on here. My __init__.py is referring to multiple imports that in-turn are referring to models and these are required. The code works perfectly fine with django 1.8.x but breaks when Django is upgraded to 1.9.x. I am guessing it to be some class-loading sequence issue. What has changed in 1.9 w.r.t to model imports in apps triggering the AppRegistryNotReady exception? The traceback is here: Traceback (most recent call last): File "

django.core.servers.basehttp.FileWrapper disappears in Django 1.9

非 Y 不嫁゛ 提交于 2020-02-17 18:01:39
问题 I am migrating from django 1.8 to 1.9. and I got the following error: ImportError: cannot import name 'FileWrapper' I import it as follow: from django.core.servers.basehttp import FileWrapper Searching this name in django 1.9 release notes gives no result. What is the replacement for FileWrapper ? 回答1: Django just had a wrapper to the wsgiref module you can just get it directly from wsgiref.util import FileWrapper 来源: https://stackoverflow.com/questions/35817597/django-core-servers-basehttp

Can't view django 2.0 admin page after upgrading

拟墨画扇 提交于 2019-12-11 16:05:18
问题 I've just been porting to Python3 from 2 and upgrading Django from 1.7 to 2.0 (massive changes I know). I'm using Heroku to host the app. When I run heroku local or just run the app locally with manage.py runserver the app loads but navigating to the /admin page comes up with the error: Page not found (404) Request Method: GET Request URL: http://127.0.0.1:5000/admin Using the URLconf defined in loowatt.urls, Django tried these URL patterns, in this order: write/ admin/ ^$ [name='index'] The