Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
초기 세팅
Browse files Browse the repository at this point in the history
-
  • Loading branch information
tomorrow9913 committed Nov 17, 2023
1 parent d479032 commit e8f12b2
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ jobs:
sudo pip install -r requirements.txt
echo "############# Server Stop #############"
sudo pkill uvicorn
sudo fuser -k 80/tcp
echo "############# Server Start #############"
sudo python3 -m uvicorn main:app
sudo python3 main.py
else
echo "############## git pull: Error ##############"
exit 1;
Expand Down
8 changes: 4 additions & 4 deletions core/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
from starlette.config import Config

config = Config('.env')
SQLALCHEMY_DATABASE_URL = config('SQLALCHEMY_DATABASE_URL')
DATABASE_URL = f"mariadb:///?User={config.get('USER')}&Password={config.get('PASSWORD')}&Database={config.get('DATABASE')}&Server={config.get('HOST')}&Port={config.get('PORT')}"

# Craate Engin for mariadb
engine = create_engine(DATABASE_URL, echo=False)

engine = create_engine(
SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False}
)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)

Base = declarative_base()
Expand Down
2 changes: 1 addition & 1 deletion core/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


class User(Base):
__tablename__ = "user"
__tablename__ = "Users"

id = Column(Integer, primary_key=True, autoincrement=True)
stdId = Column(String, unique=True, nullable=False)
Expand Down
2 changes: 0 additions & 2 deletions core/schemas/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
from core.schemas import playlist_info
from core.schemas import song
from core.schemas import user

1 change: 0 additions & 1 deletion dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from core.database import get_db

config = Config('.env')
SQLALCHEMY_DATABASE_URL = config('SQLALCHEMY_DATABASE_URL')

ACCESS_TOKEN_EXPIRE_MINUTES = float(config('ACCESS_TOKEN_EXPIRE_MINUTES'))
SECRET_KEY = config('SECRET_KEY')
Expand Down
1 change: 0 additions & 1 deletion internal/admin_crud.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from sqlalchemy.orm import Session

from core.models.models import User


Expand Down
Binary file modified requirements.txt
Binary file not shown.
2 changes: 0 additions & 2 deletions routers/user/users_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from routers.user.user_crud import pwd_context

config = Config('.env')
SQLALCHEMY_DATABASE_URL = config('SQLALCHEMY_DATABASE_URL')

ACCESS_TOKEN_EXPIRE_MINUTES = float(config('ACCESS_TOKEN_EXPIRE_MINUTES'))
SECRET_KEY = config('SECRET_KEY')
Expand All @@ -27,7 +26,6 @@
tags=["user"]
)


# User
# Create
@router.post("/register", status_code=status.HTTP_204_NO_CONTENT)
Expand Down

0 comments on commit e8f12b2

Please sign in to comment.