Open
Conversation
- Changed from generic POSTGRES_DB/USER/PASSWORD to DB_USER_NAME/USER/PASSWORD - Ensures user service connects to its own database (user_db) instead of shared mydatabase - Fixes issue where all services were connecting to the same database - Part of microservices database isolation improvements
There was a problem hiding this comment.
Pull Request Overview
This PR updates Django database configuration settings and uncomments the ALLOWED_HOSTS setting. The changes modify environment variable names for database credentials from POSTGRES_* to DB_USER_* prefixes.
- Uncomments the ALLOWED_HOSTS setting to enable allowed host validation
- Renames database configuration environment variables from
POSTGRES_*toDB_USER_*naming convention
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
91
to
92
| 'HOST': config('POSTGRES_HOST', default='localhost'), | ||
| 'PORT': config('POSTGRES_PORT', default='5432'), |
There was a problem hiding this comment.
The database configuration is inconsistent: credential variables use 'DB_USER_' prefix while HOST and PORT still use 'POSTGRES_' prefix (lines 91-92). This inconsistency makes configuration management confusing. Either all variables should use the 'DB_USER_' pattern or all should use 'POSTGRES_' for consistency.
Suggested change
| 'HOST': config('POSTGRES_HOST', default='localhost'), | |
| 'PORT': config('POSTGRES_PORT', default='5432'), | |
| 'HOST': config('DB_USER_HOST', default='localhost'), | |
| 'PORT': config('DB_USER_PORT', default='5432'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 변경 내용 요약
POSTGRES_DB,POSTGRES_USER,POSTGRES_PASSWORD)를각 서비스 전용 환경 변수(
DB_USER_NAME,DB_USER_USER,DB_USER_PASSWORD)로 분리했습니다.모든 서비스가 같은 DB(
mydatabase)를 공유하던 문제를 해결했습니다.🔗 관련 이슈
💡 주요 변경 사항
config/settings.py에서 서비스별 DB 환경 변수로 변경POSTGRES_DB→DB_USER_NAMEPOSTGRES_USER→DB_USER_USERPOSTGRES_PASSWORD→DB_USER_PASSWORD🧩 리뷰어 참고 사항
.env파일의 값이 변경되었으므로, 로컬 환경에서 테스트 시.env를 새로 적용해야 합니다.mydatabase)는 더 이상 사용하지 않으며, 각 서비스별 신규 DB가 생성됩니다.docker exec user python manage.py migrate✅ 테스트 방법
각 서비스가 올바른 데이터베이스에 연결되는지 확인:
Nickname check API 테스트: