코딩헤딩

Django 본문

카테고리 없음

Django

멈머이 2024. 2. 5. 23:39
728x90

프레임워크 환경설정이 가장 중요.

 

구조를 알아야 한다.

설치

서버 환경구축.

 

* 가상환경 생성

가상환경 생성
conda create -n 가상환경 이름 python=3.9

 - jupyter 설치하기
  -> pip install jupyter notebook

커널 생성하기 (base root 가상화경에서 진행한다. [conda deactivate])
python -m ipykernel install --user --name 가상환경 이름 --display-name 가상환경 이름_kernel

기본 패키지(라이브러리) 설치하기(gj_env_01 가상환경에서 실행)
     1. conda activate gj_env_01
     2. pip install ipython jupyter matplotlib pandas xlrd seaborn scikit-learn
     3. pip install openpyxl

 

튜토리얼 폴더 이동 
[django-admin startproject config .] 입력

 


* 서버 실행
python manage.py runserver 
빨간 글씨 무시(데이터베이스 관련)

 

ip주소에 커서 올리면 밑줄 생긴다. crtl+클릭

 

 

#  손댈것 2개 settings 랑 urls ****
ALLOWED_HOSTS = ["127.0.0.1"]
        'DIRS': [BASE_DIR/"templates"],
# LANGUAGE_CODE = 'en-us'
LANGUAGE_CODE = 'ko-kr'

# TIME_ZONE = 'UTC'
TIME_ZONE = 'Asia/Seoul'
STATICFILES_DIRS = [BASE_DIR/"static"]
# 정적파일 관리 폴더

 

 

가상환경 들어가서

python manage.py startapp firstapp

 

firstapp > views.py

from django.http import HttpResponse


# Create your views here.
def index(request) :
    return HttpResponse("<u>firstapp의 index 페이지 !!</u>")

 

 

728x90