heroku

Heroku doesn't collect static on Django but tell that it does

拈花ヽ惹草 提交于 2020-08-10 19:15:54
问题 Command heroku run python manage.py collectstatic returns me something like 163 static files copied to '/app/live-static-files/static-root', 509 post-processed. Here are my settings: MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'whitenoise.middleware.WhiteNoiseMiddleware', # White Noise 'django.contrib.sessions.middleware.SessionMiddleware', ... ] STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, "live-static-files", "static-root") STATICFILES_STORAGE =

GitHub:随机生成UserAgent浏览器

倾然丶 夕夏残阳落幕 提交于 2020-08-10 14:43:57
hello,小伙伴们大家好,今天给大家推荐的开源项目是: fake-useragent ,这个开源项目对搞爬虫的业务的人来说是一个福利,不用去自己搭建自己的UA池,只需要调用对应的方法即可,简单易用,感兴趣的小伙伴不妨去下载尝试一下。 使用方法 from fake_useragent import UserAgent ua = UserAgent() ua.ie # Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US); ua.msie # Mozilla/5.0 (compatible; MSIE 10.0; Macintosh; Intel Mac OS X 10_7_3; Trident/6.0)' ua['Internet Explorer'] # Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; GTB7.4; InfoPath.2; SV1; .NET CLR 3.3.69573; WOW64; en-US) ua.opera # Opera/9.80 (X11; Linux i686; U; ru) Presto/2.8.131 Version/11.11 ua.chrome # Mozilla/5.0 (Windows NT 6

python入门神书!|python编程从入门到实践|内附网盘链接带提取码|

浪子不回头ぞ 提交于 2020-08-10 10:05:37
点击此处进入网盘下载地址 提取码: o39n 全书共有20章,书中的简介如下: 本书旨在让你尽快学会 Python ,以便能够编写能正确运行的程序 —— 游戏、数据可视化和 Web 应用程序,同时掌握让你终身受益的基本编程知识。本书适合任何年龄的读者阅读, 它不要求你有任何 Python 编程经验,甚至不要求你有编程经验。如果你想快速掌握基本的编程知识以便专注于开发感兴趣的项目,并想通过解决有意义的问题来检查你对新学概念 的理解程度,那么本书就是为你编写的。本书还可供初中和高中教师用来通过开发项目向学生介绍编程。 本书旨在让你成为优秀的程序员,具体地说,是优秀的 Python 程序员。通过阅读本书,你将迅速掌握编程概念,打下坚实的基础,并养成良好的习惯。阅读本书后,你就可以开始 学习 Python 高级技术,并能够更轻松地掌握其他编程语言。 在本书的第一部分,你将学习编写 Python 程序时需要熟悉的基本编程概念,你刚接触几乎任何编程语言时都需要学习这些概念。你将学习各种数据以及在程序中将数据存储到列表 和字典中的方式。你将学习如何创建数据集合以及如何高效地遍历这些集合。你将学习使用 while 和 if 语句来检查条件,并在条件满足时执行代码的一部分,而在条件不满足 时执行代码的另一部分 —— 这可为自动完成处理提供极大的帮助。 你将学习获取用户输入,让程序能够与用户交互

Error: Missing required flag: -a, --app APP app to run command against

强颜欢笑 提交于 2020-08-10 05:48:27
问题 I am new to Heroku and I keep getting the above error - everything looks good to go when I deploy in heroku, connect to my github repo etc.. but I keep getting this error. Its a node/express app and works exactly as I'd like locally but it won't deploy. Any help would be appreciated. 回答1: For getting logs of particular heroku app, use: heroku logs --app=app_name For example: your app name is 'chatapp' heroku logs -app=chatapp 回答2: just run the command with the --app flag, followed by the app

Django: Whitenoise not working in production with debug false

