<small id='0FYpd'></small><noframes id='0FYpd'>

  1. <i id='0FYpd'><tr id='0FYpd'><dt id='0FYpd'><q id='0FYpd'><span id='0FYpd'><b id='0FYpd'><form id='0FYpd'><ins id='0FYpd'></ins><ul id='0FYpd'></ul><sub id='0FYpd'></sub></form><legend id='0FYpd'></legend><bdo id='0FYpd'><pre id='0FYpd'><center id='0FYpd'></center></pre></bdo></b><th id='0FYpd'></th></span></q></dt></tr></i><div id='0FYpd'><tfoot id='0FYpd'></tfoot><dl id='0FYpd'><fieldset id='0FYpd'></fieldset></dl></div>
    <tfoot id='0FYpd'></tfoot>

      • <bdo id='0FYpd'></bdo><ul id='0FYpd'></ul>

    1. <legend id='0FYpd'><style id='0FYpd'><dir id='0FYpd'><q id='0FYpd'></q></dir></style></legend>
    2. 500 App Engine(Google Cloud)中我的Django应用程序出现服务器错误

      500 Server Error in my Django App in App Engine (Google Cloud)(500 App Engine(Google Cloud)中我的Django应用程序出现服务器错误)
    3. <legend id='U9jDF'><style id='U9jDF'><dir id='U9jDF'><q id='U9jDF'></q></dir></style></legend>

      <i id='U9jDF'><tr id='U9jDF'><dt id='U9jDF'><q id='U9jDF'><span id='U9jDF'><b id='U9jDF'><form id='U9jDF'><ins id='U9jDF'></ins><ul id='U9jDF'></ul><sub id='U9jDF'></sub></form><legend id='U9jDF'></legend><bdo id='U9jDF'><pre id='U9jDF'><center id='U9jDF'></center></pre></bdo></b><th id='U9jDF'></th></span></q></dt></tr></i><div id='U9jDF'><tfoot id='U9jDF'></tfoot><dl id='U9jDF'><fieldset id='U9jDF'></fieldset></dl></div>

      • <small id='U9jDF'></small><noframes id='U9jDF'>

          <tbody id='U9jDF'></tbody>

              <tfoot id='U9jDF'></tfoot>
                <bdo id='U9jDF'></bdo><ul id='U9jDF'></ul>
              • 本文介绍了500 App Engine(Google Cloud)中我的Django应用程序出现服务器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我是Google Cloud新手,按照https://cloud.google.com/python/django/appengine中的步骤成功部署了App。但是,当我转到页面https://PROJECT_ID.REGION_ID.r.appspot.com时,显示下一条消息:

                错误:服务器错误 服务器遇到错误,无法完成您的请求。 请在30秒后重试。

                我看到这真的很常见,但找不到任何有用的解决方案。如有任何帮助,我将不胜感激。


                我的settings.py:

                from pathlib import Path
                import os
                BASE_DIR = Path(__file__).resolve().parent.parent
                SECRET_KEY = '…'
                DEBUG = True
                ALLOWED_HOSTS = ['*']
                INSTALLED_APPS = [
                    'KhalilApp.apps.KhalilappConfig',
                    'django.contrib.admin',
                    'django.contrib.auth',
                    'django.contrib.contenttypes',
                    'django.contrib.sessions',
                    'django.contrib.messages',
                    'django.contrib.staticfiles',
                ]
                
                MIDDLEWARE = [
                    'django.middleware.security.SecurityMiddleware',
                    'django.contrib.sessions.middleware.SessionMiddleware',
                    'django.middleware.common.CommonMiddleware',
                    'django.middleware.csrf.CsrfViewMiddleware',
                    'django.contrib.auth.middleware.AuthenticationMiddleware',
                    'django.contrib.messages.middleware.MessageMiddleware',
                    'django.middleware.clickjacking.XFrameOptionsMiddleware',
                ]
                
                ROOT_URLCONF = 'DjangoServer.urls'
                
                TEMPLATES = [
                    {
                        'BACKEND': 'django.template.backends.django.DjangoTemplates',
                        'DIRS': [os.path.join(BASE_DIR,'KhalilApp/templates'), os.path.join(BASE_DIR,'Mapilib')],
                        'APP_DIRS': True,
                        'OPTIONS': {
                            'context_processors': [
                                'django.template.context_processors.debug',
                                'django.template.context_processors.request',
                                'django.contrib.auth.context_processors.auth',
                                'django.contrib.messages.context_processors.messages',
                            ],
                        },
                    },
                ]
                
                WSGI_APPLICATION = 'DjangoServer.wsgi.application'
                
                import pymysql  # noqa: 402
                pymysql.version_info = (1, 4, 6, 'final', 0)  # change mysqlclient version
                pymysql.install_as_MySQLdb()
                if os.getenv('GAE_APPLICATION', None):
                    DATABASES = {
                        'default': {
                            'ENGINE': 'django.db.backends.mysql',
                            'HOST': '/cloudsql/…’,
                            'USER': 'maestros',
                            'PASSWORD': '…',
                            'NAME': 'principal',
                        }
                    }
                else:
                    DATABASES = {
                        'default': {
                            'ENGINE': 'django.db.backends.mysql',
                            'HOST': '127.0.0.1',
                            'PORT': '…',
                            'NAME': 'principal',
                            'USER': 'maestros',
                            'PASSWORD': '…',
                        }
                    }
                if os.getenv('TRAMPOLINE_CI', None):
                    DATABASES = {
                        'default': {
                            'ENGINE': 'django.db.backends.sqlite3',
                            'NAME': os.path.join(BASE_DIR, 'db.sqlite3')
                        }
                    }
                
                AUTH_PASSWORD_VALIDATORS = [
                    {
                        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
                    },
                    {
                        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
                    },
                    {
                        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
                    },
                    {
                        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
                    },
                ]
                LANGUAGE_CODE = 'en-us'
                TIME_ZONE = 'Europe/Madrid'
                USE_I18N = True
                USE_L10N = True
                USE_TZ = True
                STATIC_URL = '/static/'
                STATIC_ROOT = 'static'
                

                推荐答案

                您的代码中有错误。500服务器错误表示您的应用程序中有错误。

                这篇关于500 App Engine(Google Cloud)中我的Django应用程序出现服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Split a Pandas column of lists into multiple columns(将 Pandas 的列表列拆分为多列)
                How does the @property decorator work in Python?(@property 装饰器在 Python 中是如何工作的?)
                What is the difference between old style and new style classes in Python?(Python中的旧样式类和新样式类有什么区别?)
                How to break out of multiple loops?(如何打破多个循环?)
                How to put the legend out of the plot(如何将传说从情节中剔除)
                Why is the output of my function printing out quot;Nonequot;?(为什么我的函数输出打印出“无?)

                1. <tfoot id='l0nWj'></tfoot>
                  • <legend id='l0nWj'><style id='l0nWj'><dir id='l0nWj'><q id='l0nWj'></q></dir></style></legend>

                    <i id='l0nWj'><tr id='l0nWj'><dt id='l0nWj'><q id='l0nWj'><span id='l0nWj'><b id='l0nWj'><form id='l0nWj'><ins id='l0nWj'></ins><ul id='l0nWj'></ul><sub id='l0nWj'></sub></form><legend id='l0nWj'></legend><bdo id='l0nWj'><pre id='l0nWj'><center id='l0nWj'></center></pre></bdo></b><th id='l0nWj'></th></span></q></dt></tr></i><div id='l0nWj'><tfoot id='l0nWj'></tfoot><dl id='l0nWj'><fieldset id='l0nWj'></fieldset></dl></div>
                      <tbody id='l0nWj'></tbody>

                    <small id='l0nWj'></small><noframes id='l0nWj'>

                          <bdo id='l0nWj'></bdo><ul id='l0nWj'></ul>