nvbn / django-bower

Easy way to use bower with your django project
https://django-bower.readthedocs.io/
518 stars 75 forks source link

Can't ./manage.py bower install #68

Open lscasanova opened 7 years ago

lscasanova commented 7 years ago

Tried to do a ./manage.py bower install but the result is

manage.py bower: error: unrecognized arguments: install

if I run ./manage.py bower_install instead, I get:

Traceback (most recent call last):
  File "./manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/home/lscasanova/Envs/test/lib/python3.4/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/home/lscasanova/Envs/test/lib/python3.4/site-packages/django/core/management/__init__.py", line 359, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/lscasanova/Envs/test/lib/python3.4/site-packages/django/core/management/__init__.py", line 208, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/home/lscasanova/Envs/test/lib/python3.4/site-packages/django/core/management/__init__.py", line 40, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "/home/lscasanova/Envs/test/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1471, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/home/lscasanova/Envs/test/lib/python3.4/site-packages/djangobower/management/commands/bower_install.py", line 5, in <module>
    class Command(BaseBowerCommand):
  File "/home/lscasanova/Envs/test/lib/python3.4/site-packages/djangobower/management/commands/bower_install.py", line 8, in Command
    option_list = BaseBowerCommand.option_list + (
AttributeError: type object 'BaseBowerCommand' has no attribute 'option_list'

I first got this error trying to run the project django-scheduler-sample, then tried to run on an empty project created by me in a virtualenv with just django 1.10 and django-bower to no effect.

ahmadiga commented 7 years ago

+1

antonioromero commented 7 years ago

It works with Django 1.9.5 but not with 1.10. Is it maybe https://docs.djangoproject.com/en/1.10/releases/1.10/#django-contrib-staticfiles ?

dannyshox commented 7 years ago

+1

dkleissa commented 7 years ago

+1

./manage.py bower_install throws and exception in 1.10 as well

dzhuang commented 7 years ago

+1

OscarPDR commented 7 years ago

None of the other commands seems to work either: update, info, freeze... (Django 1.10.1)

ivanistheone commented 7 years ago

Running ./manage.py bower_install produces:

AttributeError: type object 'BaseBowerCommand' has no attribute 'option_list'

using django_bower-5.1.0 and Django-1.10.1

ivanistheone commented 7 years ago

Monkey patching the file djangobower/management/commands/bower_install.py as follows

if not hasattr(BaseBowerCommand, 'option_list'):
    base_opions_list = ()
else:
    base_opions_list = BaseBowerCommand.option_list

option_list = base_opions_list + (
    make_option('-F',     # this line and lines below it are unchanged
                action='store_true',
                dest='force',
                default=False,
                help='Force installation of latest package version on conflict'),
)

worked.

inducer commented 7 years ago

PR for this: #69

inducer commented 6 years ago

Fixed through #71.