Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

佈署問題 #5

Open
sumhncku opened this issue Aug 17, 2017 · 17 comments
Open

佈署問題 #5

sumhncku opened this issue Aug 17, 2017 · 17 comments

Comments

@sumhncku
Copy link

我照著步驟完成到佈署
得到對應的URL為
https://morning-thicket-44028.herokuapp.com/callback
卻得到下面的訊息
A http status of the response was '503 Service Unavailable'.
不知道該如何解決

@twtrubiks
Copy link
Owner

twtrubiks commented Aug 17, 2017

你好,看起來你佈署是失敗的或是啟動時有問題,
去看看heroku的log 資訊,方法可參考下方(我之前寫的文章)
請參考 LOG 資訊

@sumhncku
Copy link
Author

感謝您的回覆
從LOG看來是少了bs4
2017-08-17T03:27:03.691238+00:00 app[web.1]: from bs4 import BeautifulSoup
2017-08-17T03:27:03.691243+00:00 app[web.1]: ModuleNotFoundError: No module named 'bs4'
但是我用 pip install bs4
發現是沒有這個package

@twtrubiks
Copy link
Owner

咦? 你佈署沒按照我的步驟嘛? 這個不是在 requirements.txt 裡面了?

@sumhncku
Copy link
Author

我看你的視頻~只有安裝了下面幾個
certifi==2017.7.27.1
chardet==3.0.4
click==6.7
Flask==0.12.2
gunicorn==19.7.1
idna==2.6
itsdangerous==0.24
Jinja2==2.9.6
MarkupSafe==1.0
requests==2.18.4
urllib3==1.22
Werkzeug==0.12.2

@twtrubiks
Copy link
Owner

twtrubiks commented Aug 17, 2017

如果你沒有用到 BeautifulSoup,也沒有安裝 BeautifulSoup,要把 from bs4 import BeautifulSoup 拿掉

我有用到 BeautifulSoup ,所以我有放在 requirements.txt 裡面

@sumhncku
Copy link
Author

感謝您
我重新操作後完成了
麻煩您陪我一起討論了
感謝

@twtrubiks
Copy link
Owner

😄

@sumhncku
Copy link
Author

萬分感謝

@hewenji
Copy link

hewenji commented Aug 26, 2017

想請問API_Get_Image這個變數應該設定成甚麼,有推薦的嗎?

@twtrubiks
Copy link
Owner

twtrubiks commented Aug 26, 2017

@hewenji

這個 API_Get_Image 是我自己寫的爬蟲,api 我沒有公開,因為我怕 server 炸掉。

但我有把程式碼放出來,可以參考我之前寫的文章

auto_crawler_ptt_beauty_image

Deploying_Django_To_Heroku_Tutorial

@Sn0wl3r0ker
Copy link

請問這兩個都部署好後 api該放什麼?還有我在部署deploying_Django_To_Heroku_Tutorial 後 一直有這個錯誤" connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? "
求大神幫忙ww
default

@Sn0wl3r0ker
Copy link

請問這兩個都部署好後 api該放什麼?還有我在部署deploying_Django_To_Heroku_Tutorial 後 一直有這個錯誤" connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? "
求大神幫忙ww
default

這邊我把db2先markdown後就正常了>...< 爬文爬了半天 最後竟然是這種小細節ww
請問那api是放什麼呢?

@twtrubiks
Copy link
Owner

@Sn0wl3r0ker api 放什麼? 你是指 API_Get_Image 這個嗎?

@Sn0wl3r0ker
Copy link

Sn0wl3r0ker commented Jan 19, 2019

@Sn0wl3r0ker api 放什麼? 你是指 API_Get_Image 這個嗎?

對 爬蟲跟顯示的我都部署上去了 但是不知道API_Get_Image到底該放什麼..有試著直接放url http://xxxx.herokuapp.com/api/image/?format=json 這樣類似的 但是都會報錯

@twtrubiks
Copy link
Owner

twtrubiks commented Jan 20, 2019

@Sn0wl3r0ker hi~ 可能是我說的不夠清楚,如果你建立起來了,api code 在 here

url 應該是 http://xxxx.herokuapp.com/api/image/random/ 這樣才對,如果你不喜歡你可以再改,
基本上就是從資料庫隨機抽一張。

@Sn0wl3r0ker
Copy link

@Sn0wl3r0ker hi~ 可能是我說的不夠清楚,如果你建立起來了,api code 在 here

url 應該是 http://xxxx.herokuapp.com/api/image/random/ 這樣才對,如果你不喜歡你可以再改,
基本上就是從資料庫隨機抽一張。

了解了~感謝回覆 順便恭喜你面試上 看你文章跟youtube影片真的獲益良多 +U : )

@twtrubiks
Copy link
Owner

@Sn0wl3r0ker 面試過後,發現還是很多要學,太弱了QAQ
不過能幫上你真好^0^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants