Re: [Django] #29169: Upgrade django 1.8 to 1.9

2018-02-28 Thread Django
#29169: Upgrade django 1.8 to 1.9
-+-
 Reporter:  Olivetree|Owner:  nobody
 Type:  Uncategorized|   Status:  closed
Component:   |  Version:  1.9
  contrib.contenttypes   |
 Severity:  Normal   |   Resolution:  invalid
 Keywords:  upgrade, error,  | Triage Stage:
  contenttypes, app_label,   |  Unreviewed
  INSTALLED_APPS |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Description changed by Olivetree:

Old description:

> I am upgrading from django 1.8.4 to 1.9.13. I installed django 1.9.3 and
> added to my settings
>
> {{
> import django
> django.setup()
> }}}
>
> My application no longer works, it displays the following error:
> {{{
> Unhandled exception in thread started by  check_errors..wrapper at 0x7f9c9655b158>
> Traceback (most recent call last):
>   File "/usr/local/lib/python3.4/dist-
> packages/django/utils/autoreload.py", line 226, in wrapper
> fn(*args, **kwargs)
>   File "/usr/local/lib/python3.4/dist-
> packages/django/core/management/commands/runserver.py", line 116, in
> inner_run
> self.check(display_num_errors=True)
>   File "/usr/local/lib/python3.4/dist-
> packages/django/core/management/base.py", line 426, in check
> include_deployment_checks=include_deployment_checks,
>   File "/usr/local/lib/python3.4/dist-
> packages/django/core/checks/registry.py", line 75, in run_checks
> new_errors = check(app_configs=app_configs)
>   File "/usr/local/lib/python3.4/dist-
> packages/django/core/checks/urls.py", line 13, in check_url_config
> return check_resolver(resolver)
>   File "/usr/local/lib/python3.4/dist-
> packages/django/core/checks/urls.py", line 23, in check_resolver
> for pattern in resolver.url_patterns:
>   File "/usr/local/lib/python3.4/dist-
> packages/django/utils/functional.py", line 33, in __get__
> res = instance.__dict__[self.name] = self.func(instance)
>   File "/usr/local/lib/python3.4/dist-
> packages/django/core/urlresolvers.py", line 417, in url_patterns
> patterns = getattr(self.urlconf_module, "urlpatterns",
> self.urlconf_module)
>   File "/usr/local/lib/python3.4/dist-
> packages/django/utils/functional.py", line 33, in __get__
> res = instance.__dict__[self.name] = self.func(instance)
>   File "/usr/local/lib/python3.4/dist-
> packages/django/core/urlresolvers.py", line 410, in urlconf_module
> return import_module(self.urlconf_name)
>   File "/usr/lib/python3.4/importlib/__init__.py", line 109, in
> import_module
> return _bootstrap._gcd_import(name[level:], package, level)
>   File "", line 2254, in _gcd_import
>   File "", line 2237, in _find_and_load
>   File "", line 2226, in
> _find_and_load_unlocked
>   File "", line 1200, in _load_unlocked
>   File "", line 1129, in _exec
>   File "", line 1471, in exec_module
>   File "", line 321, in
> _call_with_frames_removed
>   File
> "/home/eva/work/test_upgrade_django_to_1_11/be/centroproduto/urls.py",
> line 7, in 
> from django.contrib.auth.views import login, logout
>   File "/usr/local/lib/python3.4/dist-
> packages/django/contrib/auth/views.py", line 11, in 
> from django.contrib.auth.forms import (
>   File "/usr/local/lib/python3.4/dist-
> packages/django/contrib/auth/forms.py", line 10, in 
> from django.contrib.auth.models import User
>   File "/usr/local/lib/python3.4/dist-
> packages/django/contrib/auth/models.py", line 6, in 
> from django.contrib.contenttypes.models import ContentType
>   File "/usr/local/lib/python3.4/dist-
> packages/django/contrib/contenttypes/models.py", line 161, in 
> class ContentType(models.Model):
>   File "/usr/local/lib/python3.4/dist-packages/django/db/models/base.py",
> line 102, in __new__
> "INSTALLED_APPS." % (module, name)
> RuntimeError: Model class django.contrib.contenttypes.models.ContentType
> doesn't declare an explicit app_label and isn't in an application in
> INSTALLED_APPS.
> }}}
> 
>
> I can not even run migrations ...
> In my settings I have:
> {{{
> (...)
>
> imp

Re: [Django] #29169: Upgrade django 1.8 to 1.9

2018-02-28 Thread Django
#29169: Upgrade django 1.8 to 1.9
-+-
 Reporter:  Olivetree|Owner:  nobody
 Type:  Uncategorized|   Status:  closed
Component:   |  Version:  1.9
  contrib.contenttypes   |
 Severity:  Normal   |   Resolution:  invalid
 Keywords:  upgrade, error,  | Triage Stage:
  contenttypes, app_label,   |  Unreviewed
  INSTALLED_APPS |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Olivetree):

 If I don't call django.setup() I have a diferente error:


 {{{
 Unhandled exception in thread started by .wrapper at 0x7effd13cbbf8>
 Traceback (most recent call last):
   File "/usr/local/lib/python3.4/dist-
 packages/django/utils/autoreload.py", line 226, in wrapper
 fn(*args, **kwargs)
   File "/usr/local/lib/python3.4/dist-
 packages/django/core/management/commands/runserver.py", line 109, in
 inner_run
 autoreload.raise_last_exception()
   File "/usr/local/lib/python3.4/dist-
 packages/django/utils/autoreload.py", line 249, in raise_last_exception
 six.reraise(*_exception)
   File "/usr/local/lib/python3.4/dist-packages/django/utils/six.py", line
 685, in reraise
 raise value.with_traceback(tb)
   File "/usr/local/lib/python3.4/dist-
 packages/django/utils/autoreload.py", line 226, in wrapper
 fn(*args, **kwargs)
   File "/usr/local/lib/python3.4/dist-packages/django/__init__.py", line
 18, in setup
 apps.populate(settings.INSTALLED_APPS)
   File "/usr/local/lib/python3.4/dist-packages/django/apps/registry.py",
 line 85, in populate
 app_config = AppConfig.create(entry)
   File "/usr/local/lib/python3.4/dist-packages/django/apps/config.py",
 line 90, in create
 module = import_module(entry)
   File "/usr/lib/python3.4/importlib/__init__.py", line 109, in
 import_module
 return _bootstrap._gcd_import(name[level:], package, level)
   File "", line 2254, in _gcd_import
   File "", line 2237, in _find_and_load
   File "", line 2226, in
 _find_and_load_unlocked
   File "", line 1200, in _load_unlocked
   File "", line 1129, in _exec
   File "", line 1471, in exec_module
   File "", line 321, in
 _call_with_frames_removed
   File
 "/home/eva/work/test_upgrade_django_to_1_11/be/centroprodutoapp/__init__.py",
 line 1, in 
 import centroprodutoapp.signals
   File
 "/home/eva/work/test_upgrade_django_to_1_11/be/centroprodutoapp/signals.py",
 line 6, in 
 from django.contrib.auth.models import User
   File "/usr/local/lib/python3.4/dist-
 packages/django/contrib/auth/models.py", line 4, in 
 from django.contrib.auth.base_user import AbstractBaseUser,
 BaseUserManager
   File "/usr/local/lib/python3.4/dist-
 packages/django/contrib/auth/base_user.py", line 49, in 
 class AbstractBaseUser(models.Model):
   File "/usr/local/lib/python3.4/dist-packages/django/db/models/base.py",
 line 94, in __new__
 app_config = apps.get_containing_app_config(module)
   File "/usr/local/lib/python3.4/dist-packages/django/apps/registry.py",
 line 239, in get_containing_app_config
 self.check_apps_ready()
   File "/usr/local/lib/python3.4/dist-packages/django/apps/registry.py",
 line 124, in check_apps_ready
 raise AppRegistryNotReady("Apps aren't loaded yet.")
 django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
 }}}



 Replying to [comment:1 Tim Graham]:
 > Please see TicketClosingReasons/UseSupportChannels for ways to get help.
 If you confirm a bug in Django, then please open a ticket with details.
 >
 > I will say that there's no need to call `django.setup()` in your
 settings.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29169#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.26e03e8d0b7041047108e3668fa65e89%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #29169: Upgrade django 1.8 to 1.9

2018-02-28 Thread Django
#29169: Upgrade django 1.8 to 1.9
-+-
 Reporter:  Olivetree|Owner:  nobody
 Type:  Uncategorized|   Status:  closed
Component:   |  Version:  1.9
  contrib.contenttypes   |
 Severity:  Normal   |   Resolution:  invalid
 Keywords:  upgrade, error,  | Triage Stage:
  contenttypes, app_label,   |  Unreviewed
  INSTALLED_APPS |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham):

 * status:  new => closed
 * resolution:   => invalid


Old description:

> I am upgrading from django 1.8.4 to 1.9.13. I installed django 1.9.3 and
> added to my settings
>
> **import django
> django.setup ()**
>
> My application no longer works, it displays the following error:
>
> Unhandled exception in thread started by  check_errors..wrapper at 0x7f9c9655b158>
> Traceback (most recent call last):
>   File "/usr/local/lib/python3.4/dist-
> packages/django/utils/autoreload.py", line 226, in wrapper
> fn(*args, **kwargs)
>   File "/usr/local/lib/python3.4/dist-
> packages/django/core/management/commands/runserver.py", line 116, in
> inner_run
> self.check(display_num_errors=True)
>   File "/usr/local/lib/python3.4/dist-
> packages/django/core/management/base.py", line 426, in check
> include_deployment_checks=include_deployment_checks,
>   File "/usr/local/lib/python3.4/dist-
> packages/django/core/checks/registry.py", line 75, in run_checks
> new_errors = check(app_configs=app_configs)
>   File "/usr/local/lib/python3.4/dist-
> packages/django/core/checks/urls.py", line 13, in check_url_config
> return check_resolver(resolver)
>   File "/usr/local/lib/python3.4/dist-
> packages/django/core/checks/urls.py", line 23, in check_resolver
> for pattern in resolver.url_patterns:
>   File "/usr/local/lib/python3.4/dist-
> packages/django/utils/functional.py", line 33, in __get__
> res = instance.__dict__[self.name] = self.func(instance)
>   File "/usr/local/lib/python3.4/dist-
> packages/django/core/urlresolvers.py", line 417, in url_patterns
> patterns = getattr(self.urlconf_module, "urlpatterns",
> self.urlconf_module)
>   File "/usr/local/lib/python3.4/dist-
> packages/django/utils/functional.py", line 33, in __get__
> res = instance.__dict__[self.name] = self.func(instance)
>   File "/usr/local/lib/python3.4/dist-
> packages/django/core/urlresolvers.py", line 410, in urlconf_module
> return import_module(self.urlconf_name)
>   File "/usr/lib/python3.4/importlib/__init__.py", line 109, in
> import_module
> return _bootstrap._gcd_import(name[level:], package, level)
>   File "", line 2254, in _gcd_import
>   File "", line 2237, in _find_and_load
>   File "", line 2226, in
> _find_and_load_unlocked
>   File "", line 1200, in _load_unlocked
>   File "", line 1129, in _exec
>   File "", line 1471, in exec_module
>   File "", line 321, in
> _call_with_frames_removed
>   File
> "/home/eva/work/test_upgrade_django_to_1_11/be/centroproduto/urls.py",
> line 7, in 
> from django.contrib.auth.views import login, logout
>   File "/usr/local/lib/python3.4/dist-
> packages/django/contrib/auth/views.py", line 11, in 
> from django.contrib.auth.forms import (
>   File "/usr/local/lib/python3.4/dist-
> packages/django/contrib/auth/forms.py", line 10, in 
> from django.contrib.auth.models import User
>   File "/usr/local/lib/python3.4/dist-
> packages/django/contrib/auth/models.py", line 6, in 
> from django.contrib.contenttypes.models import ContentType
>   File "/usr/local/lib/python3.4/dist-
> packages/django/contrib/contenttypes/models.py", line 161, in 
> class ContentType(models.Model):
>   File "/usr/local/lib/python3.4/dist-packages/django/db/models/base.py",
> line 102, in __new__
> "INSTALLED_APPS." % (module, name)
> RuntimeError: Model class django.contrib.contenttypes.models.ContentType
> doesn't declare an explicit app_label and isn't in an application in
> INSTALLED_APPS.
>
> 
>
> I can not even run migrations ...
> In my settings I ha

[Django] #29169: Upgrade django 1.8 to 1.9

2018-02-28 Thread Django
#29169: Upgrade django 1.8 to 1.9
-+-
   Reporter:  Olivetree  |  Owner:  nobody
   Type: | Status:  new
  Uncategorized  |
  Component: |Version:  1.9
  contrib.contenttypes   |   Keywords:  upgrade, error,
   Severity:  Normal |  contenttypes, app_label,
   Triage Stage: |  INSTALLED_APPS
  Unreviewed |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 I am upgrading from django 1.8.4 to 1.9.13. I installed django 1.9.3 and
 added to my settings

 **import django
 django.setup ()**

 My application no longer works, it displays the following error:

 Unhandled exception in thread started by .wrapper at 0x7f9c9655b158>
 Traceback (most recent call last):
   File "/usr/local/lib/python3.4/dist-
 packages/django/utils/autoreload.py", line 226, in wrapper
 fn(*args, **kwargs)
   File "/usr/local/lib/python3.4/dist-
 packages/django/core/management/commands/runserver.py", line 116, in
 inner_run
 self.check(display_num_errors=True)
   File "/usr/local/lib/python3.4/dist-
 packages/django/core/management/base.py", line 426, in check
 include_deployment_checks=include_deployment_checks,
   File "/usr/local/lib/python3.4/dist-
 packages/django/core/checks/registry.py", line 75, in run_checks
 new_errors = check(app_configs=app_configs)
   File "/usr/local/lib/python3.4/dist-
 packages/django/core/checks/urls.py", line 13, in check_url_config
 return check_resolver(resolver)
   File "/usr/local/lib/python3.4/dist-
 packages/django/core/checks/urls.py", line 23, in check_resolver
 for pattern in resolver.url_patterns:
   File "/usr/local/lib/python3.4/dist-
 packages/django/utils/functional.py", line 33, in __get__
 res = instance.__dict__[self.name] = self.func(instance)
   File "/usr/local/lib/python3.4/dist-
 packages/django/core/urlresolvers.py", line 417, in url_patterns
 patterns = getattr(self.urlconf_module, "urlpatterns",
 self.urlconf_module)
   File "/usr/local/lib/python3.4/dist-
 packages/django/utils/functional.py", line 33, in __get__
 res = instance.__dict__[self.name] = self.func(instance)
   File "/usr/local/lib/python3.4/dist-
 packages/django/core/urlresolvers.py", line 410, in urlconf_module
 return import_module(self.urlconf_name)
   File "/usr/lib/python3.4/importlib/__init__.py", line 109, in
 import_module
 return _bootstrap._gcd_import(name[level:], package, level)
   File "", line 2254, in _gcd_import
   File "", line 2237, in _find_and_load
   File "", line 2226, in
 _find_and_load_unlocked
   File "", line 1200, in _load_unlocked
   File "", line 1129, in _exec
   File "", line 1471, in exec_module
   File "", line 321, in
 _call_with_frames_removed
   File
 "/home/eva/work/test_upgrade_django_to_1_11/be/centroproduto/urls.py",
 line 7, in 
 from django.contrib.auth.views import login, logout
   File "/usr/local/lib/python3.4/dist-
 packages/django/contrib/auth/views.py", line 11, in 
 from django.contrib.auth.forms import (
   File "/usr/local/lib/python3.4/dist-
 packages/django/contrib/auth/forms.py", line 10, in 
 from django.contrib.auth.models import User
   File "/usr/local/lib/python3.4/dist-
 packages/django/contrib/auth/models.py", line 6, in 
 from django.contrib.contenttypes.models import ContentType
   File "/usr/local/lib/python3.4/dist-
 packages/django/contrib/contenttypes/models.py", line 161, in 
 class ContentType(models.Model):
   File "/usr/local/lib/python3.4/dist-packages/django/db/models/base.py",
 line 102, in __new__
 "INSTALLED_APPS." % (module, name)
 RuntimeError: Model class django.contrib.contenttypes.models.ContentType
 doesn't declare an explicit app_label and isn't in an application in
 INSTALLED_APPS.

 

 I can not even run migrations ...
 In my settings I have:

 (...)

 import django
 django.setup()

 (...)

 INSTALLED_APPS = (
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.admin',
 'myapp',
 #'debug_toolbar',
 'django_extensions',
 'corsheaders',
 'watson',
 'raven.contrib.django.raven_compat',
 #'django.contrib.admindocs',
 'django_mailbox',
 'django.contrib.postgr