django-pgcrypto: AttributeError: module 'django.db.models' has no attribute 'SubfieldBase' - django

I am trying to add django-pgcrypto to my django project but I am getting an error message:
class EncryptedTextField (six.with_metaclass(models.SubfieldBase, BaseEncryptedField)):
AttributeError: module 'django.db.models' has no attribute 'SubfieldBase'
Do you have any advice on how this could be fixed? I am using django 1.10 and python 3.5

Related

AttributeError: __name__ while importing pandas in django

I have installed Django pandas but while importing in views.py it is throwing attribute error.
Could someone help me out?
error snippet

Python Version 2.7.6. psutil version 2.1.3 - AttributeError: 'module' object has no attribute 'users'

I am running UBUNTU 14.04. Python version is 2.7.6 and psutil version is 2.1.3
I import psutil and then call one of the following only to get errors.
import psutil
psutil.users()
psutil.pids()
psutil.cpu_times()
AttributeError: 'module' object has no attribute 'users'
AttributeError: 'module' object has no attribute 'pids'
AttributeError: 'module' object has no attribute 'boot_time'
I do not have this issue with psutil.cpu_percent() and psutil.cpu_times()
Try to print psutil.__version__. It's likely you're using an old version (< 2.X).

Dojango with django 1.5

I'm a django noob. I just added dojango 0.5.5 in project apps. I use Django 1.5 and when i try to vie the test page dojango offers at mysite/dojango/test/ i got this error:
__init__() got an unexpected keyword argument 'namedtuple_as_object'
the error is in the dojango base template file where there is:
'isDebug':{{ DOJANGO.DEBUG|json }},
Has someone encountered this issue? How do you resolve it?
I found a similar issue. Try to find
from django.utils import simplejson as json
and replace it with
try:
import json
except ImportError:
from django.utils import simplejson as json

'module' object has no attribute 'PeriodicTask' when accessing /admin

I have djcelery installed and it seems it's installed properly:
In [1]: from djcelery import models
In [2]: models.PeriodicTask
Out[2]: djcelery.models.PeriodicTask
However, when I access the admin site, I get this error which seems to imply that there's an issue with djcelery. I suspect it has to do with my setup. The details of the error are below. Anyone seen this or have any thoughts?
AttributeError at /admin/
'module' object has no attribute 'PeriodicTask'
Request Method: GET
Django Version: 1.4
Exception Type: AttributeError
Exception Value:
'module' object has no attribute 'PeriodicTask'
Exception Location: /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py in import_module, line 37
Python Version: 2.7.1
It turned out that I was getting this error because of an old tasks.pyc that was in one of my applications (where tasks.py had been removed). Djcelery automatically tries to load tasks.py file in all the installed apps, and this one apparently referenced PeriodicTask incorrectly.

Django nonrel error "No Module name models"

Guys,
I Started playing with django-nonrel, and am trying to run my old django app on it.
My app was done on django 1.2.1 & python 2.6.
When i fire up the local server, there are a couple of warnings but the server starts well.
But when i try to run the main page from the browser, django throws the following error
ImportError at /bytex
No module named bytexpro.bytex.models
Request Method: GET
Request URL: http://127.0.0.1:8000/bytex
Django Version: 1.3 beta 1
Exception Type: ImportError
Exception Value:
No module named bytexpro.bytex.models
Exception Location: E:\home\web\bytex\bytexpro\bytex\admin.py in <module>, line 1
Python Executable: C:\python26\python.exe
...
My admin.py looks like this
from bytexpro.bytex.models import ItemGroup
from bytexpro.bytex.models import Item
from bytexpro.bytex.models import Supplier
....
Anything i i have forgotten to include?
Gath
try
from bytex.models import ....