橙三吉。 提交于 2020-08-09 09:32:07
问题 I have a Django app with whitenoise for static files. But when I test the app with Google Lighthouse I get asked to enable text compression for my static .js and .css files. I read a lot of related posts but couldn´t find an answer. I also followed Heroku´s guide to implement it. https://devcenter.heroku.com/articles/django-assets Settings BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'whitenoise

GitHub、YouTube 们的开源替代品都有了!

橙三吉。 提交于 2020-08-09 06:41:30
有这样一个宝藏网站,里面收集了超级多知名软件的开源替代品。像 GitHub、Slack、1Password、Facebook、YouTube、Shopify、Heroku 等产品都可以在上面找到对应的开源解决方案。 它就是 OpenSource Builders。 比如就 GitHub 来看,我们可以看到这样一个列表: 从上图我们可以看到,Gogs、GitLab、Gitea 等 Git 服务,同时,还有 Star 数、编程语言、开源许可协议等信息。 而像开发者会常用的 Slack、1Password 工具,也有一串的开源替代品。 这个工具的开发者是来自美国德克萨斯州的 Junaid Kabani,事实上,他还不是专业编程出身。那么,为什么会开发并维护这个网站?Junaid 这样说道:「我的编程之旅大概起于一年前,当时我正在着手构建一种工具来帮助管理我的公司。就像大多数人开始学习如何变成一样,我被 GitHub 和开源软件所吸引。当我开始钻入这个‘兔子洞’时,我发现了大量的库,并且有许多非常出色的开发者正在维护它们。」 现在,可以通过以下方式 follow 这些工具。 URL:https://opensource.builders/ GitHub 地址:https://github.com/junaid33/opensource.builders 来源: oschina 链接:

POST request being received as GET request on Heroku

天涯浪子 提交于 2020-08-08 18:56:11
问题 Why aren't the POST params that are being set by a html form on another domain being received by my PHP script being hosted by Heroku? Context: I've got a simple html form which is sending some user data to a PHP script I've put on Heroku. The form is on a different site/domain, but as I understand the Same Origin Policy shouldn't be breaking the request. In fact, I've tested sending the request from the form to my local machine and the script worked fine. The request fires perfectly normally

POST request being received as GET request on Heroku

喜你入骨 提交于 2020-08-08 18:55:11
问题 Why aren't the POST params that are being set by a html form on another domain being received by my PHP script being hosted by Heroku? Context: I've got a simple html form which is sending some user data to a PHP script I've put on Heroku. The form is on a different site/domain, but as I understand the Same Origin Policy shouldn't be breaking the request. In fact, I've tested sending the request from the form to my local machine and the script worked fine. The request fires perfectly normally

如何将文件夹与现有的Heroku应用程序链接

无人久伴 提交于 2020-08-08 18:00:48
问题: I have an existing Rails app on GitHub and deployed on Heroku. 我在GitHub上有一个现有的Rails应用程序并部署在Heroku上。 I'm trying to set up a new development machine and have cloned the project from my GitHub repository. 我正在尝试建立一个新的开发机器,并从我的GitHub存储库中克隆了该项目。 However, I'm confused as to how to link this folder up to Heroku. 但是,我很困惑如何将此文件夹链接到Heroku。 Originally, I used the heroku create command, but obviously I don't want to do that this time since it will create another Heroku instance. 最初,我使用了 heroku create 命令,但显然我这次不想这样做,因为它会创建另一个Heroku实例。 解决方案: 参考一: https://stackoom.com/question/LWRS/如何将文件夹与现有的Heroku应用程序链接

Vue+Webpack app deploy on heroku not working when page is refreshed

早过忘川 提交于 2020-08-08 06:10:21
问题 I generated a vue app using vue-cli with webpack template and deployed it to heroku using this guide. I was able to run it without problem but when I refresh the page, or I accessed a sub route directly it fails. server.js var express = require('express') var path = require('path') var serveStatic = require('serve-static') app = express() app.use(serveStatic(__dirname)) var port = process.env.PORT || 5000 app.listen(port) console.log('server started '+ port) router.js My vue router config