I am trying to setup a django-dash demo via: https://github.com/barseghyanartur/django-dash.
I have manually installed all the dependencies for django-dash (because of work computer/proxy issues) and supposedly successfully installed django-dash as well. Following the tutorial, I went to add several layouts and plugins to the INSTALLED_APPS settings for my app. There are no issues when I add all of the plugins except for the ones in asterisks - memo and news.
INSTALLED_APPS = (
# ...
'dash',
'dash.contrib.layouts.android',
'dash.contrib.layouts.bootstrap2',
'dash.contrib.layouts.windows8',
'dash.contrib.plugins.dummy',
'dash.contrib.plugins.image',
**'dash.contrib.plugins.memo',
'dash.contrib.plugins.news',**
'dash.contrib.plugins.rss_feed',
'dash.contrib.plugins.url',
'dash.contrib.plugins.video',
'dash.contrib.plugins.weather',
# ...
)
This is the error message I get. I thought maybe files were missing but when I check the folders, autoreload.py etc are all there. What might be the issue?
Unhandled exception in thread started by <function wrapper at 0x0208ECB0>
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\django\utils\autoreload.py", line 93, in w
rapper
fn(*args, **kwargs)
File "C:\Python27\lib\site-packages\django\core\management\commands\runserver.
py", line 101, in inner_run
self.validate(display_num_errors=True)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 310,
in validate
num_errors = get_validation_errors(s, app)
File "C:\Python27\lib\site-packages\django\core\management\validation.py", lin
e 34, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 196, in
get_app_errors
self._populate()
File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 75, in
_populate
self.load_app(app_name, True)
File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 99, in
load_app
models = import_module('%s.models' % app_name)
File "C:\Python27\lib\site-packages\django\utils\importlib.py", line 40, in im
port_module
__import__(name)
File "C:\Python27\lib\site-packages\django_dash-0.4.5-py2.7.egg\dash\models.py
", line 21, in <module>
class DashboardSettings(models.Model):
File "C:\Python27\lib\site-packages\django_dash-0.4.5-py2.7.egg\dash\models.py
", line 32, in DashboardSettings
layout_uid = models.CharField(_("Layout"), max_length=25, choices=get_regist
ered_layouts())
File "C:\Python27\lib\site-packages\django_dash-0.4.5-py2.7.egg\dash\base.py",
line 1491, in get_registered_layouts
ensure_autodiscover()
File "C:\Python27\lib\site-packages\django_dash-0.4.5-py2.7.egg\dash\base.py",
line 1432, in ensure_autodiscover
autodiscover()
File "C:\Python27\lib\site-packages\django_dash-0.4.5-py2.7.egg\dash\discover.
py", line 33, in autodiscover
do_discover(PLUGINS_MODULE_NAME)
File "C:\Python27\lib\site-packages\django_dash-0.4.5-py2.7.egg\dash\discover.
py", line 27, in do_discover
__import__('{0}.{1}'.format(app, module_name))
File "C:\Python27\lib\site-packages\django_dash-0.4.5-py2.7.egg\dash\contrib\p
lugins\memo\dash_plugins.py", line 10, in <module>
from dash.contrib.plugins.memo.forms import MemoForm, TinyMCEMemoForm
File "C:\Python27\lib\site-packages\django_dash-0.4.5-py2.7.egg\dash\contrib\p
lugins\memo\forms.py", line 9, in <module>
from tinymce.widgets import TinyMCE
File "C:\Python27\lib\site-packages\django_tinymce-1.5.2-py2.7.egg\tinymce\wid
gets.py", line 10, in <module>
import tinymce.settings
File "C:\Python27\lib\site-packages\django_tinymce-1.5.2-py2.7.egg\tinymce\set
tings.py", line 16, in <module>
JS_ROOT = getattr(settings, 'TINYMCE_JS_ROOT',os.path.join(settings.STATIC_R
OOT, 'tiny_mce'))
File "C:\Python27\lib\ntpath.py", line 64, in join
result_drive, result_path = splitdrive(path)
File "C:\Python27\lib\ntpath.py", line 94, in splitdrive
if p[1:2] == ':':
TypeError: 'NoneType' object has no attribute '__getitem__'
As documented (recently), django-tinymce package is required for news and memo plugins.
https://github.com/barseghyanartur/django-dash/tree/master/src/dash/contrib/plugins/news
https://github.com/barseghyanartur/django-dash/tree/master/src/dash/contrib/plugins/memo
Unfortunately, django-tinymce is not yet compatible with Python 3 (there is, however, a python 3 compatible branch which is aimed to become master one day).
In case you're using Python 3, you should simply use TinyMCE without django-tinymce (which isn't much work anyway).
Related
I haven't touched a project in a long time and realized I upgraded my django to version 1.11.12. Trying to re-run project (runserver) and found several out of date packages (easy-thumbnails and psycopg2). Ran pip install upgrade on those. Now when I run, I get the following error and it seems like it is coming form my models? Not sure what it is telling me though or the proper course of action. Maybe there was another upgrade step I missed when I upgraded to django 1.11? (sorry been ages since I touched this code)
Unhandled exception in thread started by <function wrapper at 0x104ab2500>
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 228, in wrapper
fn(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 116, in inner_run
autoreload.raise_last_exception()
File "/usr/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 251, in raise_last_exception
six.reraise(*_exception)
File "/usr/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 228, in wrapper
fn(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
app_config.import_models()
File "/usr/local/lib/python2.7/site-packages/django/apps/config.py", line 202, in import_models
self.models_module = import_module(models_module_name)
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/Users/shane.thomas/programming/sw_nga_site/swsite/models.py", line 12, in <module>
from filer.fields.image import FilerImageField
File "/usr/local/lib/python2.7/site-packages/filer/fields/image.py", line 4, in <module>
from ..models import Image
File "/usr/local/lib/python2.7/site-packages/filer/models/__init__.py", line 3, in <module>
from .clipboardmodels import * # flake8: noqa
File "/usr/local/lib/python2.7/site-packages/filer/models/clipboardmodels.py", line 9, in <module>
from . import filemodels
File "/usr/local/lib/python2.7/site-packages/filer/models/filemodels.py", line 18, in <module>
from .foldermodels import Folder
File "/usr/local/lib/python2.7/site-packages/filer/models/foldermodels.py", line 240, in <module>
mptt.register(Folder)
File "/usr/local/lib/python2.7/site-packages/mptt/__init__.py", line 12, in register
from mptt.models import MPTTModelBase
File "/usr/local/lib/python2.7/site-packages/mptt/models.py", line 379, in <module>
class MPTTModel(six.with_metaclass(MPTTModelBase, models.Model)):
File "/usr/local/lib/python2.7/site-packages/django/utils/six.py", line 808, in __new__
return meta(name, bases, d)
File "/usr/local/lib/python2.7/site-packages/mptt/models.py", line 262, in __new__
cls = super_new(meta, class_name, bases, class_dict)
File "/usr/local/lib/python2.7/site-packages/django/db/models/base.py", line 162, in __new__
new_class.add_to_class(obj_name, obj)
File "/usr/local/lib/python2.7/site-packages/django/db/models/base.py", line 325, in add_to_class
value.contribute_to_class(cls, name)
File "/usr/local/lib/python2.7/site-packages/mptt/managers.py", line 81, in contribute_to_class
super(TreeManager, self).contribute_to_class(model, name)
File "/usr/local/lib/python2.7/site-packages/django/db/models/manager.py", line 120, in contribute_to_class
setattr(model, name, ManagerDescriptor(self))
AttributeError: can't set attribute
I am trying to configure django-activity-stream for my project using the guidelines here django-activity-stream
I have models User(django-contrib-auth), Article
As mentioned in the docs, I register the models for the activity using the statements
registry.register(User)
registry.register(Article)
while executing the runserver command, I get the following error
Unhandled exception in thread started by <function wrapper at 0x7f3a680547d0>
Traceback (most recent call last):
File "/home/xxxx/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 93, in wrapp
er
fn(*args, **kwargs)
File "/home/xxxx/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py",
line 102, in inner_run
self.validate(display_num_errors=True)
File "/home/xxxx/local/lib/python2.7/site-packages/django/core/management/base.py", line 310, in
validate
num_errors = get_validation_errors(s, app)
File "/home/xxxx/local/lib/python2.7/site-packages/django/core/management/validation.py", line 34
, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File "/home/xxxx/local/lib/python2.7/site-packages/django/db/models/loading.py", line 196, in get
_app_errors
self._populate()
File "/home/xxxx/local/lib/python2.7/site-packages/django/db/models/loading.py", line 75, in _pop
ulate
self.load_app(app_name, True)
File "/home/xxxx/local/lib/python2.7/site-packages/django/db/models/loading.py", line 99, in load
_app
models = import_module('%s.models' % app_name)
File "/home/xxxx/local/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import
_module
__import__(name)
File "/home/xxxx/local/lib/python2.7/site-packages/registration/models.py", line 15, in <module>
User = get_user_model()
File "/home/xxxx/local/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 127, in
get_user_model
user_model = get_model(app_label, model_name)
File "/home/xxxx/local/lib/python2.7/site-packages/django/db/models/loading.py", line 271, in get
_model
self._populate()
File "/home/xxxx/local/lib/python2.7/site-packages/django/db/models/loading.py", line 75, in _pop
ulate
self.load_app(app_name, True)
File "/home/xxxx/local/lib/python2.7/site-packages/django/db/models/loading.py", line 99, in load
_app
models = import_module('%s.models' % app_name)
File "/home/xxxx/local/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import
_module
__import__(name)
File "/home/xxxx/maldio/maldio_project/links/models.py", line 115, in <module>
registry.register(User)
File "/home/xxxx/local/lib/python2.7/site-packages/actstream/registry.py", line 85, in register
self[model_class] = setup_generic_relations(model_class)
File "/home/xxxx/local/lib/python2.7/site-packages/actstream/registry.py", line 39, in setup_gene
ric_relations
setattr(Action, attr_value, None)
AttributeError: 'NoneType' object has no attribute 'actions_with_auth_user_as_actor'
Is there something that I missed?
Thanks in advance
This is an issue with version 0.5.1 of django-activity-stream. You can fix this error by removing 0.5.1 and installing 0.5 version.
You can track this bug here:
https://github.com/justquick/django-activity-stream/issues/208
Looks like you're "User" variable has a null object in it, rather than a valid User object.
What is the code you are using to create the "User" and "Article" objects that you are passing in the functions that you show?
I have migrated django website from live server to my localhost, i took the backup of posrgresql database and attached to my localhost i have changed the databse connection details in the live_setting.py and also installed the required packages which were already installed on the live server but i am unable to run the website on my localhost when i use manage.py ruserver command i got the following errors.
Unhandled exception in thread started by <bound method Command.inner_run of <django.contrib.staticfiles.management.commands.runserver.Command object at 0x02BB6530>>
Traceback (most recent call last):
File "C:\Python26\lib\site-packages\django\core\management\commands\runserver.py", line 91, in inner_run self.validate(display_num_errors=True)
File "C:\Python26\lib\site-packages\django\core\management\base.py", line 266,in validate num_errors = get_validation_errors(s, app)
File "C:\Python26\lib\site-packages\django\core\management\validation.py", line 30, in get_validation_errors for (app_name, error) in get_app_errors().items():
File "C:\Python26\lib\site-packages\django\db\models\loading.py", line 158, inget_app_errors self._populate()
File "C:\Python26\lib\site-packages\django\db\models\loading.py", line 67, in_populate self.load_app(app_name)
File "C:\Python26\lib\site-packages\django\db\models\loading.py", line 88, in load_app models = import_module('.models', app_name)
File "C:\Python26\lib\site-packages\django\utils\importlib.py", line 35, in import_module__import__(name)
File "C:\Python26\lib\site-packages\django_social_auth3-0.7.20-py2.6.egg\social_auth\models.py", line 8, in <module>'social_auth.db.django_models'))
File "C:\Python26\lib\site-packages\django\utils\importlib.py", line 35, in import_module__import__(name)
File "C:\Python26\lib\site-packages\django_social_auth3-0.7.20-py2.6.egg\social_auth\db\django_models.py", line 5, in <module>from social_auth.db.base import UserSocialAuthMixin, AssociationMixin, \
File "C:\Python26\lib\site-packages\django_social_auth3-0.7.20-py2.6.egg\social_auth\db\base.py", line 7, in <module> from openid.association import Association as OIDAssociation
File "build\bdist.win32\egg\openid\association.py", line 37, in <module>
File "build\bdist.win32\egg\openid\cryptutil.py", line 33, in <module>
File "build\bdist.win32\egg\openid\oidutil.py", line 16, in <module> ImportError: No module named parse
I am using python 2.6 and django 1.4.3, how can i solve these errors, i am new to python/django development.
Was on a Linux machine, working on a Django website. Recently got a new computer and am running windows 8 on it. I am using PyCharm, and am trying to start the local server up for the first time. The last dependency I installed was zinnia, and now it is giving me this odd error. This is the output that PyCharm is giving me before not working.
Unhandled exception in thread started by <bound method Command.inner_run of
<django.contrib.staticfiles.management.commands.runserver.Command object at 0x029643F0>>
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\django\core\management\commands\runserver.py",
line 92, in inner_run
self.validate(display_num_errors=True)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 280, in
validate
num_errors = get_validation_errors(s, app)
File "C:\Python27\lib\site-packages\django\core\management\validation.py", line 35, in
get_validation_errors
for (app_name, error) in get_app_errors().items():
File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 166, in
get_app_errors
self._populate()
File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 72, in _populate
self.load_app(app_name, True)
File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 96, in load_app
models = import_module('.models', app_name)
File "C:\Python27\lib\site-packages\django\utils\importlib.py", line 35, in
import_module
__import__(name)
File "C:\Python27\lib\site-packages\django_blog_zinnia-0.12.3-py2.7.egg\zinnia\models
\__init__.py", line 2, in <module>
from zinnia.models.entry import Entry
File "C:\Python27\lib\site-packages\django_blog_zinnia-0.12.3-py2.7.egg\zinnia\models
\entry.py", line 23, in <module>
from zinnia.models.author import Author
File "C:\Python27\lib\site-packages\django_blog_zinnia-0.12.3-py2.7.egg\zinnia\models
\author.py", line 10, in <module>
class Author(User):
File "C:\Python27\lib\site-packages\django\db\models\base.py", line 123, in __new__
raise TypeError("%s cannot proxy the swapped model '%s'." % (name, base_meta.swapped))
TypeError: Author cannot proxy the swapped model 'main.MyUser'.
Although the error suggests that you are using the newest version of zinnia (12.3) it seem that's not the case. If you look at the models/authors.py file of the current version you will see:
class Author(get_user_model()):
"""
Proxy model around :class:`django.contrib.auth.models.get_user_model`.
"""
which will deal with Django 1.5's custom user model. The traceback you supplied has the following:
class Author(User):
which is the old approach. Have a look here for more information:
https://github.com/Fantomas42/django-blog-zinnia/issues/215
https://github.com/Fantomas42/django-blog-zinnia/commit/81ad5de6a0cf5b6fc9b79ca1649c4ee822c4f2d4
I am getting this error in settings of django-testapp when I run
pradeep#pradeep:~/projects/python/gae_django_nonrel_app/django-testapp$ python manage.py runserver
Traceback (most recent call last):
File "manage.py", line 14, in <module>
execute_manager(settings)
File "/home/pradeep/projects/python/gae_django_nonrel_app/django-testapp/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/home/pradeep/projects/python/gae_django_nonrel_app/django-testapp/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/pradeep/projects/python/gae_django_nonrel_app/django-testapp/django/core/management/__init__.py", line 261, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/home/pradeep/projects/python/gae_django_nonrel_app/django-testapp/django/core/management/__init__.py", line 67, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/home/pradeep/projects/python/gae_django_nonrel_app/django-testapp/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/home/pradeep/projects/python/gae_django_nonrel_app/django-testapp/djangoappengine/management/commands/runserver.py", line 5, in <module>
from django.db import connections
File "/home/pradeep/projects/python/gae_django_nonrel_app/django-testapp/django/db/__init__.py", line 78, in <module>
connection = connections[DEFAULT_DB_ALIAS]
File "/home/pradeep/projects/python/gae_django_nonrel_app/django-testapp/django/db/utils.py", line 94, in __getitem__
conn = backend.DatabaseWrapper(db, alias)
File "/home/pradeep/projects/python/gae_django_nonrel_app/django-testapp/dbindexer/base.py", line 54, in DatabaseWrapper
return Wrapper(merged_settings, *args, **kwargs)
File "/home/pradeep/projects/python/gae_django_nonrel_app/django-testapp/dbindexer/base.py", line 37, in __init__
super(BaseDatabaseWrapper, self).__init__(*args, **kwargs)
File "/home/pradeep/projects/python/gae_django_nonrel_app/django-testapp/djangoappengine/db/base.py", line 290, in __init__
self.ops = DatabaseOperations(self)
TypeError: __init__() takes exactly 1 argument (2 given)
Usually errors like this come from mismatching versions of django, djangoappengine or django-toolbox. You'd want to double check to make sure you have the right version of each.
As #dragonx said the error was because I was using latest branch of django-nonrel and which didn't support completely django1.5 and so on. I didn't try to resolve it either because we have better options with better support and functionalitites to deploy app on PAAS such as HEROKU. So I moved on to HEROKU.