Git Product home page Git Product logo

search-boot-camp-api's Introduction

img.png

swaggerscreen


1. κ°€μƒν™˜κ²½ μ„€μ •

  • μ €λŠ” μ•„λ‚˜μ½˜λ‹€λ‘œ ν–ˆλŠ”λ° μ•„λž˜μ²˜λŸΌ 일케 ν•˜μ…”λ„ λŒ€μ—¬ (μ½”λ“œλŠ” μ•Œμ•„μ„œ μ°Ύμ•„λ³΄μ‹œλŠ”κ²Œ λΉ λ₯Όμ§€λ„ γ…Žγ…Ž)

1) κ°€μƒν™˜κ²½ 생성 및 μ‹€ν–‰

% python -m venv κ°€μƒν™˜κ²½μ΄λ¦„ --python=python3.8
% cd κ°€μƒν™˜κ²½μ΄λ¦„/Scripts
% activate.bat 
% cd λ³Έ ν”„λ‘œμ νŠΈ 경둜 

2) μ΅œμƒμœ„ ν΄λ”μ˜ requirements.txt둜 ν•„μš”ν•œ package μ„€μΉ˜

% pip install requirements.txt

2. MariaDB μ„€μ •

1) mariaDB ν„°λ―Έλ„μ—μ„œ database 생성

MariaDB [(none)]> create database λ°μ΄ν„°λ² μ΄μŠ€μ΄λ¦„;
MariaDB [(none)]> use λ°μ΄ν„°λ² μ΄μŠ€μ΄λ¦„;
Database changed
MariaDB [sbc]> grant all privileges on λ°μ΄ν„°λ² μ΄μŠ€μ΄λ¦„.* to 'root'@'%' identified by 'μ΅œμ΄ˆμ‹€ν–‰μ‹œμƒμ„±ν•œλΉ„λ°€λ²ˆν˜Έ';

2) settings.pyμ—μ„œ μžμ‹ μ˜ mariaDB μ •λ³΄λ‘œ μˆ˜μ •ν•΄μ€λ‹ˆλ‹€

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'λ°μ΄ν„°λ² μ΄μŠ€μ΄λ¦„',
        'USER': 'root',
        'PASSWORD': 'μ΅œμ΄ˆμ‹€ν–‰μ‹œμƒμ„±ν•œλΉ„λ°€λ²ˆν˜Έ',
        'HOST': '127.0.0.1',
        'PORT': '3306'
    }
}

3. μ—‘μ…€ 데이터 DB에 μ €μž₯ν•˜κΈ°

  • 제 κ±°λŠ” μ½”λ“œμ— 맞게 μˆ˜μ •λœ 파일이라 μ—¬λŸ¬λΆ„ sheetμ—μ„œλŠ” λ‹€λ₯Ό 수 μžˆμ–΄μš©
  • 그럼 μ—°λ½μ£Όμ„Έμš© ~~~ μ•„λ‹˜ 제 걸둜 κ·Έλƒ₯ λŒλ €μ£Όμ„Έμš”~~~

1) ν„°λ―Έλ„μ—μ„œ μ‹€ν–‰ 후에 table이 μƒμ„±λ˜λŠ”μ§€ ν™•μΈν•΄μ£Όμ„Έμš” ~

% python manage.py makemigrations BootCamp
% python manage.py migrate 

2) BootCampUpdate.py μˆ˜μ •ν•˜κΈ°

conn = pymysql.connect(host='127.0.0.1', user='root', password='μ΅œμ΄ˆμ‹€ν–‰μ‹œμƒμ„±ν•œλΉ„λ°€λ²ˆν˜Έ', db='sbc')
curs = conn.cursor(pymysql.cursors.DictCursor)

3) μ—‘μ…€ 파일 DB에 μ €μž₯ν•˜κΈ°

% cd BootCamp
% python BootCampUpdate.py 

4. Django 초기 μ„€μ •

  • createsuperuser μŠˆνΌλ‘νΌκΆŒν•œμ„ 가진 admin 계정을 μƒμ„±ν•΄μ£Όμ„Έμš©
  • μ„œλ²„ ꡬ동 후에 admin νŽ˜μ΄μ§€ κ°€μ„œ 계정 잘 λ§Œλ“€μ–΄μ‘Œλ‚˜ 확인해보세μš₯
% cd sbc_api
% python manage.py createsuperuser 
% python manage.py runserver 

‼️ μœ μ˜μ‚¬ν•­

  1. requirement.txt 파일이 계속 μ—λŸ¬κ°€ λ‚˜λ©΄ 이 파일둜 μˆ˜μ •ν•΄μ„œ install ν•΄μ£Όμ„Έμš”!

requirements.txt

search-boot-camp-api's People

Contributors

kathyleesh avatar myunbongs avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.