백엔드/서버

Python 서버 따라 만들기 [3] local에서 Django 서버 띄우기

leejiwoo21 2024. 4. 21. 21:19

원격 서버돌리기까지의 진행계획을 말씀드리면

1. Django를 Git에 올리기

2. ubuntu에서 Django 서버 다운받기

3. ubuntu에서 서버 실행

이고,

 

이번 포스트에선 1. Django를 Git에 올리기 를 다룹니다.

 

Pycharm 최신 버전 설치

Django를 사용할 Pycharm을 설치해줍니다.

 

PyCharm 다운로드: 데이터 과학 및 웹 개발을 위해 JetBrains가 만든 Python IDE

 

www.jetbrains.com

무료 버전으로 시작

 

 

 

New Project > Django > 프로젝트 이름 설정 > (Python이 안깔려있다면 설치하기+환경 변수 설정) > Create

 

 

프로젝트가 생성됐다면 실행해봅니다.

 

만약 이런 오류가 발생한다면 

Fatal Python error: init_stdio_encoding: failed to get the Python codec name of the stdio encoding
Python runtime state: core initialized
LookupError: unknown encoding: x-windows-949

Current thread 0x00004618 (most recent call first):
  <no Python frame>

 

https://velog.io/@awo3sr/TIL-17-%ED%8C%8C%EC%9D%B4%EC%B0%B8-x-windows-949-%EC%98%A4%EB%A5%98

이 블로그를 참고하세요

 

[TIL-17] 파이참 x-windows-949 오류

Fatal Python error: initstdioencoding: failed to get the Python codec name of the stdio encoding Python runtime state: core initialized LookupError:

velog.io

 

클릭 > Django 페이지가 나타나면 local에서 Django 서버 띄우기 성공!

 

이제 깃허브에 Django 프로젝트를 올려봅시다.

 

새 repo엔 특별히 추가할 것 없이 이름만 짓고 만들어줍니다.

 

파이참 터미널에서 이 순서를 따라 깃헙에 올립니다.

터미널 열고

 

순서대로 입력하면 github에 프로젝트가 올라갑니다.

git에 올라감

 

 

 

git 사용을 도와줄 sourcetree를 설치합니다.

 

Sourcetree | Free Git GUI for Mac and Windows

A Git GUI that offers a visual representation of your repositories. Sourcetree is a free Git client for Windows and Mac.

www.sourcetreeapp.com

 

 

 

Django 프로젝트 경로를 찾아서 sourcetree에 추가합니다

 

 

 

gitignore 추가

메모장으로 열어서 오른쪽 리스트를 추가합니다.

 

 

 

 

sourcetree로 돌아와서 커밋!

 

여기까지가 Django를 Git에 올리기 였습니다.

 

 

 

반응형