본문 바로가기

DevSpace/Python | Django17

[python] 1.파이썬 설치하기 파이썬을 최대한 쉽게 접하게 쉽게 글을 쓰려고 노력해보겠습니다. ​ 1.파이썬 설치하기 여러버전이 존재하는데 저는 3.10을 설치했습니다. 지원기간은 2026-10 이고 지원기간 종료이후에도 사용은 가능합니다. https://www.python.org/downloads/ Download Python The official home of the Python Programming Language www.python.org 다운받아 설치 하고 "Add Python 3.10 to PATH" 체크박스 선택 후 설치를 진행하면 됩니다. 환경변수를 지정합니다. 내PC > 속성 혹은 윈도우키를 눌러 변수라고 입력하시면 "시스템 환경 변수 편집" 클릭하시면 됩니다. ​ 고급탭 > 환경변수 클릭 ​ 사용자에 대한 사용자 .. 2022. 2. 16.
[django] django-debug-toolbar + django-extensions 설치 및 에러 처리 세팅정보 -python 버전 3.8 -Django 버전 3.2 -django 가상환경 django-debug-toolbar를 설치하기 위해 doc 문서 대로 설치하였는데... https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#process Installation — Django Debug Toolbar 3.2.4 documentation Troubleshooting On some platforms, the Django runserver command may use incorrect content types for static assets. To guess content types, Django relies on the mime.. 2022. 1. 25.
gunicorn + nginx 명령어 sudo systemctl daemon-reload #데몬 리로드 sudo systemctl start gunicorn # 작성한 서비스 실행 sudo systemctl enable gunicorn # 서버 재시작시 자동으로 실행 sudo systemctl status gunicorn.service # 실행한 서비스 상태 보기 sudo systemctl stop gunicorn # 서비스 중지 sudo systemctl restart gunicorn # 서비스 재시작 실행확인 sudo systemctl status gunicorn.service ( 작성한 파일명마다 다름) ========================================== [Unit] Description=gunicorn dae.. 2022. 1. 11.
[django]web 실행시켜보기 1.가상환경 실행 후 (venv) django-admin startproject projectname 2.단순 실행시켜보기 - cd projectname - python3 manage.py runserver 0.0.0.0:8000 - 저는 vm으로 IP를 할당받아 실행시켰기에 runserver 뒤에 0.0.0.0 과 포트번호(8000)를 지정하였습니다. - vm ubuntu IP로 접속하면 아래 접근 문제 발생. 3.DisallowedHost at / 접근문제 처리하기 - 프로젝트 폴더명으로 이동하여 settings.py 확인 후 편집기로 수정 - vim settings.py (편집기는 본인이 편한것으로) - ALLOWED_HOSTS= [] > ALLOWED_HOSTS = '*' 로 변경 4. 서비스 재.. 2022. 1. 6.