Skip to content
This repository was archived by the owner on Feb 2, 2022. It is now read-only.

Commit a92355f

Browse files
authored
Merge pull request #5 from BUCOMPAdvancedDevelopment/user_interface
Remove firebase integration
2 parents 9eaa049 + 872fde6 commit a92355f

File tree

1 file changed

+21
-24
lines changed

1 file changed

+21
-24
lines changed

AdvancedDevelopment/settings.py

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@
2626
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
2727

2828
# SECURITY WARNING: keep the secret key used in production secret!
29-
SECRET_KEY = 'django-insecure-8@ai$vzq04xi!oq#rl6z@8*h8h^7w8u(6n-g+9ptnvjf*#&o$7'
29+
secrets = secretmanager.SecretManagerServiceClient()
30+
SECRET_KEY = secrets.access_secret_version(
31+
name="projects/idyllic-kit-328813/secrets/django_secret_key/versions/latest")
3032

3133
# SECURITY WARNING: don't run with debug turned on in production!
3234
DEBUG = True
3335

3436
ALLOWED_HOSTS = ["localhost", "127.0.0.1", "idyllic-kit-328813.ew.r.appspot.com"]
3537

36-
3738
# Application definition
3839

3940
INSTALLED_APPS = [
@@ -94,7 +95,6 @@
9495
}
9596
}
9697

97-
9898
# Password validation
9999
# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
100100

@@ -113,7 +113,6 @@
113113
},
114114
]
115115

116-
117116
# Internationalization
118117
# https://docs.djangoproject.com/en/3.2/topics/i18n/
119118

@@ -123,39 +122,37 @@
123122
USE_L10N = True
124123
USE_TZ = True
125124

126-
127125
# Static files (CSS, JavaScript, Images)
128126
# https://docs.djangoproject.com/en/3.2/howto/static-files/
129127

130128
STATIC_URL = '/static/'
131129

132-
133130
# Default primary key field type
134131
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
135132

136133
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
137134

138-
139135
# Certifying Firebase credentials for Firebase integration
140136
# https://jrizmal.medium.com/how-to-authenticate-firebase-users-in-django-rest-framework-c2d90f5a0a11
141137

142-
REST_FRAMEWORK = {
143-
'DEFAULT_AUTHENTICATION_CLASSES': [
144-
'FirebaseAuth.authentication.FirebaseAuthentication',
145-
]
146-
}
138+
# REST_FRAMEWORK = {
139+
# 'DEFAULT_AUTHENTICATION_CLASSES': [
140+
# 'FirebaseAuth.authentication.FirebaseAuthentication',
141+
# ]
142+
# }
147143

148144
# Specify your Google API key as environment variable GOOGLE_API_KEY
149145
GOOGLE_API_KEY = os.environ.get('GOOGLE_API_KEY')
150-
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "F:/Projects/AdvancedDevelopment/firebase_admin_sdk.json"
151-
152-
secrets = secretmanager.SecretManagerServiceClient()
153-
154-
try:
155-
# todo save response to file
156-
response = secrets.access_secret_version(name="projects/idyllic-kit-328813/secrets/Firebase_Admin_SDK/versions/latest")
157-
cred = credentials.Certificate(response)
158-
except PermissionDenied as exception: # todo write to log
159-
cred = credentials.Certificate(os.path.join(BASE_DIR, "firebase_admin_sdk.json"))
160-
161-
firebase_admin.initialize_app(cred)
146+
GOOGLE_APPLICATION_CREDENTIALS = os.path.join(BASE_DIR, "firebase_admin_sdk.json")
147+
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = os.environ.get('GOOGLE_APPLICATION_CREDENTIALS',
148+
GOOGLE_APPLICATION_CREDENTIALS)
149+
150+
# try:
151+
# # todo save response to file
152+
# response = secrets.access_secret_version(
153+
# name="projects/idyllic-kit-328813/secrets/Firebase_Admin_SDK/versions/latest")
154+
# cred = credentials.Certificate(response)
155+
# except PermissionDenied as exception: # todo write to log
156+
# cred = credentials.Certificate(os.path.join(BASE_DIR, "firebase_admin_sdk.json"))
157+
#
158+
# firebase_admin.initialize_app(cred)

0 commit comments

Comments
 (0)