GoodCloud / django-zebra

Forms, widgets, template tags and examples that make Stripe + Django easier.
MIT License
194 stars 68 forks source link

Getting error when initialising django-zebra #52

Open aditya-cns opened 3 years ago

aditya-cns commented 3 years ago

actions done


  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 commented 3 years ago

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! :)

aditya-cns commented 3 years ago

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

I will definitely try to update this with a PR.