본문 바로가기

django

(5)
[django] csv export 보호되어 있는 글입니다.
[django] 크롤링 데이터 장고db(sqlite db)에 저장하기 #sqlite3 db.sqlite3sqlite>.databasesqlite>.tablesqlite>.schema (테이블명)sqlite>insert into 테이블명 values('var1','var2' .... );sqlite>select * from 테이블명 (조건);sqlite>delete from 테이블명 (조건);sqlite>drop table 테이블명 (조건);여러 컬럼을 대상으로 중복 데이터를 제외여러 컬럼을 대상으로 중복 데이터를 제외하려면 여러 컬럼 값의 조합이 일치하는 데이터를 제외다. 예를 들어 앞에서 사용한 product 테이블에서 name 컬럼과 color 컬럼의 데이터를 조회할 때 중복 데이터를 제외하고 조회하는 경우는 다음과 같이 작성한다.select distinct name,..
Boundfield.py widget typeerror Boundfield.py Ckeditror 적용시 에러 Bounfield.py 92 line 주석처리 - 해결 no widgetf.py mark down ~ render 주석처리 -
django restframework 사용하기 from django.shortcuts import render from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status from elasticsearch import Elasticsearch from elasticsearch_dsl.connections import connections class SearchView(APIView): def get(self, request): es = Elasticsearch(['http://192.168.0.1:9200'], http_auth=('elastic','password'), timeout=300) #e..
django wagtail - 1. python가상환경 설정 및 wagtail 설치 os = centos 7python ver = 3.8wagtail = sqlite = 3.8.3 1. python3 설치 및 가상환경 설정가상환경 ex yum repo 는 python2 를 사용함 이와같이 버전 충돌을 막기 위해서 가상환경을 사용함# yum install python3# pip install virtualenv# virtualenv [가상환경명]# source [가상환경명]/bin/activate 2. wagtail 설치$ pip install wagtail$ wagtail start mysite$ cd mysite$ pip install -r requirements.txt$ ./manage.py migrate$ ./manage.py createsuperuser$ ./manage.py r..