200여개의 csv 파일이 있습니다. (용량은 각각 1메가에서 120메가 - 최대 100만건 데이터 등등 ). 결측치 가 있어서 판다스 에서 불러들여서 정리하고 for 반복문으로 파일 개별적으로 읽어 들여와 장고 모델에 save() 로 입력시키는 작업을 진행하고 있습니다. 초반 10여개 파일까지는 제법 속도가 나오는데 (7만행 데이터 20분 소요) 이후로 속도가 급격하게 감소해서 24시간 돌려서 30메가 파일 겨우 저장 중입니다(1건에 1초씩 걸리네요 ㅠㅠ). 개발중이라 로컬에 있는 장고 내장 sqlite 사용 했습니다. 속도를 좀 더 빠르게 하는 방법이 있을까요? 3일째 검색 해봤는데 별다른 해결책이 보이지 않아서 질문 남겨 봅니다. app.py # new 폴더에 정리된 csv 파일을 읽어서 DB에 저장 import pandas as pd # django 프로젝트에 있는 settings.py 파일을 읽어서 환경변수로 설정 import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dbking.settings") import django django.setup() #django 프로젝트에 있는 models.py 파일에서 BasicData 클래스를 읽어온다 from common.models import BasicData # new 폴더에 있는 파일명을 읽어서 product 변수에 리스트에 저장 product_list = os.listdir("./script/newdb") # product_list 에 csv 파일 정렬(오름차순) for x in product_list: # csv 파일 하나씩 읽어오기 df = pd.read_csv("./script/newdb/" + x, encoding="cp949") # 결측치를 0으로 채운다 df = df.fillna(0) for a in list_of_csv: # 파일마다 컬럼수가 달라서 remark1, remark2 라는 예비컬럼 2개 추가 # -> 인덱스 에러 나는 경우 0 으로 저장 if a[16] is None: a.insert(16, 0) a.insert(17, 0) elif a[17] is None: a.insert(17, 0) # DB에 저장 try: db_insert = BasicData( opnSvcId = a[2], opnSfTeamCode = a[3], mgtNo = a[4], fileNumber = fileNumber, businessType = businessType, opnSvcNm = a[1], apvPermYmd = a[5], confirmNumber = a[6], businessCondition = a[7], siteTel = a[8], sitePostNo = a[9], siteWhlAddr = a[10], rdnWhlAddr = a[11], rdnPostNo = a[12], bplcNm = a[13], latitude = a[14], longitude = a[15], remark1 = a[16], remark2 = a[17], ) i += 1 # print(i) except Exception as e: print("쿼리", e) continue #DB에 저장 입력 try: db_insert.save() except Exception as e: print("저장중에러",e) continue from django.db import models class BasicData(models.Model): # 개방서비스아이디 opnSvcId = models.CharField(max_length=100) #개방자치단체코드 opnSfTeamCode = models.CharField(max_length=10) # 관리번호 mgtNo = models.CharField(max_length=100) #파일번호 fileNumber = models.IntegerField() #업종명 businessType = models.CharField(max_length=100) #개방서비스명 opnSvcNm = models.CharField(max_length=100) #인허가일자 apvPermYmd = models.DateField() #영업상태구분코드(1-정상, 2-폐업, 3-휴업, 4-전환) confirmNumber = models.IntegerField() #영업상태명 businessCondition = models.CharField(max_length=100) #소재지전화 siteTel = models.CharField(max_length=100) #우편번호 sitePostNo = models.CharField(max_length=100) #주소 siteWhlAddr = models.CharField(max_length=100) #도로명주소 rdnWhlAddr = models.CharField(max_length=100) #도로명우편번호 rdnPostNo = models.CharField(max_length=100) #사업장명 bplcNm = models.CharField(max_length=100) # 위도 latitude = models.FloatField() # 경도 longitude = models.FloatField() #비고1 remark1 = models.CharField(max_length=100) #비고2 remark2 = models.CharField(max_length=100) # 생성시점 created = models.DateTimeField(auto_now_add=True) update = models.DateTimeField(auto_now=True) def save(self, *args, **kwargs): queryset = BasicData.objects.filter(mgtNo__exact=self.mgtNo) # 중복된 이름이 없을 때만 저장 if len(queryset) == 0: super().save(*args, **kwargs) print('> Created new category') # if '&' in self.addr: # self.addr = self.addr.replace('&', ' ') # self.save() # 중복된 카테고리 있을 시 저장 안함 else: print('> Cannot create category with existing name') def __str__(self): return self.name
안녕하세요. 어제부터 DeepingSauce님 로드맵을 갓 시작한 코린이 입니다. 금일 강의를 전부 결재하고 시작점에 섰는데 확인해보니 공부 환경상 Jupyter lab 활용이 불가능 하여 두가지 질문 드립니다. Colab 활용 가능성 수강 환경상 Jupyter Notebook은 쓸 수 있지만 Jupyter Lab의 사용이 불가능합니다. 그래서 Colab을 사용해볼까 하는데, 수업 진행에 무리가 없을런지 질문 드립니다. (수업내용을 보니 Jupyter에 Extention까지 설치해서 사용하던데 Colab이 해당 기능들을 다 지원할지 모르겠습니다.) Colab 설치 및 세팅방법 Colab이 활용 가능하다면 선생님 수업을 위해 (Jupyter Lab에서 했듯이) Colab의 설치 및 세팅방법도 알고 싶습니다. 혹시 가능하다면 안내 부탁 드립니다. 아는 지식이 짧아 있는 그대로 질문 드립니다.
a = {'Phone': '01095136634', 'birth': '910904', 'adress': 'Busan', 'rank': [1, 2, 3], 'test': 'test_dict'} a라는 딕셔너리에서 910904라는 value값을 통해 key 값을 찾아서 출력 하고 싶습니다. 제가 생각 해낸 방법은 딕셔너리에는 순서가 없음으로 리스트로 형 변환을 하여 해당하는 인덱스를 불러오는 방법을 사용했습니다. print(list(a.keys())[list(a.values()).index('910904')]) 이거보다 더 효율적이고 간결한 방법이 있을 가요?
unittest 기반의 Unit Test시 Celery 혹은 ProcessPoolExecutor을 이용하면 해당 Context에서 DB 접근 시, Test DB를 참조 하는 것이 아니라 settings의 Default로 설정해놓은 Exist DB에 접근하는 이슈가 있더군요. 해당하는 경우 어떻게 해야 Test DB로 붙어서 작업할 수 있을까요? with concurrent.futures.ProcessPoolExecutor() as executor:
안녕하세요. 위 파일은 product.entity.ts 파일입니다. product.entity.ts 파일에서 @JoinColumn() 을 productSaleslocation 테이블에만 해주시는 이유가 무엇인지 알 수 있을까요? product테이블과 서로 관계를 맺고 있는 productSaleslocation 테이블과 users 테이블에도 @JoinColumn()을 해줘야 하는 것 아닌가요? 상품테이블은 productCategory테이블과(상품카테고리_id)ManyToOne 관계를 맺고 있으며, User 테이블과 (유저_id) ManyToOne 관계를 맺고 있어서 각각 JoinColumn을 해줘야 하는 것으로 생각했는데, 제 생각이 틀린 것일까요? 좋은 강의 해주셔서 진심으로 감사합니다!
안녕하세요. 좋은 강의 감사합니다. entity 구현 1:1 강의에서 npm i 후 package: '@angular-devkit/core@15.1.4', Unsupported engine 이라고 나오는데, 이렇게 터미널에 찍히는 이유가 무엇인가요? 계속 사용할 경우 어떤 문제가 발생하나요? npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '@angular-devkit/core@15.1.4', npm WARN EBADENGINE required: { npm WARN EBADENGINE node: '^14.20.0 || ^16.13.0 || >=18.10.0', npm WARN EBADENGINE npm: '^6.11.0 || ^7.5.6 || >=8.0.0', npm WARN EBADENGINE yarn: '>= 1.13.0' npm WARN EBADENGINE }, npm WARN EBADENGINE current: { node: 'v16.12.0', npm: '8.1.0' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '@angular-devkit/schematics@15.1.4', npm WARN EBADENGINE required: { npm WARN EBADENGINE node: '^14.20.0 || ^16.13.0 || >=18.10.0', npm WARN EBADENGINE npm: '^6.11.0 || ^7.5.6 || >=8.0.0', npm WARN EBADENGINE yarn: '>= 1.13.0' npm WARN EBADENGINE }, npm WARN EBADENGINE current: { node: 'v16.12.0', npm: '8.1.0' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '@angular-devkit/schematics-cli@15.1.4', npm WARN EBADENGINE required: { npm WARN EBADENGINE node: '^14.20.0 || ^16.13.0 || >=18.10.0', npm WARN EBADENGINE npm: '^6.11.0 || ^7.5.6 || >=8.0.0', npm WARN EBADENGINE yarn: '>= 1.13.0' npm WARN EBADENGINE }, npm WARN EBADENGINE current: { node: 'v16.12.0', npm: '8.1.0' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '@angular-devkit/core@15.0.4', npm WARN EBADENGINE required: { npm WARN EBADENGINE node: '^14.20.0 || ^16.13.0 || >=18.10.0', npm WARN EBADENGINE npm: '^6.11.0 || ^7.5.6 || >=8.0.0', npm WARN EBADENGINE yarn: '>= 1.13.0' npm WARN EBADENGINE }, npm WARN EBADENGINE current: { node: 'v16.12.0', npm: '8.1.0' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '@angular-devkit/schematics@15.0.4', npm WARN EBADENGINE required: { npm WARN EBADENGINE node: '^14.20.0 || ^16.13.0 || >=18.10.0', npm WARN EBADENGINE npm: '^6.11.0 || ^7.5.6 || >=8.0.0', npm WARN EBADENGINE yarn: '>= 1.13.0' npm WARN EBADENGINE }, npm WARN EBADENGINE current: { node: 'v16.12.0', npm: '8.1.0' } npm WARN EBADENGINE } npm WARN deprecated apollo-datasource@3.3.2: The `apollo-datasource` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. npm WARN deprecated apollo-server-errors@3.3.1: The `apollo-server-errors` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. npm WARN deprecated apollo-server-plugin-base@3.7.1: The `apollo-server-plugin-base` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. npm WARN deprecated apollo-server-types@3.7.1: The `apollo-server-types` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead npm WARN deprecated apollo-server-express@3.11.1: The `apollo-server-express` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. npm WARN deprecated apollo-reporting-protobuf@3.3.3: The `apollo-reporting-protobuf` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/usage-reporting-protobuf` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. npm WARN deprecated apollo-server-env@4.2.1: The `apollo-server-env` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/utils.fetcher` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. npm WARN deprecated subscriptions-transport-ws@0.11.0: The `subscriptions-transport-ws` package is no longer maintained. We recommend you use `graphql-ws` instead. For help migrating Apollo software to `graphql-ws`, see https://www.apollographql.com/docs/apollo-server/data/subscriptions/#switching-from-subscriptions-transport-ws For general help using `graphql-ws`, see https://github.com/enisdenjo/graphql-ws/blob/master/README.md npm WARN deprecated apollo-server-core@3.11.1: The `apollo-server-core` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details. added 806 packages, and audited 807 packages in 21s 98 packages are looking for funding run `npm fund` for details found 0 vulnerabilities
아래 질문과 동일한 에러가 발생해서 알려주신 해결책으로 진행했는데...이번에는 다른 문제가 발생했습니다. Error: Access denied for user 'root'@' localhost ' (using password: YES) 구글링으로 아무리 찾아서 해보아도 해결이 안되고 있습니다. 아래 테이블 만들었구요 권한문제인가 싶어서 user 테이블의 root 의 authentication_string 을 바꿔도 해쉬값으로 저장되지도 않고...현재는 NULL로 해놓고 있는데 도무지 해결이 되지 않습니다. 도와주세요 ㅠㅠ
const savedProductSaleslocation = await this.productSaleslocationRepository.save({ ...productSaleslocation, }); 위 코드에서, 아래처럼 코드를 바꿔봤습니다. const savedProductSaleslocation = await this.productSaleslocationRepository.save(productSaleslocation); 정상 작동했는데 차이가 무엇인가요? 또 권장하는 방식은 무엇인가요?
제가 사용중인 우분투 버젼입니다. 몽고 디비 설치를 노션 자료에 있는대로도 설치를 해보고, 삭제하고 공식문서에 있는대로도 설치를 해봤는데 (노션에는 공개키가 server-5.0 으로 되어있고 공식 문서는 server-6.0 으로 되어있더라구요) 설치 후에 실행을 해보면 [fail] 이 뜨면서 실행이 되지 않네요. 구글링해서 여러가지 방법 따라해봐도 계속 fail 이어서 질문글 올립니다. 추가로 이상한 점은 mongod --version 이라고 치면 버전이 나오는게 아니라 Illegal instruction 라고 나옵니다. ++구글에 mongod --version Illegal instruction 라는 키워드로 검색을 해서 https://info-orgs.blogspot.com/2021/10/how-to-install-mongodb-v44-mongodb.html 이 글을 보고 몽고 디비 4.4 버전을 설치해봤는데 mongod --version 이라고 치면 이제 버전이 나오긴 하는데 여전히 실행은 실패하네요. $ service mongod start * Starting database mongod /etc/init.d/mongod: 136: ulimit: error setting limit (Operation not permitted) /etc/init.d/mongod: 142: ulimit: error setting limit (Operation not permitted) start-stop-daemon: start-stop-daemon: unable to open pidfile '/var/run/mongod.pid' for writingunable to set gid to 121 (Permission denied) (Operation not permitted) start-stop-daemon: child returned error exit status 2
수업 잘 듣고 있습니다. 자동화를 하고 싶으서 예전 영상 보다가 최근에 다시 올라와서 보는 중 강의 발견하고 바로 수강해서 듣고 있습니다. 궁금한 것이 하나 있는데요. 셀레니움에서 하나의 윈도우 창의 특정 태그 값을 찾아서 다른 윈도우 창을 오픈 한 후 특정 필드에 값을 넣을 수 있나요?
윈도우 환경에서 yarn 이 에러가 나서 npm으로 진행중입니다~ "npm yarn 은 성능만 차이가 나고 명령어는 똑같다" 라고 알고 있는데, 명령어도 다른건가 라는 의문이 들어 질문 드립니다. npm의 경우는 pakage.js 에 아래와 같이 작성 후 npm aaa 로는 실행이 안되고, npm run aaa 로 만 실행이 되는데, yarn aaa 는 실행이 잘 되는듯 하네요 왜 그런 걸까요? run 이 생략된 걸까요? 웹펙 쪽을 먼저 학습하고 가야 할지... 수업 들으면서 모르는걸 다 질문드려도 될까요? package.json script:{ "aaa":"nodemon app.js" }
안녕하세요 선생님 퍼샤드 패턴에서 58분쯤 보면 yarn init이라고 입력을 하시던데 저의 경우에는 에러가 뜹니다. ERROR: init is not COMMAND nor fully qualified CLASSNAME. Usage: yarn [OPTIONS] SUBCOMMAND [SUBCOMMAND OPTIONS] or yarn [OPTIONS] CLASSNAME [CLASSNAME OPTIONS] 왜 입력 값이 충족되지 않았다고 하는 걸까요? 참고로 제 node.js 버전은 18대입니다. 혹시몰라 전체적인 에러메세지 같이 첨부합니다! (base) ➜ 01-05-token-count-api-facade-import git:(master) ✗ yarn init ERROR: init is not COMMAND nor fully qualified CLASSNAME. Usage: yarn [OPTIONS] SUBCOMMAND [SUBCOMMAND OPTIONS] or yarn [OPTIONS] CLASSNAME [CLASSNAME OPTIONS] where CLASSNAME is a user-provided Java class OPTIONS is none or any of: --buildpaths attempt to add class files from build tree --config dir Hadoop config directory --daemon (start|status|stop) operate on a daemon --debug turn on shell script debug mode --help usage information --hostnames list[,of,host,names] hosts to use in worker mode --hosts filename list of hosts to use in worker mode --loglevel level set the log4j level for this command --workers turn on worker mode SUBCOMMAND is one of: Admin Commands: daemonlog get/set the log level for each daemon node prints node report(s) rmadmin admin tools scmadmin SharedCacheManager admin tools Client Commands: applicationattempt prints applicationattempt(s) report app|application prints application(s) report/kill application/manage long running application classpath prints the class path needed to get the hadoop jar and the required libraries cluster prints cluster information container prints container(s) report envvars display computed Hadoop environment variables fs2cs converts Fair Scheduler configuration to Capacity Scheduler (EXPERIMENTAL) jar <jar> run a jar file logs dump container logs nodeattributes node attributes cli client queue prints queue information schedulerconf Updates scheduler configuration timelinereader run the timeline reader server top view cluster information version print the version Daemon Commands: nodemanager run a nodemanager on each worker proxyserver run the web app proxy server registrydns run the registry DNS server resourcemanager run the ResourceManager router run the Router daemon sharedcachemanager run the SharedCacheManager daemon timelineserver run the timeline server SUBCOMMAND may print help when invoked w/o parameters or with -h. 구글링은 해봐도 못찾겠고, 그나마 힌트가 될만한건 이전에 hadoop 설치하면서 yarn이 같이 깔렸던 것 같은데, 그것과 충돌이 되서 그럴 수 있다는 정보까진 찾았습니다! brew uninstall hadoop 으로 하둡을 날려버렸더니 yarn 명령이 아예 작동이 안되는 것으로 봐서는 맞는 것 같습니다. brew install yarn으로 설치 다시 해줬더니 작동은 잘 됩니다! 선생님 이럴경우에 삭제 말고 따로 하둡과 충돌할 경우에 hadoop의 yarn과 node.js의 yarn을 별도로 관리하는 방법은 없을까요?
안녕하세요. 블로그앱 만드는 강의를 듣지 않았어서, 기존에 만들어진 블로그앱을 강의자료를 통해 다운로드 받았습니다. 맥과 윈도우 환경차이일지 모르겠는데, 섹션1-2 router/viewset 코딩하기의 예시를 복붙하여 실행시키는 코드가 ModuleNotFoundError: No module named 'rest_framework django' 아래와 같은 오류를 내며 실행되지 않습니다. 똑같이 urls.py를 다 주석처리 해주었으며, settings.py 설정도 완료된 상태입니다. 분명 모듈 네임이 rest_fraamework 인데 어디서 django가 붙는지 모르겠네요 ;; 해당 코드를 새로 제가 프로젝트를 하나 생성하여 실행시켰을 땐 아주 잘 실행이 됩니다. 혹시 기존의 강의자료에서 VueDjAgency-ch0를 다운받아 실행시킨다고 했을 때, 혹시 추가적으로 수정하거나,봐줘야 할 부분이 있는걸까요? 감사합니다.
tokens/phone API를 보면 res.send("인증완료") 만 보내줬는데도 200이 같이 전송 되는데 status 코드는 백엔드 측에서 res.status(200) 이런식으로 따로 입력해주지 않아도 정상적으로 api 호출이 됐을 경우에는 200이 자동으로 전송되는건가요?
비전공자를 위한 풀스택 맛집지도 만들기 프로젝트!: Front, Back-end 그리고 배포까지
"PM2를 활용한 무중단 배포"까지 진행하고 인스턴스는 현재 실행 중입니다. 이 상태를 모르고 로컬에서 VSCode로 node index.js명령을 실행했습니다. 그 후에 인스턴스를 중지할려고 WinSCP를 접속할려고 하는데 연결이 계속 거부되고 있습니다.. 서브에 연결할 수 있는 다른 방법은 없을까요? 일시적인 현상인 줄 알고 몇 일 기다렸다가 다시 시도해도 연결이 안됩니다,,