Skip to content
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.

Warning Django 1.9 #34

Closed
SalahAdDin opened this issue Apr 20, 2015 · 17 comments
Closed

Warning Django 1.9 #34

SalahAdDin opened this issue Apr 20, 2015 · 17 comments
Labels

Comments

@SalahAdDin
Copy link
Contributor

Please, update your app, now we have this warning:

/home/tulipan/Proyectos/TiempoTurco/lib/python3.4/importlib/_bootstrap.py:321: RemovedInDjango19Warning: django.utils.importlib will be removed in Django 1.9.
  return f(*args, **kwds)

/home/tulipan/Proyectos/IspanyolHaber/lib/python3.4/importlib/_bootstrap.py:321: RemovedInDjango19Warning: The utilities in django.db.models.loading are deprecated in favor of the new application loading system.
  return f(*args, **kwds)
@luzfcb
Copy link

luzfcb commented Apr 20, 2015

@SalahAdDin I suppose, such as every developer, @lambdalisue must be pretty busy. So it would be good, in addition to notify about this waring, if you send a pull-request with the fixes. 👍

@lambdalisue
Copy link
Contributor

@SalahAdDin @luzfcb I'm sorry but currently I don't have enough time to check the situation. One of my friend (@giginet) said he can check it but he is also quite busy man thus it might take a time to solve.

And also, it would be nice if you provide me more information :-)

@SalahAdDin
Copy link
Contributor Author

Wow, i'm noob for contribute with pro apps, but, if i will have any time, i try to fix this and do a PR for the app :D

@lambdalisue
Copy link
Contributor

#35

@lambdalisue
Copy link
Contributor

Fixed #36

@lambdalisue lambdalisue reopened this Apr 22, 2015
@lambdalisue
Copy link
Contributor

Not!

@lambdalisue
Copy link
Contributor

@giginet

The part should follow @SalahAdDin 's way like

if django.VERSION < (1, 8):
   from django.utils.importlib import import_module
else:
   from importlib import import_module

Otherwise the warning won't be away.
Could you send me a patch again with above?

@luzfcb
Copy link

luzfcb commented Apr 22, 2015

@lambdalisue this solve the warning?:

try:
    from django.utils.importlib import import_module  # noqa
except ImportError:
    from importlib import import_module  # noqa

@SalahAdDin
Copy link
Contributor Author

@luzfcb better brother: thank you.
@lambdalisue i think that the other code is better :D
👍
I think that there are other warnings, but, i don't know which.

@luzfcb
Copy link

luzfcb commented Apr 22, 2015

@lambdalisue @giginet This #38 pull-request solves the warning problem

@SalahAdDin
Copy link
Contributor Author

👍 ?

@lambdalisue
Copy link
Contributor

@luzfcb Thanks for your work, but it didn't fix the issue. The patch hide the warning only in landscape.io and it is not desired behaviour (the warning would be shown in python manage.py test or whatever).

While django 1.8 show a warning when django.utils.importlib.import_module is used, we should not even tried to import django.utils.importlib in django 1.8 because django.utils.importlib exists for instance. That's why I said the way of @SalahAdDin is better than the usual ImportError strategy. Note that if you change the order of import, it would fix the problem but it might cause side-effects (while I'm not sure if django.utils.importlib.import_module of django 1.3 or so on is compatible with importlib.import_module) thus I prefer if django.VERSION < (1, 8) more.

@lambdalisue
Copy link
Contributor

@luzfcb @SalahAdDin @giginet With your help, I could figure out which part of code cause this warnings thus I could easily fix the issues . Thanks a lot!

P.S. @SalahAdDin

I think that there are other warnings, but, i don't know which.

It would be fixed in #39.

lambdalisue added a commit that referenced this issue Apr 23, 2015
@lambdalisue
Copy link
Contributor

From django-permission 0.8.7 (https://pypi.python.org/pypi/django-permission)

@SalahAdDin
Copy link
Contributor Author

but, still miss a warning, the second warning.

@lambdalisue
Copy link
Contributor

Hum. Are you sure that you are using the latest? 8af88ca#diff-46102a8c322655ffe4ab6afbb0343c9aR30 this change should solve the problem...

@lambdalisue lambdalisue reopened this Apr 23, 2015
@lambdalisue
Copy link
Contributor

@SalahAdDin Probably your django-permission is old. The following is a log of python setup.py test in django-permission repository.

running test
Searching for django-appconf
Best match: django-appconf 1.0.1
Processing django_appconf-1.0.1-py2.7.egg

Using /home/alisue/Develop/django-permission/.eggs/django_appconf-1.0.1-py2.7.egg
Searching for django-override-settings
Best match: django-override-settings 1.2
Processing django_override_settings-1.2-py2.7.egg

Using /home/alisue/Develop/django-permission/.eggs/django_override_settings-1.2-py2.7.egg
running egg_info
writing requirements to src/django_permission.egg-info/requires.txt
writing src/django_permission.egg-info/PKG-INFO
writing top-level names to src/django_permission.egg-info/top_level.txt
writing dependency_links to src/django_permission.egg-info/dependency_links.txt
reading manifest file 'src/django_permission.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'src/django_permission.egg-info/SOURCES.txt'
running build_ext
.................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 241 tests in 15.357s

OK
Creating test database for alias 'default'...
Destroying test database for alias 'default'...

And python -c "import django; print django.VERSION"

(1, 8, 0, 'final', 0)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants