pinax / pinax-stripe-light

a payments Django app for Stripe
MIT License
687 stars 286 forks source link

Pinax.stripe.mixins runtime error #568

Open vincefav opened 6 years ago

vincefav commented 6 years ago

Issue Summary

I just installed the latest version of pinax-stripe and my deployment fails with a runtime error.


Steps to Reproduce

I'm using Django 2.0.4 and my installed_apps are:

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.sites',
    'raven.contrib.django.raven_compat',
    'pinax.stripe',
    'allauth',
    'allauth.account',
    'allauth.socialaccount',
    'allauth.socialaccount.providers.facebook',
    'allauth.socialaccount.providers.google',
    'allauth.socialaccount.providers.twitter',
    ...
    'bootstrap4',
    'crispy_forms',
    'rest_framework',
    'sslserver',
    'storages',
    'django.contrib.humanize',
    'el_pagination',
    'django.contrib.staticfiles',
]

It appears that the error pops up once I add url(r"^payments/", include("pinax.stripe.urls")), to my urls.

What were you expecting to happen? / What actually happened?

I get this error:

Model class account.models.Account doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.

With this traceback:

pinax/stripe/mixins.py in <module> at line 7
from .actions import customers
from .conf import settings
try:
    from account.decorators import login_required # <-- this line is highlighted
except ImportError:
    from django.contrib.auth.decorators import login_required

I was thinking maybe there was a conflict with allauth, but disabling it doesn't seem to fix anything. Any ideas?

KatherineMichel commented 6 years ago

I think you might need to add "account", to your installed apps.

vincefav commented 6 years ago

Good call, but now it's definitely clashing with allauth: django.core.exceptions.ImproperlyConfigured: Application labels aren't unique, duplicates: account. Is there a way to rename one of them? Or would that be more trouble than it's worth?

KatherineMichel commented 6 years ago

I'm not sure tbh. Perhaps could be done with apps.py? Apparently two apps can be relabeled when there is a conflict. https://docs.djangoproject.com/en/2.0/ref/applications/#django.apps.AppConfig.label