Skip to content

rest_pandas in INSTALLED_APPS breaks in Django 1.9 #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Dipolle opened this issue Dec 23, 2015 · 3 comments
Closed

rest_pandas in INSTALLED_APPS breaks in Django 1.9 #21

Dipolle opened this issue Dec 23, 2015 · 3 comments

Comments

@Dipolle
Copy link

Dipolle commented Dec 23, 2015

I use:
Python 2.7
Django 1.9
DRF 3.2.2
Pandas 0.17.1
And i have this problem:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 350, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 324, in execute
    django.setup()
  File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py", line 90, in create
    module = import_module(entry)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "build/bdist.linux-x86_64/egg/rest_pandas/__init__.py", line 1, in <module>
  File "build/bdist.linux-x86_64/egg/rest_pandas/views.py", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/views.py", line 98, in <module>
    class APIView(View):
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/views.py", line 103, in APIView
    authentication_classes = api_settings.DEFAULT_AUTHENTICATION_CLASSES
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/settings.py", line 203, in __getattr__
    val = perform_import(val, attr)
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/settings.py", line 148, in perform_import
    return [import_from_string(item, setting_name) for item in val]
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/settings.py", line 160, in import_from_string
    module = importlib.import_module(module_path)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/authentication.py", line 13, in <module>
    from rest_framework.authtoken.models import Token
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/authtoken/models.py", line 16, in <module>
    class Token(models.Model):
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 94, in __new__
    app_config = apps.get_containing_app_config(module)
  File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 239, in get_containing_app_config
    self.check_apps_ready()
  File "/usr/local/lib/python2.7/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.
@sheppard
Copy link
Member

Hi, you don't need to include rest_pandas in your INSTALLED_APPS - just import the necessary views, etc. as needed.

@Dipolle
Copy link
Author

Dipolle commented Dec 24, 2015

Thank you for explanation!

@Dipolle Dipolle closed this as completed Dec 24, 2015
@sheppard
Copy link
Member

I've also submitted a patch to DRF core that will fix this issue even if rest_pandas is in your INSTALLED_APPS. See encode/django-rest-framework#3785.

@sheppard sheppard changed the title Problem with install dajngo-rest-pandas rest_pandas in INSTALLED_APPS breaks in Django 1.9 Dec 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants