web配置和部署问题集合
1、有时候系统里安装了heroku ,但是在命令符下面没有该命令。
原因可能是heroku安装的目录不适当,最好把heroku安装在项目外面的文件夹。
2、Heroku: “No default language could be detected for this app” error thrown for node app
该错误是意思:“没有默认语言可以为这个应用程序检测”错误抛出节点应用
解决方案:
可能是目录问题。刚开始我的目录是wblog下面有两个文件,.idea/和wblog/,wblog/下面才是真正的项目,建立的Git仓库是第一个wblog/,后来改为以第二个wblog/为仓库,最后问题就解决了。
3、推送到heroku出错heroku config:set DISABLE_COLLECTSTATIC=1
参考博文:https://blog.****.net/wbdxz/article/details/81261648
4、文件太大,上传失败fatal: the remote end hung up unexpectedly
解决方案:
执行:git config --global http.postBuffer 2428000即可。
5、git push heroku master出错
1 D:pycharmpycharm projectswblogwblog>git push heroku master 2 Enumerating objects: 84, done. 3 Counting objects: 100% (84/84), done. 4 Delta compression using up to 8 threads 5 Compressing objects: 100% (76/76), done. 6 Writing objects: 100% (84/84), 34.45 KiB | 440.00 KiB/s, done. 7 Total 84 (delta 7), reused 0 (delta 0) 8 remote: Compressing source files... done. 9 remote: Building source: 10 remote: 11 remote: -----> Python app detected 12 remote: ! Requested runtime (python-3.5.1) is not available for this stack (heroku-18). 13 remote: ! Aborting. More info: https://devcenter.heroku.com/articles/python-support 14 remote: ! Push rejected, failed to compile Python app. 15 remote: 16 remote: ! Push failed 17 remote: Verifying deploy... 18 remote: 19 remote: ! Push rejected to shielded-brook-99547. 20 remote: 21 To https://git.heroku.com/shielded-brook-99547.git 22 ! [remote rejected] master -> master (pre-receive hook declined) 23 error: failed to push some refs to 'https://git.heroku.com/shielded-brook-99547.git'
解决方案:
我把runtime.txt里面的python改为了3.6.8
接着会出现一下错误,
1 D:pycharmpycharm projectswblogwblog>git push heroku master 2 Enumerating objects: 92, done. 3 Counting objects: 100% (92/92), done. 4 Delta compression using up to 8 threads 5 Compressing objects: 100% (83/83), done. 6 Writing objects: 100% (92/92), 35.78 KiB | 563.00 KiB/s, done. 7 Total 92 (delta 12), reused 0 (delta 0) 8 remote: Compressing source files... done. 9 remote: Building source: 10 remote: 11 remote: -----> Python app detected 12 remote: ! Python has released a security update! Please consider upgrading to python-3.6.8 13 remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes 14 remote: -----> Installing python-3.6.8 15 remote: -----> Installing pip 16 remote: -----> Installing SQLite3 17 remote: -----> Installing requirements with pip 18 remote: Collecting appdirs==1.4.3 (from -r /tmp/build_8d23071551bb05a006e5bf4b580e171b/requirement 19 s.txt (line 1)) 20 remote: Downloading https://files.pythonhosted.org/packages/56/eb/810e700ed1349edde4cbdc1b2a21e2 21 8cdf115f9faf263f6bbf8447c1abf3/appdirs-1.4.3-py2.py3-none-any.whl ——snip—— 64 remote: 65 remote: -----> $ python manage.py collectstatic --noinput 66 remote: Traceback (most recent call last): 67 remote: File "manage.py", line 21, in <module> 68 remote: main() 69 remote: File "manage.py", line 17, in main 70 remote: execute_from_command_line(sys.argv) 71 remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py 72 ", line 381, in execute_from_command_line 73 remote: utility.execute() 74 remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py 75 ", line 375, in execute 76 remote: self.fetch_command(subcommand).run_from_argv(self.argv) 77 remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/base.py", l 78 ine 323, in run_from_argv 79 remote: self.execute(*args, **cmd_options) 80 remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/base.py", l 81 ine 364, in execute 82 remote: output = self.handle(*args, **options) 83 remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/contrib/staticfiles/managem 84 ent/commands/collectstatic.py", line 188, in handle 85 remote: collected = self.collect() 86 remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/contrib/staticfiles/managem 87 ent/commands/collectstatic.py", line 114, in collect 88 remote: handler(path, prefixed_path, storage) 89 remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/contrib/staticfiles/managem 90 ent/commands/collectstatic.py", line 342, in copy_file 91 remote: if not self.delete_file(path, prefixed_path, source_storage): 92 remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/contrib/staticfiles/managem 93 ent/commands/collectstatic.py", line 249, in delete_file 94 remote: if self.storage.exists(prefixed_path): 95 remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/files/storage.py", lin 96 e 310, in exists 97 remote: return os.path.exists(self.path(name)) 98 remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/contrib/staticfiles/storage 99 .py", line 44, in path 100 remote: raise ImproperlyConfigured("You're using the staticfiles app " 101 remote: django.core.exceptions.ImproperlyConfigured: You're using the staticfiles app without havi 102 ng set the STATIC_ROOT setting to a filesystem path. 103 remote: 104 remote: ! Error while running '$ python manage.py collectstatic --noinput'. 105 remote: See traceback above for details. 106 remote: 107 remote: You may need to update application code to resolve this error. 108 remote: Or, you can disable collectstatic for this application: 109 remote: 110 remote: $ heroku config:set DISABLE_COLLECTSTATIC=1 111 remote: 112 remote: https://devcenter.heroku.com/articles/django-assets 113 remote: ! Push rejected, failed to compile Python app. 114 remote: 115 remote: ! Push failed 116 remote: Verifying deploy... 117 remote: 118 remote: ! Push rejected to shielded-brook-99547. 119 remote: 120 To https://git.heroku.com/shielded-brook-99547.git 121 ! [remote rejected] master -> master (pre-receive hook declined) 122 error: failed to push some refs to 'https://git.heroku.com/shielded-brook-99547.git'
然后执行
1 pip install appdirs --upgrade
2 pip freeze > requirements.txt
问题就解决了。
6、application error
1、Procfiles命名导致,具体请看看https://www.cnblogs.com/liyanyinng/p/11267316.html
2、at=error code=H10 desc="App crashed" method=GET错误,具体请看看https://www.cnblogs.com/liyanyinng/p/11267395.html
7、git add 问题,请看看