djaodjin / djaodjin-saas

Django application for software-as-service and subscription businesses
Other
564 stars 124 forks source link

Not ready for Django 2.x! TypeError: __init__() missing 1 required positional argument: 'on_delete' #114

Closed sscarduzio closed 5 years ago

sscarduzio commented 6 years ago

I followed the installation instructions, installed djaodjin-saas with pip in my virtual environment (Python 3.6).

So as a result this is my pip freeze:

$ pip freeze
certifi==2018.1.18
chardet==3.0.4
Django==2.0.3
django-countries==5.2
django-extra-views==0.10.0
django-localflavor==2.0
djangorestframework==3.7.7
djaodjin-saas==0.3.1
idna==2.6
Markdown==2.6.11
python-dateutil==2.7.0
pytz==2018.3
razorpay==1.1.1
requests==2.18.4
six==1.11.0
stripe==1.79.1
urllib3==1.22

I typed in all the settings and url modification as in the docs, set up my stripe test credentials, and run the server.

$ python manage.py runserver
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x10305ee18>
Traceback (most recent call last):
  File "/me/tmp/stripe-django/env/lib/python3.6/site-packages/django/utils/autoreload.py", line 225, in wrapper
    fn(*args, **kwargs)
  File "/me/tmp/stripe-django/env/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 112, in inner_run
    autoreload.raise_last_exception()
  File "/me/tmp/stripe-django/env/lib/python3.6/site-packages/django/utils/autoreload.py", line 248, in raise_last_exception
    raise _exception[1]
  File "/me/tmp/stripe-django/env/lib/python3.6/site-packages/django/core/management/__init__.py", line 327, in execute
    autoreload.check_errors(django.setup)()
  File "/me/tmp/stripe-django/env/lib/python3.6/site-packages/django/utils/autoreload.py", line 225, in wrapper
    fn(*args, **kwargs)
  File "/me/tmp/stripe-django/env/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/me/tmp/stripe-django/env/lib/python3.6/site-packages/django/apps/registry.py", line 112, in populate
    app_config.import_models()
  File "/me/tmp/stripe-django/env/lib/python3.6/site-packages/django/apps/config.py", line 198, in import_models
    self.models_module = import_module(models_module_name)
  File "/me/tmp/stripe-django/env/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/me/tmp/stripe-django/env/lib/python3.6/site-packages/saas/models.py", line 211, in <module>
    class Organization(models.Model):
  File "/me/tmp/stripe-django/env/lib/python3.6/site-packages/saas/models.py", line 266, in Organization
    'Organization', null=True, blank=True, related_name='processes')
TypeError: __init__() missing 1 required positional argument: 'on_delete'

Please advise if I need to downgrade the Django version or what to do.

smirolo commented 6 years ago

Hi @sscarduzio , I hadn't realized you had a question there.

None-the-less, released a new version that supports Django 2.0.4. If you run the testsite, you might to (temporary) get the pull request in django-urldecorators.

Also made it clear in the README.md that the latest Django LTS (1.11.x) is supported.

Thanks!

smirolo commented 5 years ago

Closing. We have been actively testing with LTS and latest version (2.1.4 as of writing). Thank you for pushing for a more controlled release process.