AttributeError: __name__ while importing pandas in django - django

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

Related

AttributeError: type object 'DeleteAccount' has no attribute 'DAccount'

I'm using Python 2.7, webapp2 and GAE for developing a web app.
I'm facing a problem which i don't understand, since I know what it means but everything I did seems correct.
I get the error
AttributeError: type object 'DeleteAccount' has no attribute 'DAccount'
when i try to access the URL myappdomain/DeleteAccount/
I imported in the main file the python file DeleteAccount.py
import DeleteAccount
I linked the URL with the relative class DAccount of DeleteAccount
webapp2.Route(r'/DeleteAccount/',DeleteAccount.DAccount)
That's my DeleteAccount.py file
import logging
import webapp2
from webapp2_extras import sessions
import datastore
import FBLogin
class BaseHandler(webapp2.RequestHandler):
def dispatch(self):
self.session_store = sessions.get_store(request=self.request)
try:
webapp2.RequestHandler.dispatch(self)
finally:
self.session_store.save_sessions(self.response)
#webapp2.cached_property
def session(self):
return self.session_store.get_session()
class DAccount(BaseHandler):
def get(self):
w = self.response.write
logging.info("deleting account")
w('I've deleted the account')
What's wrong? I did what I've done with every other module and everything has worked well with them

ImportError : cannot import name AppCache

I have installed Django 1.8.3 Then i created my project. I need to import the AppCache but not able to import it. In Django shell i wrote
from django.db.models.loading import AppCache
Error is:
ImportError: cannot import name AppCache
Please help me out.
AppCache is not a part of django.db.models.loading from django 1.7 onwards.For more information you can read this link

Django SerializerDoesNotExist 'geojson'?

I'm trying to serialize data in the geojson format however whenever I use
json = serialize("geojson", coordinate.objects.all())
response = HttpResponse(json)
return response
django gives me
SerializerDoesNotExist at /getmarkers/
'geojson'
this works fine
json = serialize("json", coordinate.objects.all())
surely anyone else who has tried using the geojson serializer has ran into the same issue. I've installed the GDAL library as told to do so in the docs. Any ideas? Can't seem to really find anything in the docs about what modules must be imported I've tried
from django.contrib.gis import gdal
Does not throw an error but also does not fix the issue
I'm using Django 1.8
You need to include the geojson serializer in settings.py
SERIALIZATION_MODULES = {
"geojson": "django.contrib.gis.serializers.geojson",
}

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.