python을 이용하여 Web Site를 제작하려면 django를 설치해야 함
Mac에 설치는 어렵지 않았는데, Windows가 좀 더 어려운 느낌이다.
아래 내용은 윈도우에서 정상적으로 django가 설치되도록 작성된 메뉴얼임
삽질한 내용은 기록 안함.
Python 버전 : 3.11.2 (버전 확인 명령어 : py --version)
Django 버전 : 4.1.7 (버전 확인 명령어 : pip list --> 설치된 페키지 목록 보기 명령어)
1. 가장 먼저 Python 설치
https://www.python.org/downloads/ 여기에 접속해서 latest version 설치 (버전은 개인적인 선택)
2. django의 설치방법
2.1 Windows PowerShell 창을 띄우고
2.2 django의 설치 경로 변경 ( D:/python/was )
2.3 pip install django 명령어 실행
만약 SSL 인증 문제로 설치 안되면 다음 2.4 방법으로 설치
2.4 pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org django
3. django 사이트 만들기 (사이트명 : mysite)
3.1 django-admin startproject mysite (django-admin.py startproject mysite) 명령어 실행
3.2 3.1 명령어 안되면 python -m django startproject mysite 명령어 실행 ( windows에서는 이렇게..)
4. 생성된 프로젝트 확인
4.1 mysite 폴더로 이동
4.2 manage.py 파일이 생성되어 있는지 확인 (이외 db.sqlite3, mysite sub folder 생성 확인)
4.2 python manage.py runserver 명령서 실행
4.3 브라우져에서 http://localhost:8000 확인
5. 관리자 계정 생성 ( http://localhost:8000/admin 에 접속할 수 있는 계정)
5.1 python manage.py createsuperuser
5.2 아이디, 이메일, 비밀번호 순서로 입력
6. 셍성된 관리자 계정 확인 방법
6.1 python manage.py shell
6.2 from django.contrib.auth.medels import User
6.3 superusers = User.objects.filter(is_superuser=True)
6.4 superusers
[python Study]
http://bigdata.dongguk.ac.kr/
https://wikidocs.net/2829
[python Web Site 생성]
https://scshim.tistory.com/562
[Anaconda]
Python의 다양한 모듈이 내장되어 있음.
https://www.anaconda.com/products/distribution
[django 설치시 오류 - SSL인증서 문제]
https://harryp.tistory.com/831
[python버전확인] py --version
[python 콘솔 빠져나오기] ctrl+z
Mac에 설치는 어렵지 않았는데, Windows가 좀 더 어려운 느낌이다.
아래 내용은 윈도우에서 정상적으로 django가 설치되도록 작성된 메뉴얼임
삽질한 내용은 기록 안함.
Python 버전 : 3.11.2 (버전 확인 명령어 : py --version)
Django 버전 : 4.1.7 (버전 확인 명령어 : pip list --> 설치된 페키지 목록 보기 명령어)
1. 가장 먼저 Python 설치
https://www.python.org/downloads/ 여기에 접속해서 latest version 설치 (버전은 개인적인 선택)
2. django의 설치방법
2.1 Windows PowerShell 창을 띄우고
2.2 django의 설치 경로 변경 ( D:/python/was )
2.3 pip install django 명령어 실행
만약 SSL 인증 문제로 설치 안되면 다음 2.4 방법으로 설치
2.4 pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org django
3. django 사이트 만들기 (사이트명 : mysite)
3.1 django-admin startproject mysite (django-admin.py startproject mysite) 명령어 실행
3.2 3.1 명령어 안되면 python -m django startproject mysite 명령어 실행 ( windows에서는 이렇게..)
4. 생성된 프로젝트 확인
4.1 mysite 폴더로 이동
4.2 manage.py 파일이 생성되어 있는지 확인 (이외 db.sqlite3, mysite sub folder 생성 확인)
4.2 python manage.py runserver 명령서 실행
4.3 브라우져에서 http://localhost:8000 확인
5. 관리자 계정 생성 ( http://localhost:8000/admin 에 접속할 수 있는 계정)
5.1 python manage.py createsuperuser
5.2 아이디, 이메일, 비밀번호 순서로 입력
6. 셍성된 관리자 계정 확인 방법
6.1 python manage.py shell
6.2 from django.contrib.auth.medels import User
6.3 superusers = User.objects.filter(is_superuser=True)
6.4 superusers
[python Study]
http://bigdata.dongguk.ac.kr/
https://wikidocs.net/2829
[python Web Site 생성]
https://scshim.tistory.com/562
[Anaconda]
Python의 다양한 모듈이 내장되어 있음.
https://www.anaconda.com/products/distribution
[django 설치시 오류 - SSL인증서 문제]
https://harryp.tistory.com/831
[python버전확인] py --version
[python 콘솔 빠져나오기] ctrl+z