Skip to content

Commit

Permalink
Merge pull request #210 from zstenger93/api_connections
Browse files Browse the repository at this point in the history
Api connections
  • Loading branch information
zstenger93 authored Jan 7, 2024
2 parents 6657c18 + 85519ca commit ae5e684
Show file tree
Hide file tree
Showing 8 changed files with 10,913 additions and 6,768 deletions.
50 changes: 22 additions & 28 deletions backend/backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,15 @@
# SECURITY WARNING: don't run with debug turned on in production!


ALLOWED_HOSTS = ['localhost', '127.0.0.1', '0.0.0.0', '10.13.7.5', 'transcendence-backend-znhl.onrender.com']
ALLOWED_HOSTS = ['localhost', '127.0.0.1', '0.0.0.0', '10.13.7.5', 'transcendence-backend-znhl.onrender.com', 'https://transcendence-frontend-3otz.onrender.com']

# Authentication settings
# if DEBUG:
# REDIRECT_URI = "http://localhost:8000"
# else:
# REDIRECT_URI = "https://transcendence-backend-znhl.onrender.com"

REDIRECT_URI = "https://transcendence-backend-znhl.onrender.com"
if DEBUG == 'True':
REDIRECT_URI = "http://localhost:8000"
else:
REDIRECT_URI = "https://transcendence-backend-znhl.onrender.com"

if DEBUG:
if DEBUG == 'True':
print("DEBUG: True: ", DEBUG)
else:
print("DEBUG: False: ", DEBUG)
Expand Down Expand Up @@ -62,7 +60,7 @@
'corsheaders.middleware.CorsMiddleware',
]

CORS_ALLOWED_ORIGINS = ["http://localhost:3000", "https://zstenger93.github.io"]
CORS_ALLOWED_ORIGINS = ["http://localhost:3000", "https://transcendence-frontend-3otz.onrender.com", "https://zstenger93.github.io"]

CORS_ALLOW_CREDENTIALS = True
CORS_ORIGIN_ALLOW_ALL = True
Expand Down Expand Up @@ -117,25 +115,21 @@
# }

# THIS IS THE DATABASE CONFIGURATION FOR THE DOCKER CONTAINER
# if DEBUG:
# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.postgresql',
# 'NAME': 'transcend_users_db',
# 'USER': 'transcend_user',
# 'PASSWORD': 'transcend_pwd',
# 'HOST': 'db',
# 'PORT': '5432',
# }
# }
# else:
# DATABASES = {
# 'default': dj_database_url.parse(os.getenv('DATABASE_URL'))
# }

DATABASES = {
'default': dj_database_url.parse(os.getenv('DATABASE_URL'))
}
if DEBUG == 'True':
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'transcend_users_db',
'USER': 'transcend_user',
'PASSWORD': 'transcend_pwd',
'HOST': 'db',
'PORT': '5432',
}
}
else:
DATABASES = {
'default': dj_database_url.parse(os.getenv('DATABASE_URL'))
}

# Password validation
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
Expand Down
16 changes: 5 additions & 11 deletions docker/frontend/frontend.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
FROM node:14
FROM node:20

WORKDIR /app/frontend

COPY package*.json ./
COPY ./frontend/package*.json ./

RUN npm install && \
npm install react-router-dom --save && \
npm install tailwindcss postcss autoprefixer --save && \
npm install react-slick slick-carousel --save && \
npm install react-i18next i18next --save && \
npm install three --save && \
npm install --save-dev @babel/plugin-proposal-private-property-in-object && \
npm install matchmedia-polyfill && \
npm install axios --save
RUN npm install -g npm@latest

RUN npm install

COPY . .

Expand Down
Loading

0 comments on commit ae5e684

Please sign in to comment.