분류 전체보기
-
Django settupProject using python/Cloning Airbnb 2021. 2. 19. 14:40
Select the python interpreter VSC를 쓴다면 Extension에서 python을 설치하자. window 기준 ctrl+shift+p를 누르고 select interpreter를 검색한다. 그리고 자신이 프로젝트가 있는 directory의 이름이 있는 경로를 선택한다. 자신의 프로젝트가 있는 경로가 아니다. 프로젝트의 이름을 가진 virtualenv(pipenv)의 경로다. 그럼 다음과 같이 밑에 pipenv의 경로가 설정된 것을 확인할 수 있다. Django 프로젝트 생성 $django-admin startproject 위 명령어로 django project를 생성한다. 나는 $django-admin startproject config를 통해서 config 파일을 생성했다. 그리..
-
Django 설치Project using python/Cloning Airbnb 2021. 2. 19. 14:09
Django 설명 Django는 굉장히 큰 Framework다. node.js가 레고 블록 같다면 Django는 완성된 장남감 로봇이다. 무슨 뜻이냐면, node.js는 아무것도 없는 상태에서 레고 블록을 쌓듯이 npm으로 package를 하나씩 설치해 가면서 앱을 만들어간다면, Django는 auth, admin, translation, context api 등등 이미 만들어져 있는 모든 것을 제공하고 우리는 이 장난감 상자에서 내가 원하는 것을 하나씩 꺼내 쓰면 된다. node.js는 내가 원하는 것을 마음대로 할 수 있는 자율성이 있다. 즉, 내가 node.js를 사용하는 느낌이다. 반면에, Django는 내가 Django를 사용하는 것이 아니라, Django가 나를 사용하는 느낌이다. Django..
-
개요Project using python/Cloning Airbnb 2021. 2. 19. 13:16
이 개발 일지는 노마드 코더의 Airbnb 클론 코딩을 기반으로 작성되었다. 웹의 프론트와 백 엔드를 혼자서 처리한 풀스택 프로젝트다. 목적 혼자서 Django를 이용한 풀스택 개발을 진행 함으로써 Django를 이용한 다른 웹 애플리케이션을 만들 수 있는 기본기를 다질 수 있다. 사용된 기술 서버 : Django DB : sqlite3(Django ORM) CSS framework : tailwind deployment : AWS(EC2) & DB(Amazon RDS - postgresql) 사용한 에디터 : Visual Studio Code
-
Extract reddit's posts and make export.html with Flask frameworkProject using python/Jobs scrapper 2020. 12. 21. 14:03
main.py // main.py from scrapperReddit import get_subreddits app = Flask("Job Scrapper", template_folder="./src/templates") db={} subreddits = [ "javascript", "reactjs", "reactnative", "programming", "css", "golang", "flutter", "rust", "django", ] @app.route('/') def index(): try: return render_template("home.html", subreddits=subreddits) except IOError: return redirect("/") @app.route('/reddit'..
-
export.html with Flask frameworkProject using python/Jobs scrapper 2020. 12. 21. 13:49
main.py from exporter import save_to_file @app.route('/export') def export(): try: word = request.args.get('word') if not word: print("not word") raise Exception() word = word.lower() jobs = db.get(word) if not jobs: print("not jobs") raise Exception() save_to_file(jobs, word) return redirect("/") except IOError: print("error") return redirect("/") search.html로 원하는 일자리들을 찾은 후에 해당 일자리를 .csv 파일로 다..
-
search.htmlProject using python/Jobs scrapper 2020. 12. 21. 13:44
main.py // main.py from flask import Flask, render_template, redirect, request from scrapperJobs import get_jobs db={} @app.route('/search') def search(): try: word = request.args.get('term') if word: word = word.lower() if word in db: jobs = db[word] else: jobs = get_jobs(word) db[word]=jobs else: redirect("/") return render_template("search.html", resultsNumber=len(jobs),searchingBy=word, jobs..
-
home.html with Flask frameworkProject using python/Jobs scrapper 2020. 12. 21. 13:16
Flask Introduction Flask는 쉽고 빠르게 web server를 만들 수 있는 python famework다. Installation pipenv install Flask Run flask // main.py from flask import Flask, render_template, redirect app = Flask("Job Scrapper", template_folder="./src/templates") @app.route('/') def index(): try: return render_template("home.html") except IOError: return redirect("/") app.run(host="127.0.0.1") app = Flask()를 통해서 Flask ..
-
Scrap remote.comProject using python/Jobs scrapper 2020. 12. 21. 11:53
scrapperRemote.py import requests from bs4 import BeautifulSoup headers = { "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36" } def extract_job(html): # title, company, location, link tds = html.find_all("td") link = tds[0].find("a")["href"] if not link: link = "" title = tds[1].find("h2").string if not title: ..