Skip to content

Commit

Permalink
Merge pull request kookmin-sw#6 from capstone-maru/feat#1-migrate_pos…
Browse files Browse the repository at this point in the history
…tgre

Feat#1 migrate postgre
  • Loading branch information
cheesecrust authored May 20, 2024
2 parents e4b58d8 + 772283a commit 5a452ba
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ jobs:
git pull
touch .env
echo "${{ secrets.ENV }}" > .env
docker stop maru-rec-sys-container
docker rm maru-rec-sys-container
Expand Down
Binary file modified __pycache__/main.cpython-310.pyc
Binary file not shown.
6 changes: 4 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
from sklearn.impute import SimpleImputer

from request import Recommend
import os


state_lock = Lock()

Expand Down Expand Up @@ -50,7 +52,7 @@ class DataModel(BaseModel):
user: UserCategory
post: PostCategory

DATABASE_URL = "postgresql://cheesecrust:0810jack@mydatabase.c3kmc4wcyz81.ap-northeast-2.rds.amazonaws.com/maru"
DATABASE_URL = f"postgresql://{os.getenv('DB_USER')}:{os.getenv('DB_PASSWORD')}@{os.getenv('DB_HOST')}:{os.getenv('DB_PORT')}/{os.getenv('DB_NAME')}"
# DATABASE_URL = "postgresql://localhost:5432/maru"
database = Database(DATABASE_URL)

Expand Down Expand Up @@ -182,7 +184,7 @@ async def fetch_data(user_id, card_type, want_to_find):
user_location = "성북구"

if user['location'] != 'default':
user['location'].split()[1]
user_location = user['location'].split()[1]

user_gender = user['gender']

Expand Down

0 comments on commit 5a452ba

Please sign in to comment.