Django Suit: ImportError: No module named suit

6.3k Views Asked by At

Any suggestions? I have added this code in settings.py after I install pip install django-suit and ./manage.py collectstatic. Not sure of the error.

from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS as TCP

TEMPLATE_CONTEXT_PROCESSORS = TCP + (
    'django.core.context_processors.request',
)

# Application definition

INSTALLED_APPS = (
    'suit',)

**error**
heroku run ./manage.py syncdb 
Running `./manage.py syncdb` attached to terminal... up, run.8285
Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 280, in execute
    translation.activate('en-us')
  File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 130, in activate
    return _trans.activate(language)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 188, in activate
    _active.value = translation(language)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 177, in translation
    default_translation = _fetch(settings.LANGUAGE_CODE)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 159, in _fetch
    app = import_module(appname)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
    __import__(name)
ImportError: No module named suit
3

There are 3 best solutions below

0
On BEST ANSWER

Issue fixed. I add django-suit==0.2.7 in requirements.txt

0
On

Don't forget make migrate: python manage.py migrate

0
On

In case, someone in stuck in the same issue and adding the line "django-suit==0.2.7" in requrements.txt did not work, then please try adding the latest django-suite version name in the requirements.txt file and it should work.

So, your requirements.txt file will have the following line.

    django-suit==0.2.13

And then run the following command.

    pip install -r requirements.txt

And now, it should work!! ;)