Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PythonSocial Auth Twitter flatpage_Python_Django_Python Social Auth_Django Flatpages - Fatal编程技术网

PythonSocial Auth Twitter flatpage

PythonSocial Auth Twitter flatpage,python,django,python-social-auth,django-flatpages,Python,Django,Python Social Auth,Django Flatpages,我正在尝试允许Django网站上的用户使用Twitter登录,我正在使用python social auth。它在本地运行良好,但当我将其部署到我的服务器(AWS)时,会出现以下错误: 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 Application

我正在尝试允许Django网站上的用户使用Twitter登录,我正在使用python social auth。它在本地运行良好,但当我将其部署到我的服务器(AWS)时,会出现以下错误:

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")

知道为什么会这样吗?我以前用过flatpages,但现在不用了。我从代码中删除了它,并使用south同步了DB。我也在使用Facebook登录,效果很好

听起来django_flatpage是使用manage.py syncdb命令创建的。我认为它没有被创建,因为我的模型中没有flatpages。然后您需要从settings.py文件的中间件列表中删除flatpages中间件。完成了。问题仍然存在。您可能希望为“flatpage”刷新整个源代码树<代码>grep-ir flatpage*