Django Suit: ImportError: No module named suit - django

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

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!! ;)

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

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

Related

process to load database in django project

what is the correct process to move a django cms_project to the server?
I create the database from my project like this
./manage.py dumpdata > resource/ddbb/20160817_db.json
I save inside the project in resource file
I move the entire project to the server and after that I execute that command
python manage.py loaddata resource/ddbb/20160817_db.json
But I obtain this error
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 341, in execute
django.setup()
File "/usr/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/usr/lib/python2.7/site-packages/django/apps/config.py", line 90, in create
module = import_module(entry)
File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named djangocms_admin_style
any idea how to solvent?
Thanks in advances
This error means django cannot find a package named djangocms_admin_style. It seems like you are using django-admin-shortcuts. In that case you have to make sure that djangocms_admin_style and djangocms_admin_style to INSTALLED_APPS of your settings.py after installing djangocms_admin_style with pip`. Use command below to install djangocms_admin_style
pip install djangocms_admin_style
as per docs add 'djangocms_admin_style' to your INSTALLED_APPS just before 'django.contrib.admin'

django-admin --version error

I was working on a Django project and I ran to the error below please help.
I tried to check my django version with the " django-admin --version " command and i ran into this error below.
Traceback (most recent call last):
File "/usr/local/bin/django-admin", line 11, in <module>
sys.exit(execute_from_command_line())
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 328, in execute
django.setup()
File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py", line 86, in create
module = import_module(entry)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named south
You have include south in your INSTALLED_APPS settings, but it is not installed.
From the traceback, it looks as if you are using Django 1.7 or later, so South is no longer required. You should remove it from INSTALLED_APPS in your settings.

Django unable to migrate database on Heroku

I try to deploy app on Heroku but after running command 'heroku run python manage.py migrate' I get an error:
Running `python manage.py migrate` attached to terminal... up, run.5928
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 385, in execute_from_command_line
utility.execute()
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 377, 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 288, in run_from_argv
self.execute(*args, **options.__dict__)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute
output = self.handle(*args, **options)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 63, in handle
executor = MigrationExecutor(connection, self.migration_progress_callback)
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/migrations/executor.py", line 17, in __init__
self.loader = MigrationLoader(self.connection)
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/migrations/loader.py", line 48, in __init__
self.build_graph()
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/migrations/loader.py", line 173, in build_graph
self.load_disk()
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/migrations/loader.py", line 103, in load_disk
migration_module = import_module("%s.%s" % (module_name, migration_name))
File "/app/.heroku/python/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/app/joins/migrations/0004_auto_20150211_1924.py", line 7, in <module>
class Migration(migrations.Migration):
File "/app/joins/migrations/0004_auto_20150211_1924.py", line 18, in Migration
preserve_default=True,
TypeError: __init__() got an unexpected keyword argument 'preserve_default'
Do you have any suggestion?
You can try to see this :
Django 1.7.1 added support for the preserve_default param in AlterField. Therefore an upgrade of Django from version 1.7 will resolve the issue.
pip install django --upgrade
python manage.py migrate
From : Django 1.7 Migrations
.

How to use ArrayField in Django using PostgreSQL DB?

I want to do this import in my django models.py:
from django.contrib.postgres.fields import ArrayField
I read this documentation https://docs.djangoproject.com/en/dev/ref/contrib/ and I added
'django.contrib.postgres' into my INSTALLED_APPS in settings.py, but when I try to sync my db or to runserver I got "ImportError: No module named postgres"
Is there something else I should do or install? django.contrib.postgres is part of the core distribution right?
This is traceback:
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "c:\Python27\lib\site-packages\django\core\management\__init__.py", line 399, in execute_from_com
utility.execute()
File "c:\Python27\lib\site-packages\django\core\management\__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "c:\Python27\lib\site-packages\django\core\management\base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "c:\Python27\lib\site-packages\django\core\management\base.py", line 280, in execute
translation.activate('en-us')
File "c:\Python27\lib\site-packages\django\utils\translation\__init__.py", line 130, in activate
return _trans.activate(language)
File "c:\Python27\lib\site-packages\django\utils\translation\trans_real.py", line 188, in activate
_active.value = translation(language)
File "c:\Python27\lib\site-packages\django\utils\translation\trans_real.py", line 177, in translation
default_translation = _fetch(settings.LANGUAGE_CODE)
File "c:\Python27\lib\site-packages\django\utils\translation\trans_real.py", line 159, in _fetch
app = import_module(appname)
File "c:\Python27\lib\site-packages\django\utils\importlib.py", line 40, in import_module
__import__(name)
ImportError: No module named postgres
django.contrib.postgres will be a part of 1.8 release.
Fortunately there are several unofficial implementations postgresql arrays in django. One of the most notable being djorm-pgarray. Another option is django-dbarray when Django 1.8 eventually gets rolled out, migration shouldn't be too difficult.

django1.4.0:ImportError: No module named base

Now I have a problem as the title. Here is my environment:
OS:ubuntu 10.10
Python:2.6.6
Django:1.4 pre-alpha
Before, I installed Django 1.1.1 for the The Django Book. Today , I removed Django 1.1.1 by cmd: sudo apt-get install --purge python-django, then get the latest version of 1.4 pre-alpha.
when I followed the tutorial on the docs.djangoproject.com, and execute cmd: python manage.py shell, it comes some error and the infomation like this:
Traceback (most recent call last):
File "manage.py", line 9, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.6/dist-packages/django/core/management/__init__.py", line 422, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.6/dist-packages/django/core/management/__init__.py", line 361, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", line 222, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", line 355, in handle
return self.handle_noargs(**options)
File "/usr/local/lib/python2.6/dist-packages/django/core/management/commands/shell.py", line 46, in handle_noargs
from django.db.models.loading import get_models
File "/usr/local/lib/python2.6/dist-packages/django/db/__init__.py", line 27, in <module>
connection = connections[DEFAULT_DB_ALIAS]
File "/usr/local/lib/python2.6/dist-packages/django/db/utils.py", line 81, in __getitem__
backend = load_backend(db['ENGINE'])
File "/usr/local/lib/python2.6/dist-packages/django/db/utils.py", line 23, in load_backend
return import_module('.base', backend_name)
File "/usr/local/lib/python2.6/dist-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
ImportError: No module named base
Could some guys tell me how solve this problem?
Thanks!!
The problem is probably because You have no full path for your DB backend. You probably have:
'ENGINE': 'sqlite3',
instead of:
'ENGINE': 'django.db.backends.sqlite3',
You must call manage.py from the folder where settings.py is located: ../manage.py shell
(In case using sqlite3)
(And djando 1.4)