Rudra Mutalik
Rudra Mutalik

Reputation: 370

Django Bower - ImportError

I am currently making a django application that requires me to add Bower and django-schedule library. When i try to make migrations, I get this error:

Traceback (most recent call last):
   File "manage.py", line 22, in <module>
     execute_from_command_line(sys.argv)
   File "C:\Python34\lib\site-packages\django\core\management\__init__.py", line 371, in execute_from_command_line
     utility.execute()
   File "C:\Python34\lib\site-packages\django\core\management\__init__.py", line 347, in execute
     django.setup()
   File "C:\Python34\lib\site-packages\django\__init__.py", line 24, in setup
     apps.populate(settings.INSTALLED_APPS)
   File "C:\Python34\lib\site-packages\django\apps\registry.py", line 89, in populate
     app_config = AppConfig.create(entry)
   File "C:\Python34\lib\site-packages\django\apps\config.py", line 90, in create
     module = import_module(entry)
   File "C:\Python34\lib\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 2224, in _find_and_load_unlocked
ImportError: No module named 'djangobower'

my settings.py consists of:

INSTALLED_APPS = [
    'patients.apps.PatientsConfig',
    'accounts.apps.AccountsConfig',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'djangobower',
    'schedule',
]

BOWER_COMPONENTS_ROOT = 'Project root/components/'

BOWER_INSTALLED_APPS = (
    'jquery',
    'jquery-ui',
    'bootstrap',
    'fullcalendar'
)

i am using pycharm as my IDE and in bower apps, it shows jquery-ui and fullcalendar as unresolved, even though I have installed them. Any help is appreciated.

Upvotes: 0

Views: 709

Answers (2)

empty_space
empty_space

Reputation: 135

I think you should have the PROJECT_ROOT variable set somewhere in your settings.py file.

BOWER_COMPONENTS_ROOT = 'Project root/components/'

should be something like

BOWER_COMPONENTS_ROOT = os.path.join(PROJECT_ROOT, 'components')

In my case the variable in the latest Django install was BASE_DIR

Upvotes: 0

Lukas Sch&#246;nsgibl
Lukas Sch&#246;nsgibl

Reputation: 326

It seems like bower isnt really installed check that by pip list.

If it is so did you do ./manage.py bower install ?

Upvotes: 0

Related Questions