Django-cms ImportError: No module named sitescms - django

I am trying install django-cms. But I got following error
Traceback (most recent call last):
File "/home/savad/virtuals/kw/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 229, in wrapper
fn(*args, **kwargs)
File "/home/savad/virtuals/kw/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 107, in inner_run
autoreload.raise_last_exception()
File "/home/savad/virtuals/kw/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 252, in raise_last_exception
six.reraise(*_exception)
File "/home/savad/virtuals/kw/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 229, in wrapper
fn(*args, **kwargs)
File "/home/savad/virtuals/kw/local/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/savad/virtuals/kw/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/home/savad/virtuals/kw/local/lib/python2.7/site-packages/django/apps/config.py", line 119, in create
import_module(entry)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named sitescms
I used django-cms==3.4.2 and django==1.8.17.

To me it looks like you're missing a comma in the list of your INSTALLED_APPS in settings.py.
Could it be that it says
...,
'sites'
'cms',
...
instead of
...,
'sites',
'cms',
....
The missing comma results in sitescms.

Related

AttributeError: module 'myapp' has no attribute 'startswith' in Django

Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x046E1780>
Traceback (most recent call last):
File "C:\Users\BS146\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "C:\Users\BS146\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\commands\runserver.py", line 112, in inner_run
autoreload.raise_last_exception()
File "C:\Users\BS146\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\autoreload.py", line 248, in raise_last_exception
raise _exception[1]
File "C:\Users\BS146\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\__init__.py", line 327, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\BS146\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "C:\Users\BS146\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\BS146\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\apps\registry.py", line 89, in populate
app_config = AppConfig.create(entry)
File "C:\Users\BS146\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\apps\config.py", line 90, in create
module = import_module(entry)
File "C:\Users\BS146\AppData\Local\Programs\Python\Python36-32\lib\importlib\__init__.py", line 117, in import_module
if name.startswith('.'):
AttributeError: module 'myapp' has no attribute 'startswith'
Your INSTALLED_APPS has an entry that is not a string.
It should be
INSTALLED_APPS = [..., 'myapp']
, not
INSTALLED_APPS = [..., myapp]

python-django/python manage.py runserver error

I am trying to run the server using this command python manage.py runserver but i am getting this error even i have installed mysqlclient and mysql-python:
C:\Users\neethu\sencha\sencha-sdks\sencha_workspace\webapp>python manage.py runserver
Unhandled exception in thread started by <function wrapper at 0x0397EC70>
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\django\utils\autoreload.py", line 228, in wrapper
fn(*args, **kwargs)
File "C:\Python27\lib\site-packages\django\core\management\commands\runserver.py", line 117, in inner_run
autoreload.raise_last_exception()
File "C:\Python27\lib\site-packages\django\utils\autoreload.py", line 251, in raise_last_exception
six.reraise(*_exception)
File "C:\Python27\lib\site-packages\django\utils\autoreload.py", line 228, in wrapper
fn(*args, **kwargs)
File "C:\Python27\lib\site-packages\django\__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Python27\lib\site-packages\django\apps\registry.py", line 108, in populate
app_config.import_models()
File "C:\Python27\lib\site-packages\django\apps\config.py", line 202, in import_models
self.models_module = import_module(models_module_name)
File "C:\Python27\lib\importlib\__init__.py", line 37, in import_module
__import__(name)
File "C:\Python27\lib\site-packages\django\contrib\auth\models.py", line 4, in <module>
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
File "C:\Python27\lib\site-packages\django\contrib\auth\base_user.py", line 52, in <module>
class AbstractBaseUser(models.Model):
File "C:\Python27\lib\site-packages\django\db\models\base.py", line 124, in __new__
new_class.add_to_class('_meta', Options(meta, app_label))
File "C:\Python27\lib\site-packages\django\db\models\base.py", line 325, in add_to_class
value.contribute_to_class(cls, name)
File "C:\Python27\lib\site-packages\django\db\models\options.py", line 214, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
File "C:\Python27\lib\site-packages\django\db\__init__.py", line 33, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "C:\Python27\lib\site-packages\django\db\utils.py", line 211, in __getitem__
backend = load_backend(db['ENGINE'])
File "C:\Python27\lib\site-packages\django\db\utils.py", line 115, in load_backend
return import_module('%s.base' % backend_name)
File "C:\Python27\lib\importlib\__init__.py", line 37, in import_module
__import__(name)
File "C:\Python27\lib\site-packages\django\db\backends\mysql\base.py", line 30, in <module>
'Did you install mysqlclient or MySQL-python?' % e
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: DLL load failed: %1 is not a valid Win32 application..
Did you install mysqlclient or MySQL-python?

