the0demiurge / ShadowSocksShare

(No longer maintained owing to the lack of sufficient free ss accounts)Python爬虫/Flask网站/免费ShadowSocks账号/ssr订阅/json 订阅
http://ss.pythonic.life/
Apache License 2.0
3.03k stars 1.04k forks source link

heroku部署网站,貌似不能修改页面样式 #36

Closed hoochanlon closed 6 years ago

the0demiurge commented 6 years ago

改HTML和CSS不就行么

hoochanlon commented 6 years ago

网页的内部文件看不到,貌似有点没法改,只能浏览器调试样式

the0demiurge commented 6 years ago

内部文件就是template里面的HTML文件,是应当在本地修改后再部署到heroku的

hoochanlon commented 6 years ago

ss账号没生成(时间问题)

heroku部署在master分支并没有显示,部署是成功的,网页却显示Application error 网页未正确显示

the0demiurge commented 6 years ago

贴一下部署日志(show build log)和运行日志(在右上角)吧:)

hoochanlon commented 6 years ago

show build log

 Collecting Flask (from -r /tmp/build_9d55aa2a12d1c6b996942ab3e1cbf814/requirements.txt (line 1))
         Downloading Flask-0.12.2-py2.py3-none-any.whl (83kB)
       Collecting pysocks (from -r /tmp/build_9d55aa2a12d1c6b996942ab3e1cbf814/requirements.txt (line 2))
         Downloading PySocks-1.6.8.tar.gz (283kB)
       Collecting zbar-py (from -r /tmp/build_9d55aa2a12d1c6b996942ab3e1cbf814/requirements.txt (line 3))
         Downloading zbar-py-1.0.4.tar.gz (543kB)
       Collecting numpy (from -r /tmp/build_9d55aa2a12d1c6b996942ab3e1cbf814/requirements.txt (line 4))
         Downloading numpy-1.14.2-cp36-cp36m-manylinux1_x86_64.whl (12.2MB)
       Collecting Flask-Script (from -r /tmp/build_9d55aa2a12d1c6b996942ab3e1cbf814/requirements.txt (line 5))
         Downloading Flask-Script-2.0.6.tar.gz (43kB)
       Collecting regex (from -r /tmp/build_9d55aa2a12d1c6b996942ab3e1cbf814/requirements.txt (line 6))
         Downloading regex-2018.02.21.tar.gz (620kB)
       Collecting beautifulsoup4 (from -r /tmp/build_9d55aa2a12d1c6b996942ab3e1cbf814/requirements.txt (line 7))
         Downloading beautifulsoup4-4.6.0-py3-none-any.whl (86kB)
       Collecting requests (from -r /tmp/build_9d55aa2a12d1c6b996942ab3e1cbf814/requirements.txt (line 8))
         Downloading requests-2.18.4-py2.py3-none-any.whl (88kB)
       Collecting pillow (from -r /tmp/build_9d55aa2a12d1c6b996942ab3e1cbf814/requirements.txt (line 9))
         Downloading Pillow-5.1.0-cp36-cp36m-manylinux1_x86_64.whl (2.0MB)
       Collecting cfscrape (from -r /tmp/build_9d55aa2a12d1c6b996942ab3e1cbf814/requirements.txt (line 10))
         Downloading cfscrape-1.9.5.tar.gz
       Collecting gunicorn (from -r /tmp/build_9d55aa2a12d1c6b996942ab3e1cbf814/requirements.txt (line 11))
         Downloading gunicorn-19.7.1-py2.py3-none-any.whl (111kB)
       Collecting itsdangerous>=0.21 (from Flask->-r /tmp/build_9d55aa2a12d1c6b996942ab3e1cbf814/requirements.txt (line 1))
         Downloading itsdangerous-0.24.tar.gz (46kB)
       Collecting click>=2.0 (from Flask->-r /tmp/build_9d55aa2a12d1c6b996942ab3e1cbf814/requirements.txt (line 1))
         Downloading click-6.7-py2.py3-none-any.whl (71kB)
       Collecting Werkzeug>=0.7 (from Flask->-r /tmp/build_9d55aa2a12d1c6b996942ab3e1cbf814/requirements.txt (line 1))
         Downloading Werkzeug-0.14.1-py2.py3-none-any.whl (322kB)
       Collecting Jinja2>=2.4 (from Flask->-r /tmp/build_9d55aa2a12d1c6b996942ab3e1cbf814/requirements.txt (line 1))
         Downloading Jinja2-2.10-py2.py3-none-any.whl (126kB)
       Collecting certifi>=2017.4.17 (from requests->-r /tmp/build_9d55aa2a12d1c6b996942ab3e1cbf814/requirements.txt (line 8))
         Downloading certifi-2018.1.18-py2.py3-none-any.whl (151kB)
       Collecting urllib3<1.23,>=1.21.1 (from requests->-r /tmp/build_9d55aa2a12d1c6b996942ab3e1cbf814/requirements.txt (line 8))
         Downloading urllib3-1.22-py2.py3-none-any.whl (132kB)
       Collecting chardet<3.1.0,>=3.0.2 (from requests->-r /tmp/build_9d55aa2a12d1c6b996942ab3e1cbf814/requirements.txt (line 8))
         Downloading chardet-3.0.4-py2.py3-none-any.whl (133kB)
       Collecting idna<2.7,>=2.5 (from requests->-r /tmp/build_9d55aa2a12d1c6b996942ab3e1cbf814/requirements.txt (line 8))
         Downloading idna-2.6-py2.py3-none-any.whl (56kB)
       Collecting MarkupSafe>=0.23 (from Jinja2>=2.4->Flask->-r /tmp/build_9d55aa2a12d1c6b996942ab3e1cbf814/requirements.txt (line 1))
         Downloading MarkupSafe-1.0.tar.gz
       Installing collected packages: itsdangerous, click, Werkzeug, MarkupSafe, Jinja2, Flask, pysocks, numpy, zbar-py, Flask-Script, regex, beautifulsoup4, certifi, urllib3, chardet, idna, requests, pillow, cfscrape, gunicorn
         Running setup.py install for itsdangerous: started
           Running setup.py install for itsdangerous: finished with status 'done'
         Running setup.py install for MarkupSafe: started
           Running setup.py install for MarkupSafe: finished with status 'done'
         Running setup.py install for pysocks: started
           Running setup.py install for pysocks: finished with status 'done'
         Running setup.py install for zbar-py: started
           Running setup.py install for zbar-py: finished with status 'done'
         Running setup.py install for Flask-Script: started
           Running setup.py install for Flask-Script: finished with status 'done'
         Running setup.py install for regex: started
           Running setup.py install for regex: finished with status 'done'
         Running setup.py install for cfscrape: started
           Running setup.py install for cfscrape: finished with status 'done'
       Successfully installed Flask-0.12.2 Flask-Script-2.0.6 Jinja2-2.10 MarkupSafe-1.0 Werkzeug-0.14.1 beautifulsoup4-4.6.0 certifi-2018.1.18 cfscrape-1.9.5 chardet-3.0.4 click-6.7 gunicorn-19.7.1 idna-2.6 itsdangerous-0.24 numpy-1.14.2 pillow-5.1.0 pysocks-1.6.8 regex-2018.2.21 requests-2.18.4 urllib3-1.22 zbar-py-1.0.4
