Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Production deployment fix #426

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ketphan02
Copy link
Collaborator

No description provided.

@ketphan02 ketphan02 self-assigned this Apr 12, 2024
@ketphan02 ketphan02 added the api API-related feature label Apr 23, 2024
@ketphan02 ketphan02 marked this pull request as ready for review April 23, 2024 00:14
@ketphan02 ketphan02 requested a review from Opeyem1a as a code owner April 23, 2024 00:14
@ketphan02 ketphan02 requested a review from keyvankhademi April 23, 2024 00:15
@@ -24,9 +24,10 @@ def check_hash(api_token, encrypted_api_token) -> bool:
"""
Checks if the API token matches the encrypted API token.
"""
print(api_token, encrypted_api_token)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit;

@@ -29,7 +29,8 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False

ALLOWED_HOSTS = list(os.environ.get("DJANGO_ALLOWED_HOSTS", "").split(" "))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you should remove ALLOWED_HOSTS!

@@ -29,7 +29,8 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False

ALLOWED_HOSTS = list(os.environ.get("DJANGO_ALLOWED_HOSTS", "").split(" "))
CORS_ALLOW_HEADERS = "*"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allow all headers could potentially cause security issues in prod. Please specify exactly the headers you need.

@@ -4,7 +4,7 @@
from pathlib import Path
import dotenv

env_file = next((Path(__file__).parent.parent / "env").glob("*.env"))
env_file = next((Path(__file__).parent.parent / "env").glob(".env*"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't this cause issues if there are multiple env files present in the folder? It seems like it will randomly choose 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api API-related feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants