django-fixturemedia
django-fixturemedia copied to clipboard
ImportError: cannot import name 'NoArgsCommand'
This is an error in newer version of Django (1.10.3). I think this is all that needs done in a few places:
try:
from django.core.management.base import CommandError, NoArgsCommand
except ImportError:
from django.core.management import BaseCommand as NoArgsCommand
from django.core.management import CommandError
Experiencing same issue
Same issue Django 1.11.2, django-fixture-media 0.1.4
Hello,
I have updated the code to ensure compatibility with Django 1.10+. Here are the changes I made:
- Replaced deprecated
option_list
with theadd_arguments
method in management commands. - Updated
raw_input
toinput
for Python 3 compatibility. - Handled apps without
__file__
attribute in management commands. - Replaced
handle_noargs
with thehandle
method. - Ensured use of
apps.get_app_configs
instead ofget_apps
.
These changes should resolve compatibility issues and ensure the project works smoothly with Django 1.10+.
Please review and let me know if there are any issues or further adjustments needed.
Thank you!