Tteokbokki Map API Server
Here is always usable develop stage ttbkk-server for ttbkk-web contributor.
You don't need to run this server for your client development.
Just fill text like below in your .env file in ttbkk-web project.
REACT_APP_API_HOST=https://dev-api.ttbkk.com
There are multiple ways to get python environments.
- pyenv
- venv
- pipenv
git clone https://github.com/siner308/ttbkk-server
cd ttbkk-server
pip install -r requirements.txt
- Copy
env.sample.py
toenv.py
cp env.sample.py env.py
- Set env
- Fill environments in your
env.py
- Fill environments in your
Before launch, you need to setup mysql database.
python3 manage.py migrate
python3 manage.py runserver 0.0.0.0:8000
- Download chromedriver that suit with your os and chrome version.
- Locate chromedriver to your project root.
- For example:
./ttbkk-server/chromedriver
- For example:
- Fix your
env.py
# env.py CHROMEDRIVER_PATH = './chromedriver'
- Set Google API Key
- Set Kakao API Key
- Fix your
env.py
GOOGLE_MAP_KEY = '' KAKAO_API_KEY = ''
-
Setup database
Before launch, you need to setup mysql database.
-
Select targets you want to scrap.
# src.crawlers.main.py: def run(): crawlers = get_crawlers([ # FranchiseType.SINJEON, # FranchiseType.GAMTAN, # FranchiseType.YUPDDUK, # FranchiseType.BAEDDUCK, # FranchiseType.MYUNGRANG, # FranchiseType.YOUNGDABANG, # FranchiseType.SINCHAM, # FranchiseType.SINBUL, # FranchiseType.EUNGDDUK, # FranchiseType.JAWSFOOD, # FranchiseType.TTEOKCHAM, # FranchiseType.SAMCHEOP, # FranchiseType.DALDDUK, # FranchiseType.DOOKKI FranchiseType.KANG ]) for crawler in crawlers: crawler.run()
-
Move into django shell
# in bash python3 manage.py migrate python3 manage.py shell
-
Run script
# in python shell >>> from src.crawlers.main import run >>> run()