안녕하세요, 강사님. 아래와 같이 End-Point에 생성이 안되어서 문의드립니다. 강사님처럼 Legacy serving 창이 뜨지도 않을 뿐더러 [use model for inference]를 클릭해서 생성하려고 해도 아무런 반응이 없더라구요. 제가 설정에서 뭔가를 잘못한 것일까요?? 아니면 현재 구독이 무료 계정이라서 그런걸까요..? 마지막 강의까지 다 와서 막혀버렸네요 ㅠ
google colab 오픈 하여 새노트를 열면 로드 에러가 발생합니다. 어떻게 해야 하나요? ============================= A network error occurred and the request could not be completed. GapiError: A network error occurred and the request could not be completed. at $ L.PE [as constructor] ( https://ssl.gstatic.com/colaboratory-static/common/a17fd496db698d4637390557595457ce/external_binary_l10n__ko.js:1733:732 ) at new $L ( https://ssl.gstatic.com/colaboratory-
31강에서 구현된 users.py의 read_all_users는 화면에 구현이 안되는 것이 맞는 것인가요? Users의 POST /users 밑에 GET /users/all로 있어야 할 것 같은데... ===> PC를 재시작 후 다시 서버를 실행해 보니 나타납니다. DB Browser에서 특정 User의 is_admin을 true로 수정하고 저장까지 완료하고 난 후, 각각의 User들로 로그인해보았습니다. 그런데, is_admin이 false인 모든 User들도 read_all_users의 endpoint인 /users/all에서 모든 회원들의 리스트가 조회가 됩니다. /docs 페이지라서 그런 것인지 아니면 잘못 구현된 것인지 궁금합니다. 강의에서는 docs에서의 이런 상황에 대한 언급이 없어 질문을 드립니다.
30강을 완강후에 Postman을 통해 post로 http://127.0.0.1:8000/token 으로 요청을 보냈는데 아래 처럼 응답으로 토큰이 날아오지 않습니다. 422 Unprocessable Content 에러가 나오구요~~ oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token") # http://<your_domain>/token 뭐가 문제일런지요? postman사용법에 맞게 된것 같지가 않은데요..... @@@ 추가 질문 그리고, 더불어서 발급받은 토큰을 /docs에서 Authentication의 어디에 입력을 해서 테스트를 해야 하는지도 같이 안내바랍니다. 여기 client secret에 입력해서 테스트 하는것 같은데.... username, password를 입력해서 로그인하면 token은 잘 생성됩니다. 그리고 이렇게 username과 password로 로그인할 때 생성된 토큰으로 client secret에 입력해서 로그인하면 auth error Error: Unprocessable Content 라는 메시지가 뜹니다. postman사용법이 미숙해서인지 postman에서 post /token으로 날려도 토큰이 반환되어 오질 않습니다. 당연히 docs에서 username, password로 로그인한 후에... 수정, 삭제 권한적용은 잘 적용됩니다.
안녕하세요, 질문 있습니다! 마지막 부분에서 초기 비밀번호 외에 새로 생성한 비밀번호로는 새로 생성할 수 없다고 하셨는데, 호스트 컴퓨터의 폴더를 삭제하고 다시 생성하는 경우 이전에 생성했던 데이터베이스도 모두 삭제되는 게 맞을까요? : 호스트 컴퓨터의 폴더를 삭제하면 데이터도 삭제로 이해면 될지 답변부탁드립니다. (유익한 강의 즐겁게 수강중입니당.. 감사합니다.)
26강에서 User model를 만들고, Task model의 관계 설정까지 하고 env.py에서 User를 임포트하고 난후 alembic revision --autogenerate를 실행하고, alembic upgrade head 를 실행하면 User 테이블과 Task 모델의 관계설정은 잘 만들어 졌지만, 아래에 보이는 것처럼, 제약조건에 name을 지정하라고 나옴니다. 그래서 name을 지정하고 db를 삭제하고, alembic을 초기화된 상태로 만든 후에 다시 똑같은 과정을 거쳐 실행햇는데, 두번째 alembic revision --autogenerate 을 실행하면, sqlalchemy.exc.NoReferencedColumnError: Could not initialize target column for ForeignKey ' users.id ' on table 'tasks': table 'users' has no column named 'id' 이런 오류가 나타납니다. 자꾸 자꾸 계속해서 다시 해봐도 제약조건에 이름을 넣으라고 나오고, 그것을 수정하면 users에 id가 없다는 둥 계속 똑같이 오류가 나옵니다. 해결 방법은 무엇일까요? 완전히 새로 해봐도 똑같은 오류만 계속 반복됩니다.
가상 머신으로 서버 몇개 돌리면 컴퓨터가 정신을 못 차립니다. ㅠㅠ [ 👍 좋은 질문을 했을 때 좋은 답변이 돌아 옵니다] 1. 실습 중 본인의 환경이 가이드와 다른 부분이 있었다면 말씀해주세요. 2. 해당 문제의 발생 빈도(재설치 여부)와 문제 해결을 위해 시도해본 케이스를 말씀해 주시면 원인 파악에 큰 도움이 됩니다. 3. 에러 메시지만 봐서는 저도 모르는 경우가 많아요. 그전에 했던 작업이 포함된 캡쳐 화면도 부탁 드려요. 4. 영상 내용에 대한 질문 시 해당 시간을 같이 올려 주시면 답변을 드리는 시간이 더 빨라집니다. 5. 긴 로그는 제 메일로 보내주세요. ( k8s.1pro@gmail.com ) 6. 카페 [ 강의 자료실 ]에도 많은 질문과 답변들이 있어요!
💡 질문하기 전에 먼저 확인해보세요! UnicodeDecodeError: 'cp949' codec can't decode byte 0xed in position 3465: illegal multibyte sequence 유니코드 관련에러가 발생합니다. utf-8 관련 설정에 문제가 있어보이는데, 해결방법을 구합니다. 별것을 다해본것 같은데 해결이 되질 않습니다. 코드는 알려주신데로 아래와 같이 수정했습니다. # /alembic.ini 파일 sqlalchemy.url = sqlite+aiosqlite:///./sql_app.db # /alembic/env.py 파일 import asyncio # 추가 from logging.config import fileConfig import os # 경로 작업 위해 추가 import sys # 경로 작업 위해 추가 from sqlalchemy import engine_from_config from sqlalchemy import pool # ✨ 추가: 비동기 엔진 설정을 위해 async_engine_from_config 사용 ✨ from sqlalchemy.ext.asyncio import async_engine_from_config from alembic import context # --- ✨ 추가: 프로젝트 루트 경로 추가 (env.py가 app 모듈을 찾도록) ✨ --- # env.py 파일의 부모 디렉토리의 부모 디렉토리 (즉, 프로젝트 루트)를 sys.path에 추가 sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), ".."))) # -------------------------------------------------------------- # --- ✨ 추가: Base 및 모델 임포트 ✨ --- from app.database import Base # database.py의 Base 임포트 import app.sql_models.task # task 모델 모듈 임포트 (Base.metadata가 인식하도록) # 만약 다른 모델 파일들이 있다면 모두 임포트해주는 것이 안전합니다. # ----------------------------------------------------------------------------- # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config # Interpret the config file for Python logging. # This line sets up loggers basically. if config.config_file_name is not None: fileConfig(config.config_file_name) # add your model's MetaData object here # for 'autogenerate' support # from myapp import mymodel # target_metadata = mymodel.Base.metadata # target_metadata = None # --- ✨변경: target_metadata 설정 ✨ --- target_metadata = Base.metadata # 우리의 모델 메타데이터 지정! # -------------------------------- # other values from the config, defined by the needs of env.py, # can be acquired: # my_important_option = config.get_main_option("my_important_option") # ... etc. # ✨ 추가 ✨----------------------------------------------------------------- def do_run_migrations(connection): # context 설정 및 마이그레이션 실행 (run_sync 내부에서 호출될 함수) context.configure(connection=connection, target_metadata=target_metadata) with context.begin_transaction(): context.run_migrations() # --------------------------------------------------------------------------- # ... (run_migrations_offline 함수는 보통 그대로 둠) ... def run_migrations_offline() -> None: """Run migrations in 'offline' mode. This configures the context with just a URL and not an Engine, though an Engine is acceptable here as well. By skipping the Engine creation we don't even need a DBAPI to be available. Calls to context.execute() here emit the given string to the script output. """ url = config.get_main_option("sqlalchemy.url") context.configure( url=url, target_metadata=target_metadata, literal_binds=True, dialect_opts={"paramstyle": "named"}, ) with context.begin_transaction(): context.run_migrations() # --- ✨ 변경: run_migrations_online 함수 비동기 방식으로 수정 ✨ --- async def run_migrations_online() -> None: """Run migrations in 'online' mode for an async application.""" # config 섹션에서 비동기 엔진 생성 connectable = async_engine_from_config( config.get_section(config.config_ini_section), prefix="sqlalchemy.", poolclass=pool.NullPool, future=True, # SQLAlchemy 2.0 스타일 사용 ) # 비동기적으로 DB 연결 async with connectable.connect() as connection: # 동기적인 마이그레이션 함수(do_run_migrations)를 # 비동기 연결의 run_sync 메서드 내에서 실행 await connection.run_sync(do_run_migrations) # 엔진 연결 종료 await connectable.dispose() # ----------------------------------------------------------------- ''' # ✨ 위의 것으로 수정 def run_migrations_online() -> None: """Run migrations in 'online' mode. In this scenario we need to create an Engine and associate a connection with the context. """ connectable = engine_from_config( config.get_section(config.config_ini_section, {}), prefix="sqlalchemy.", poolclass=pool.NullPool, ) with connectable.connect() as connection: context.configure( connection=connection, target_metadata=target_metadata ) with context.begin_transaction(): context.run_migrations() ''' if context.is_offline_mode(): run_migrations_offline() else: # ✨ run_migrations_online() # 아래로 변경 # 온라인 모드일 경우 비동기 함수 실행 asyncio.run(run_migrations_online())
안녕하세요. helloworld.py에 대해 print('hello world') 작성 후 저장, 디버깅을 했음에도 python helloworld.py 를 입력하면 'hello world'가 아닌 'Python'이 도출됩니다. py helloworld.py 를 입력하면 'hello world'가 제대로 나옵니다. 무엇이 잘못되었고 어떻게 수정할 수 있을까요?
안녕하세요, 강의 수강 중 질문이 생겨 여쭤봅니다. mysql, mongoDb를 사용하실때는 docker exec -it로 직접 컨테이너에 들어와 실행하시는 과정을 보여주셨는데, postgreSQL 예시에서는 따로 docker exec -it 과정이 강의 내용 중 보이지 않는 것 같아 여쭤봅니다. 실행 방법이 docker exec -it 로 컨테이너에 들어오지 않고 데이터그립을 바로 실행하신 것 같은데, 이렇게 되면 로컬에서 데이터그립의 postgreSQL을 실행시키고 컨테이너 안에서는 postgreSQL을 실행시키지 않은게 아닌가요 .. ? 혹시 제가 놓친 부분이 있다면 죄송합니다 !
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 강의 내용을 질문할 경우 몇분 몇초의 내용에 대한 것인지 반드시 기재 부탁드립니다. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 혹시 강의에서 사용하시는 ppt 받을 수 있는건가요