Code Monkey home page Code Monkey logo

2017_pycontw_talk's Introduction

用 Django 建立一個可以設定爬蟲排程任務與監控的網站

範例環境設定

  • 建立 log 資料夾和 .log 檔案

    cd code/pycontw/
    mkdir -p logs
    cd logs
    touch django.log ghostdriver.log project.log
  • 建立環境變數 local.env, local.py

    cp pycontw/settings/local_sample.env pycontw/settings/local.env
    cp pycontw/settings/local_sample.py pycontw/settings/local.py
  • 設定環境變數 在執行終端機模式執行下面指令取得 Secret_key:

    $ python -c 'import random; import string; print("".join([random.SystemRandom().choice(string.digits + string.ascii_letters + string.punctuation) for i in range(100)]))'

    vim local.env 將剛剛產生的 key 填入 SECRET_KEY= 不用加引號 ''

  • 確認 requirments.txt 內套件都安裝,執行 migrate 就完成了。 因為 lazy_logger 最新版本 0.1.2 尚未上傳到 PyPi 所以請先到 lazy-logger 資料夾內 python setup.py install 安裝最新版本 lazy_logger 確認 lazy_logger 的版本是 0.1.2 萬一低於 0.1.2 版本會造成使用 @logger.patch 的 hook 回傳值是 None。

2017_pycontw_talk's People

Contributors

chairco avatar hondajojo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.