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

Django 2.0 Support #52

Open
bobort opened this issue Dec 3, 2017 · 12 comments
Open

Django 2.0 Support #52

bobort opened this issue Dec 3, 2017 · 12 comments

Comments

@bobort
Copy link

bobort commented Dec 3, 2017

ForeignKeys require an on_delete argument. Therefore, CreatingUserField doesn't work. Please update for Django 2.0 support.

@decibyte
Copy link
Contributor

I'm currently working on 2.0 support (PR #55), but I can't tell how far I am. I keep running into new things that doesn't work. Also, I'm not sure we'll be able to get my PR merged in and pushed to PyPI. But I'm focusing on fixing the code first :)

@myourshaw
Copy link

myourshaw commented Dec 20, 2017

I, too, am having problems with 2.0 on a large application we are trying to modernize. I get "missing 1 required positional argument: 'on_delete'" on startup.

[yoursham@cmoco-sys-dev-web cmoco-sys_project]$ ${SINGULARITY_EXEC} gunicorn config.wsgi:application;
[2017-12-20 09:26:37 -0700] [6398] [INFO] Starting gunicorn 19.7.1
[2017-12-20 09:26:37 -0700] [6398] [INFO] Listening at: http://127.0.0.1:8000 (6398)
[2017-12-20 09:26:37 -0700] [6398] [INFO] Using worker: sync
[2017-12-20 09:26:37 -0700] [6404] [INFO] Booting worker with pid: 6404
[2017-12-20 09:26:38 -0700] [6404] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/gunicorn/arbiter.py", line 578, in spawn_worker
    worker.init_process()
  File "/usr/local/lib/python3.6/site-packages/gunicorn/workers/base.py", line 126, in init_process
    self.load_wsgi()
  File "/usr/local/lib/python3.6/site-packages/gunicorn/workers/base.py", line 135, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/usr/local/lib/python3.6/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/usr/local/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
    return self.load_wsgiapp()
  File "/usr/local/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/usr/local/lib/python3.6/site-packages/gunicorn/util.py", line 352, in import_app
    __import__(module)
  File "/home/cmoco/cmoco-sys_project/config/wsgi.py", line 14, in <module>
    application = get_wsgi_application()
  File "/usr/local/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
    django.setup(set_prefix=False)
  File "/usr/local/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/python3.6/site-packages/django/apps/registry.py", line 112, in populate
    app_config.import_models()
  File "/usr/local/lib/python3.6/site-packages/django/apps/config.py", line 198, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/home/cmoco/cmoco-sys_project/lims/userprofiles/models.py", line 8, in <module>
    from audit_log.models import AuthStampedModel
  File "/usr/local/lib/python3.6/site-packages/audit_log/models/__init__.py", line 5, in <module>
    class AuthStampedModel(Model):
  File "/usr/local/lib/python3.6/site-packages/audit_log/models/__init__.py", line 10, in AuthStampedModel
    created_by = CreatingUserField(verbose_name = _("created by"), related_name = "created_%(app_label)s_%(class)s_set")
  File "/usr/local/lib/python3.6/site-packages/audit_log/models/fields.py", line 14, in __init__
    super(LastUserField, self).__init__(to = to, null = null, editable = editable, **kwargs)
TypeError: __init__() missing 1 required positional argument: 'on_delete'
[2017-12-20 09:26:38 -0700] [6404] [INFO] Worker exiting (pid: 6404)
[2017-12-20 09:26:38 -0700] [6398] [INFO] Shutting down: Master
[2017-12-20 09:26:38 -0700] [6398] [INFO] Reason: Worker failed to boot.

@sdreher
Copy link

sdreher commented Feb 6, 2018

I'm also looking for Django 2.0 support. This #55 seems to take care of the issues. Definitely would appreciate if this were merged and updated on pypi.

@dakab1
Copy link

dakab1 commented Feb 21, 2018

Hi
Is there any solution to this in Django version 2.0 yet?

@MHzarini
Copy link

come on guys, i need this

@JanMalte
Copy link
Contributor

@decibyte @vvangelovski Which issues are still open and prevent a release with Django 2.0 support?

@PeterSchwarzHPI
Copy link

Any news over here?

@Fhall21
Copy link

Fhall21 commented Jul 27, 2018

Hey there! Still getting the error:
TypeError: __initi__() missing 1 required positional argument: 'on_delete
from line 14 in fields.py:
super(LastUserField, self).__init__(to = to, null = null, editable = editable, ** kwargs)
Is there any news on the progress?

@pawisoon
Copy link

HI there!
I have same issue on Django 2.1.5
TypeError: __init__() missing 1 required positional argument: 'on_delete'

@decibyte
Copy link
Contributor

For anyone running into this problem: I'd suggest installing from GitHub instead of PyPI, untill @vvangelovski finds the time to push a new version to PyPI.

@AbhiRawat95
Copy link

@decibyte any update on this issue? Any update on when it will be pushed to PyPI.

@pakal
Copy link

pakal commented Jun 3, 2019

For people who need urgent django compatibility, I shamelessly advise to use https://github.com/pakal/django-compat-patcher until all dependencies are updated to Django2

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