For some reason, my last Post got lost. :( Trying again. Here my settings.py
import os > > import sys > > >> web_dir = >> (os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), >> os.pardir))) > > src_dir = (os.path.abspath(os.path.join(web_dir, os.pardir))) > > lib_dir = os.path.join(src_dir, "lib") > > >> sys.path.append(lib_dir) > > >> >> # Build paths inside the project like this: os.path.join(BASE_DIR, ...) > > BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) > > >> # Quick-start development settings - unsuitable for production > > # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ > > >> # SECURITY WARNING: keep the secret key used in production secret! > > SECRET_KEY = os.environ['SECRET_KEY'] > > >> ACME_CHALLENGE_URL_SLUG = "" > > ACME_CHALLENGE_TEMPLATE_CONTENT = "" > > >> >> # SECURITY WARNING: don't run with debug turned on in production! > > DEBUG = os.environ['DEBUG'] == 'True' > > >> PROJECT_DIR = os.path.dirname(os.path.abspath(__file__)) > > >> ALLOWED_HOSTS = ['*'] > > >> # Application definition > > >> INSTALLED_APPS = [ > > 'django.contrib.admin', > > 'django.contrib.auth', > > 'django.contrib.contenttypes', > > 'django.contrib.sessions', > > 'django.contrib.messages', > > 'django.contrib.staticfiles', > > 'rest_framework', > > 'acme_challenge', > > 'rest_framework.authtoken', > > 'corsheaders', > > 'django_countries', > > 'rest_registration', > > 'apps.users', > > 'apps.api_lib', > > ] > > >> >> MIDDLEWARE = [ > > 'corsheaders.middleware.CorsMiddleware', > > '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', > > ] > > >> CORS_ORIGIN_WHITELIST = ( > > '...........', > > 'localhost:8000', > > 'localhost:4200' > > ) > > >> ROOT_URLCONF = 'app.urls' > > >> TEMPLATES = [ > > { > > 'BACKEND': 'django.template.backends.django.DjangoTemplates', > > 'DIRS': [], > > '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 = 'app.wsgi.application' > > >> >> DATABASES = { > > 'default': { > > 'ENGINE': 'django.db.backends.postgresql', > > 'HOST': os.environ['DB_HOST'], > > 'PORT': os.environ['DB_PORT'], > > 'NAME': os.environ['DB_NAME'], > > 'USER': os.environ['DB_USER'], > > 'PASSWORD': os.environ['DB_PASSWORD'] or '' > > } > > } > > >> >> 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 = 'UTC' > > >> USE_I18N = True > > >> USE_L10N = True > > >> USE_TZ = True > > >> # Static files (CSS, JavaScript, Images) > > # https://docs.djangoproject.com/en/1.11/howto/static-files/ > > >> STATIC_URL = os.environ['STATIC_URL'] # /static/ if DEBUG else Google >> Cloud bucket url > > >> # collectstatic directory (located OUTSIDE the base directory) > > # TODO: configure the name and path to your static bucket directory (where >> collectstatic will copy to) > > STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), '..................') > > >> STATICFILES_DIRS = [ > > # TODO: configure the name and path to your development static >> directory > > os.path.join(BASE_DIR, 'static'), # static directory (in the top >> level directory) for local testing > > ] > > >> PASSWORD_HASHERS = [ > > 'django.contrib.auth.hashers.PBKDF2PasswordHasher', > > 'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher', > > 'django.contrib.auth.hashers.Argon2PasswordHasher', > > 'django.contrib.auth.hashers.BCryptSHA256PasswordHasher', > > ] > > >> REST_FRAMEWORK = { > > 'DEFAULT_AUTHENTICATION_CLASSES': ( > > 'rest_framework.authentication.TokenAuthentication', > > ), > > } > > >> REST_FRAMEWORK_TOKEN_EXPIRE_HOURS = 24 > > >> AUTH_USER_MODEL = "users.user" > > >> REST_REGISTRATION = { > > 'REGISTER_VERIFICATION_URL': 'https://www............/verify-user/', > > 'RESET_PASSWORD_VERIFICATION_URL': >> 'https://www.........../reset-password/', > > 'REGISTER_EMAIL_VERIFICATION_URL': >> 'https://www............/verify-email/', > > 'VERIFICATION_FROM_EMAIL': 'no-reply@...........', > > } > > >> EMAIL_HOST = os.environ['SMTP_HOST'] > > EMAIL_HOST_USER = os.environ['SMTP_USER'] > > EMAIL_HOST_PASSWORD = os.environ['SMTP_PASSWORD'] > > >> APPEND_SLASH = True > > On Friday, 12 October 2018 18:37:38 UTC+2, Chen Yu wrote: > > Hi Lukas, > > It is a little difficult to say for sure where your app goes wrong with > the information you have provided. If possible, can you post (or contact me > directly if you prefer) your `settings.py`? Thanks. > > Chen > > On Friday, October 12, 2018 at 6:49:11 AM UTC-7, Lukas Elsner wrote: >> >> Hi :) >> Thank you for your answer. I am actually not using Node.js. >> This is a Django (Python) application. >> I tried everything Google mentions in the documentation. >> Still no luck with DB-Connection :( >> >> >> Cheers >> Lukas >> >> >> On Fri, 12 Oct 2018 at 15:29, 'George (Cloud Platform Support)' via >> Google App Engine <[email protected]> wrote: >> > >> > Hello Lukas, >> > >> > You should concentrate on your node.js code, rather than on app.yaml >> configuration, and beta settings. The "Using Cloud SQL for PostgreSQL" >> documentation page instructs on how to set environment variables, add >> environment variables in app.standard.yaml file, and add a Node.js >> PostgreSQL client library to your application's package.json. Sample code >> is also provided. >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups "Google App Engine" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> an email to [email protected]. >> > To post to this group, send email to [email protected]. >> > Visit this group at https://groups.google.com/group/google-appengine. >> > To view this discussion on the web visit >> https://groups.google.com/d/msgid/google-appengine/52efb810-3a5d-4aa6-9371-d0e446e470e7%40googlegroups.com. >> >> >> > For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/google-appengine. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/35a86be3-5ce8-433e-8cdd-57b0c8bdd918%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
