Reputation: 27
Newbie Python and Django coder
I am trying to apply some migration files necessary for a registration plugin (django-registration-redux==1.3). However when I run the python manage.py migrate command, I receive the following error
Traceback (most recent call last):
File "manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "//Projects/hellowebapp/venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
utility.execute()
File "//Projects/hellowebapp/venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 347, in execute
django.setup()
File "//Projects/hellowebapp/venv/lib/python3.7/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "//Projects/hellowebapp/venv/lib/python3.7/site-packages/django/apps/registry.py", line 112, in populate
app_config.import_models()
File "//Projects/hellowebapp/venv/lib/python3.7/site-packages/django/apps/config.py", line 198, in import_models
self.models_module = import_module(models_module_name)
File "//Projects/hellowebapp/venv/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 "//Projects/hellowebapp/venv/lib/python3.7/site-packages/registration/models.py", line 206, in <module>
class RegistrationProfile(models.Model):
File "//Projects/hellowebapp/venv/lib/python3.7/site-packages/registration/models.py", line 222, in RegistrationProfile
user = models.OneToOneField(UserModelString(), verbose_name=_('user'))
TypeError: __init__() missing 1 required positional argument: 'on_delete'
Not sure how to resolve this error or fully understand what it is saying.
Upvotes: 0
Views: 88
Reputation: 26
After a quick look at the django-registration-redux
docs (https://django-registration-redux.readthedocs.io/en/latest/quickstart.html), for one I would recommend updating to the latest version of this package, which is 2.5. The problem I find most of the time with this type of error has to do with the django settings, i.e. if the correct middleware was added, INSTALLED_APPS
, etc. I hope I could help.
Upvotes: 1