본문 바로가기

728x90

분류 전체보기

(132)
[Django] docker 사용해서 django 앱 배포하기 0. docker 설치 docker을 실행시켜줘야 docker 명령어 사용 가능 1. Dockerfile 생성 pip list 명령어를 통해 설치된 라이브러리 버전 확인 pip list requirements.txt에 필요한 라이브러리 및 버전 작성 (이후, pip install -r requirements.txt를 통해 해당 라이브러리들이 자동적으로 설치되게 함) django==3.2.7 pymysql==1.0.2 pandas==1.2.1 FROM python:3.9.1 WORKDIR /web COPY . . RUN pip install --upgrade pip RUN pip install -r requirements.txt EXPOSE 8000 CMD ["python", "manage.py", "ru..
[Django] Cache 사용방법 Django에서 cache를 사용하는 방법에는 Memcached와 Redis가 있다. Redis 방식 Redis 설정하기 1) django-redis를 설치한 후, pip install django-redis 2) settings.py에 CACHE 부분을 추가해주면 된다. CACHES = { 'default': { 'BACKEND': 'django_redis.cache.RedisCache', 'LOCATION': 'redis://{URL}:6379', }, } from django.core.cache import cache def get_post_count(): cache_key = 'my_blog_post_count' count = cache.get(cache_key, None) if not count..
[Django] Forbidden (CSRF token missing or incorrect.): 에러 해결방법 django의 CSRF(Cross Site Request Forgery 사이트 간 요청 위조) 보안 정책으로 인해 일어난 에러 CSRF 보안을 사용하지 않겠다면, views.py에 아래와 같이 csrf_exempt를 import한 뒤 decorator를 함수 선언 위에 달아주면 된다 from django.views.decorators.csrf import csrf_exempt @csrf_exempt def function_name(request): return HttpResponse("success")
[딥러닝 환경설정] 0. 첫 ssh접속, 우분투 LTS 업그레이드 $ ssh 192.100.x.x The authenticity of host '192.100.x.x' can't be established. RSA key fingerprint is 3f:f1:a4:bd:e3:54:63:xx:xx:xx:xx:xx:xx:xx:xx:xx. Are you sure you want to continue connecting (yes/no)? 특정 호스트에 최초로 SSH 접속 시에 아래와 같이 RSA key fingerprint로 접속여부(yes/no)를 확인하는 차원에서 물어본다. yes를 입력 후, 해당 계정의 패스워드를 입력해 호스트에 접속할 수 있다. 아래와 같은 메세지가 뜨며 우분투 서버에 접속했음을 알려준다 만약, 우분투 시스템 재시작이 필요하다는 메세지가 뜬다면, su..
[Jquery] select 박스 제어하기 (옵션 추가/제거) $.each(data, function(index, item){ $('.select').append(''+item+''); }); 다만, 위와 같이 하면 option의 value는 index, text는 item이 된다. 따라서, 만약 value값 역시 item값으로 바꾸고 싶다면, 아래와 같이 사용하면 된다. $.each(data, function(index, item){ $('.select').append(''+item+''); }); 모든 option 제거하기 $('#select_box').children().remove();
[Django] Django 튜토리얼 (새 프로젝트 시작하기) Django의 프로세스 (참고: https://guiyum.tistory.com/82) urls.py 파일 내 사용자의 요청(request)에 맞는 url을 찾음 해당 url에 연결된 views.py 파일 내 함수를 찾아 기능을 수행 만약 함수 로직 내 데이터베이스 관련 처리가 필요하면 model을 통해 처리하고 그 결과를 반환 마지막으로 view는 최종 결과로 templates(HTML 파일)을 클라이언트에 띄워줌 HTTP 요청방식 HTTP 요청 방식에는 GET / POST / PUT / DELETE 가 있으며, 보통은 GET / POST를 사용 GET 주소가 노출되어도 괜찮고, 다른 사용자에게 공유가 가능한 정보를 처리할 때 사용 POST 회원가입이나 결제와 같은 다른 사용자와 결제해서는 안되는 정보..
웹 프레임워크 비교 Vue.js React.js Bootstrap React는 페이스북에서 자사 프론트엔드의 수많은 DOM 업데이트들을 묶어서 관리함으로써 성능과 효율성 측면에서의 개선을 얻기 위해 개발한 라이브러리이고, 따라서 DOM 조작이 잦은 웹앱에 사용되는 것이 주 목적Boostrap 기반으로 만들어진 템플릿이 많음 jQuery, Wordpress, Bootstrap 등은 전통적인 정적 웹사이트 용, React, Vue는 웹어플리케이션 용 React나 Vue가 DOM 조작이 잦은 웹앱들을 위한 것 일정이상의 복잡도를 가지는 애플리케이션은 react + redux든 vue든 뭐든 필요합니다. 생 html에 jquery, 부트스트랩은 state 관리가 안돼요 요구사항이 조금만 많아지면 코드 관리도 안되고, dom 관리도..
Dashboard Web prototype app 개발을 위한 파이썬 라이브러리 Plotyly의 Dash Streamlit 주요 차이점 Streamlit’s focus is towards rapid prototyping, whereas Dash focusses on production / enterprise settings. Dash is primarily designed to work with Plotly , whereas Streamlit is more agnostic to the underlying visualisation libraries such as Altair, Bokeh, Plotly, Seaborn, or Matplotlib. Reference https://towardsdatascience.com/plotly-dash-vs-streamlit-which-is-the-..

반응형