-----> Discovering process types
       Procfile declares types -> web
-----> Compressing...
       Done: 62.8M
-----> Launching...
       Released v5
       https://share-shadowsocks.herokuapp.com/ deployed to Heroku

view log

2018-04-11T08:10:35.808942+00:00 app[web.1]:   File "manage.py", line 6, in <module>
2018-04-11T08:10:35.809106+00:00 app[web.1]:     from app import app
2018-04-11T08:10:35.809109+00:00 app[web.1]:   File "/app/app/__init__.py", line 9, in <module>
2018-04-11T08:10:35.809228+00:00 app[web.1]:     from app import views, models
2018-04-11T08:10:35.809231+00:00 app[web.1]:   File "/app/app/views.py", line 15, in <module>
2018-04-11T08:10:35.809348+00:00 app[web.1]:     PERIOD = int(os.environ.get('PERIOD', 300))
2018-04-11T08:10:35.809368+00:00 app[web.1]: ValueError: invalid literal for int() with base 10: '× 5'
2018-04-11T08:10:35.903090+00:00 heroku[web.1]: Process exited with status 1
2018-04-11T08:10:37.386303+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=share-shadowsocks.herokuapp.com request_id=d732bb7c-17fd-45bb-84b2-cbfc1a102ebe fwd="223.152.235.165" dyno= connect= service= status=503 bytes= protocol=https
2018-04-11T08:10:45.655793+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=share-shadowsocks.herokuapp.com request_id=eb53bf5e-da6f-44d1-9244-d762df8f93e9 fwd="223.152.235.165" dyno= connect= service= status=503 bytes= protocol=https

环境变量添加 PERIOD 字段,以控制网站内容更新周期(每访问 PERIOD 次重新爬取信息),PERIOD 建议设置为用户数量 × 5

我按照这个方法做了,可master分支就部署不上了,不这样又搜不到ss账号,其他分支又都没问题

the0demiurge commented 6 years ago

image 这个应该你自己计算一下PERIOD的值,比如3个人使用就设置为15,而不是3 x 5

hoochanlon commented 6 years ago

感谢回答,基本搞定了