Django ImportError: No module named although it is already in my python search path

I am solving this for quite a long time already.
I print like this.
python2.7 -c "import sys; print sys.path"
And I saw my module directly there.
['', '/home/khantthulinn/lib/python2.7/pip-8.1.2-py2.7.egg',
'/home/khantthulinn/lib/python2.7',
'/home/khantthulinn/lib/python2.7', '/usr/lib64/python27.zip',
'/usr/lib64/python2.7', '/usr/lib64/python2.7/plat-linux2',
'/usr/lib64/python2.7/lib-tk', '/usr/lib64/python2.7/lib-old',
'/usr/lib64/python2.7/lib-dynload',
'/home/khantthulinn/.local/lib/python2.7/site-packages',
'/usr/lib64/python2.7/site-packages',
'/usr/lib64/python2.7/site-packages/PIL',
'/usr/lib64/python2.7/site-packages/geos',
'/usr/lib/python2.7/site-packages']
But I always get this error. How shall I solve?
Unhandled exception in thread started by Traceback (most recent call last): File
"/home/khantthulinn/webapps/mmspeaker/lib/python2.7/Django-1.8.14-py2.7.egg/django/utils/autoreload.py",
line 229, in wrapper
fn(*args, **kwargs) File "/home/khantthulinn/webapps/mmspeaker/lib/python2.7/Django-1.8.14-py2.7.egg/django/core/management/commands/runserver.py",
line 107, in inner_run
autoreload.raise_last_exception() File "/home/khantthulinn/webapps/mmspeaker/lib/python2.7/Django-1.8.14-py2.7.egg/django/utils/autoreload.py",
line 252, in raise_last_exception
six.reraise(*_exception) File "/home/khantthulinn/webapps/mmspeaker/lib/python2.7/Django-1.8.14-py2.7.egg/django/utils/autoreload.py",
line 229, in wrapper
fn(*args, **kwargs) File "/home/khantthulinn/webapps/mmspeaker/lib/python2.7/Django-1.8.14-py2.7.egg/django/init.py",
line 18, in setup
apps.populate(settings.INSTALLED_APPS) File "/home/khantthulinn/webapps/mmspeaker/lib/python2.7/Django-1.8.14-py2.7.egg/django/apps/registry.py",
line 85, in populate
app_config = AppConfig.create(entry) File "/home/khantthulinn/webapps/mmspeaker/lib/python2.7/Django-1.8.14-py2.7.egg/django/apps/config.py",
line 86, 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 push_notifications

Django developement server module is not installed but is

I'm try run development server byt I recive error like this:
Unhandled exception in thread started by <function wrapper at 0x807ad8848>
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 229, in wrapper
fn(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 107, in inner_run
autoreload.raise_last_exception()
File "/usr/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 252, in raise_last_exception
six.reraise(*_exception)
File "/usr/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 229, in wrapper
fn(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/usr/local/lib/python2.7/site-packages/django/apps/config.py", line 86, in create
module = import_module(entry)
File "/usr/local/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named avatar
I'm using virtualenv and I actived it and project using it and I installed django-avatar there.
django-avatar
On my local server this module work normally :)
You have some idea what is wrong?
I solved my problem using absolute path to python in my enviroment that resolve it. And add after that manage.py.
/usr/home/login/virtualenvs/env_name/bin/python passenger_wsgi.py
/usr/home/login/virtualenvs/env_name/bin/python manage.py

my Django app has broken for some reason getting anerror message

I was cleaning out some of the unused projects on my computer and when I tried to use my latest project I get this error message
Unhandled exception in thread started by <function wrapper at 0x107b01d70>
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/Library/Python/2.7/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "/Library/Python/2.7/site-packages/django/utils/autoreload.py", line 249, in raise_last_exception
six.reraise(*_exception)
File "/Library/Python/2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/Library/Python/2.7/site-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Library/Python/2.7/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/Library/Python/2.7/site-packages/django/apps/config.py", line 90, in create
module = import_module(entry)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named crispy_forms
is this even fixable. This is a lot of work and hours for me so I hope it is
ImportError: No module named crispy_forms
pip install --upgrade django-crispy-forms
Add crispy_forms to your INSTALLED_APPS in settings.py:
INSTALLED_APPS = (
...
'crispy_forms',
)