0

I'm trying to allow users on my Django website to login using Twitter and I'm using python social auth. It works fine locally, but when I deploy it to my server (AWS), I get this error:

Environment:


Request Method: GET
Request URL: http://54.164.233.178/login/twitter/?next=

Django Version: 1.6.5
Python Version: 2.7.6
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.sites',
 'django.contrib.sitemaps',
 'meddy1',
 'south',
 'django_google_maps',
 'social.apps.django_app.default')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware')


Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  199.                 response = middleware_method(request, response)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/flatpages/middleware.py" in process_response
  10.             return flatpage(request, request.path_info)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/flatpages/views.py" in flatpage
  36.             url__exact=url, sites__id__exact=site_id)
File "/usr/local/lib/python2.7/dist-packages/django/shortcuts/__init__.py" in get_object_or_404
  113.         return queryset.get(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py" in get
  304.         num = len(clone)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py" in __len__
  77.         self._fetch_all()
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py" in _fetch_all
  857.             self._result_cache = list(self.iterator())
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py" in iterator
  220.         for row in compiler.results_iter():
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py" in results_iter
  713.         for rows in self.execute_sql(MULTI):
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py" in execute_sql
  786.         cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/util.py" in execute
  69.             return super(CursorDebugWrapper, self).execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/util.py" in execute
  53.                 return self.cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py" in __exit__
  99.                 six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/util.py" in execute
  53.                 return self.cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py" in execute
  124.             return self.cursor.execute(query, args)
File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py" in execute
  174.             self.errorhandler(self, exc, value)
File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py" in defaulterrorhandler
  36.     raise errorclass, errorvalue

Exception Type: ProgrammingError at /login/twitter/
Exception Value: (1146, "Table 'meddy2.django_flatpage' doesn't exist")

Any idea why this might be happening? I was using flatpages in the past, but not anymore. I removed it from my code and synced the DB using south. I'm also using Facebook login and that works fine.

maahd
  • 672
  • 2
  • 9
  • 30
  • Sounds like django_flatpage is created using manage.py syncdb command – Rainy Sep 11 '14 at 16:33
  • I dont think its being created because i dont have flatpages in my model – maahd Sep 11 '14 at 16:36
  • Then you need to remove Flatpages Middleware from list of middleware in your settings.py file. – Rainy Sep 11 '14 at 16:46
  • Did it. The problem persists. – maahd Sep 14 '14 at 14:38
  • You probably want to grep your entire source tree for 'flatpage'. `grep -ir flatpage *` – Rainy Sep 14 '14 at 14:53
  • did it. one match which is commented out: "mysite/settings.py: # 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',". Deleted this line and then tried grep again. 0 matches. – maahd Sep 14 '14 at 14:58

0 Answers0