django-mobile
                                
                                 django-mobile copied to clipboard
                                
                                    django-mobile copied to clipboard
                            
                            
                            
                        Django 1.10 incompatibility
Hey,
I just upgraded to Django 1.10, and here's the startup error:
Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "xxx/venv/lib/python3.5/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "xxx/venv/lib/python3.5/site-packages/django/core/management/__init__.py", line 341, in execute
    django.setup()
  File "xxx/venv/lib/python3.5/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "xxx/venv/lib/python3.5/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "xxx/venv/lib/python3.5/site-packages/django/apps/config.py", line 90, in create
    module = import_module(entry)
  File "/usr/local/Cellar/python3/3.5.2_1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 665, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "xxx/venv/lib/python3.5/site-packages/django_mobile/__init__.py", line 10, in <module>
    from django_mobile.conf import settings
  File "xxx/venv/lib/python3.5/site-packages/django_mobile/conf.py", line 23, in <module>
    class defaults(object):
  File "xxx/venv/lib/python3.5/site-packages/django_mobile/conf.py", line 33, in defaults
    for loader in django_settings.TEMPLATE_LOADERS:
  File "xxx/venv/lib/python3.5/site-packages/django/conf/__init__.py", line 54, in __getattr__
    return getattr(self._wrapped, name)
AttributeError: 'Settings' object has no attribute 'TEMPLATE_LOADERS'
I use this as a temporary fix:
TEMPLATE_LOADERS = TEMPLATES[0]['OPTIONS']['loaders']
yeah, I did that too, but still, it's deprecated.
Hey thanks for the report! I'm not actively using django-mobile in any project currently, so I won't fix this any time soon. But I'm very happy about any PRs if you want to try and tackle the problem.
Does the commit above mean that this package is now compatible with 1.10?
Worth noting that approach with TEMPLATE_LOADERS = TEMPLATES[0]['OPTIONS']['loaders'] may be too naive, because you can use Jinja as first template engine, which doesn't have loaders section at all. Better way is to look up NAME == "django"
@gregmuellegger Are you still maintaining this project?
To anyone landing here who use more recent versions of Django, you might have some luck here: https://github.com/selwin/django-user_agents