Skip to content
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

Getting error when initialising django-zebra #52

Open
aditya-cns opened this issue Nov 13, 2021 · 2 comments
Open

Getting error when initialising django-zebra #52

aditya-cns opened this issue Nov 13, 2021 · 2 comments

Comments

@aditya-cns
Copy link

aditya-cns commented Nov 13, 2021

actions done

  • pip install django-zebra
  • zebra included in INSTALLED_APPS
  • added the webhook urls
    re_path(r'zebra/', include(('zebra.urls', 'zebra'), namespace="zebra",)),
  • ZEBRA_ENABLE_APP set to True
  • then tried ./manage.py makemigrations , got error
  File "project_name/manage.py", line 11, in <module>
    execute_from_command_line(sys.argv)
  File "/home/aditya/dev/cn/pmx_env/lib/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/home/aditya/dev/cn/pmx_env/lib/python3.7/site-packages/django/core/management/__init__.py", line 357, in execute
    django.setup()
  File "/home/aditya/dev/cn/pmx_env/lib/python3.7/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/aditya/dev/cn/pmx_env/lib/python3.7/site-packages/django/apps/registry.py", line 114, in populate
    app_config.import_models()
  File "/home/aditya/dev/cn/pmx_env/lib/python3.7/site-packages/django/apps/config.py", line 211, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/aditya/dev/cn/pmx_env/lib/python3.7/site-packages/zebra/models.py", line 51, in <module>
    class Subscription(DatesModelBase, StripeSubscription):
  File "/home/aditya/dev/cn/pmx_env/lib/python3.7/site-packages/zebra/models.py", line 52, in Subscription
    customer = models.ForeignKey(Customer)
TypeError: __init__() missing 1 required positional argument: 'on_delete'```
@skoczen
Copy link
Member

skoczen commented Nov 15, 2021

Hey @aditya-cns , thanks for this report - at first glance, this looks like you're using a newer version of django than this project supports. It hasn't been updated in a number of years, so back then, on_delete wasn't required.

I'd welcome a PR to bring it up to date, but if you're just trying to get things done, honestly, the built-in strip libraries these days are pretty straightforward. I've built one out not using django-zebra recently, and it was almost as easy as using django-zebra.

Closing this for now, but feel free to reopen if you'd like to take on updating this project with a PR! :)

@skoczen skoczen closed this as completed Nov 15, 2021
@aditya-cns
Copy link
Author

thank you @skoczen for the advice. Appreciate it.👍

I will definitely try to update this with a PR.

@skoczen skoczen reopened this Nov 15, 2021
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