teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

情報の修正

2018/06/26 07:11

投稿

kaitotokai
kaitotokai

スコア59

title CHANGED
@@ -1,1 +1,1 @@
1
- DjangoアプリをHerokuデプロイできない
1
+ Herokuデプロイで503エラーが出る
body CHANGED
@@ -1,90 +1,5 @@
1
- DjangoアプリをHerokuデプロイできないです。
1
+ Herokuデプロイで
2
-
3
- https://djangogirlsjapan.gitbooks.io/workshop_tutorialjp/deploy/
4
- のサイトの手順にしたがってHerokuアプリをuploadしようとしています。
5
-
6
2
  ```ここに言語を入力
7
- git push heroku master
8
- ```
9
-
10
- ```ここに言語を入力
11
- heroku ps:scale web=1
12
- ```
13
-
14
- ```ここに言語を入力
15
- heroku open
16
- ```
17
- はうまくいったのですが、僕のアプリケーションのページであるhttps://xxxxxxxxx.herokuapp.com
18
- に行った時、
19
- ```ここに言語を入力
20
- Application error
21
- An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details.
22
- ```
23
- というエラーが出ました。
24
- ```ここに言語を入力
25
- heroku logs
26
- ```
27
- コマンドを打った時、
28
- ```ここに言語を入力
29
3
  2018-06-24T08:55:18.004452+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=xxxxxxxxx.herokuapp.com request_id=2e6dfc7f-9685-4732-a51f-7d35d12cc103 fwd="xxxxxxxxx" dyno= connect= service= status=503 bytes= protocol=https
30
- 2018-06-24T08:56:21.396018+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=xxxxxxxxx.herokuapp.com request_id=f9229ca1-5e28-451a-91c3-7ad062d4a4fe fwd="xxxxxxxxx" dyno= connect= service= status=503 bytes= protocol=https
31
- 2018-06-24T08:56:22.816116+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/admin" host=xxxxxxxxx.herokuapp.com request_id=5be36c68-2873-4399-808b-fe7b4ada8fca fwd="xxxxxxxxx" dyno= connect= service= status=503 bytes= protocol=https
32
- 2018-06-24T08:56:24.026167+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/admin" host=xxxxxxxxx.herokuapp.com request_id=c907049a-b0c8-4c1f-bd27-81344c1850d4 fwd="xxxxxxxxx" dyno= connect= service= status=503 bytes= protocol=https
33
- 2018-06-24T08:56:27.210655+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/admin/" host=xxxxxxxxx.herokuapp.com request_id=694e7487-749f-45b1-bb34-b131485546da fwd="xxxxxxxxx" dyno= connect= service= status=503 bytes= protocol=https
34
- 2018-06-24T08:56:36.931801+00:00 app[api]: Scaled to web@0:Free by user xxxxxxxxxxxxxxxxxx@gmail.com
35
- 2018-06-24T08:56:37.066921+00:00 heroku[web.1]: State changed from crashed to down
36
4
  ```
37
- が出ました。
38
- なぜ503エラーが出てページにアクセスできないのでしょうか?
39
- 一度Herokuを止め再起動しても同じエラーが出ました
5
+ のように503エラーが出ま
40
- ```ここに言語を入力
41
- DEBUG = False
42
- ```
43
- をTrueにしても同様のエラーが出てアクセスできず・・・。wsgi.pyには
44
- ```ここに言語を入力
45
- import os
46
- from whitenoise.django import DjangoWhiteNoise
47
- from django.core.wsgi import get_wsgi_application
48
-
49
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "todo.settings")
50
-
51
- application = get_wsgi_application()
52
-
53
- application = DjangoWhiteNoise(application)
54
-
55
- ```
56
- と書きました。
57
-
58
- App というアプリケーション名にしてありますが、
59
- Appディレクトリの直下で
60
- ```ここに言語を入力
61
- python manage.py collectstatic
62
- ```
63
- とうつと、
64
- ```ここに言語を入力
65
- Traceback (most recent call last):
66
- File "manage.py", line 15, in <module>
67
- execute_from_command_line(sys.argv)
68
- File "/Users/xxxx/test/lib/python3.6/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
69
- utility.execute()
70
- File "/Users/xxxx/test/lib/python3.6/site-packages/django/core/management/__init__.py", line 365, in execute
71
- self.fetch_command(subcommand).run_from_argv(self.argv)
72
- File "/Users/xxxx/test/lib/python3.6/site-packages/django/core/management/base.py", line 288, in run_from_argv
73
- self.execute(*args, **cmd_options)
74
- File "/Users/xxxx/test/lib/python3.6/site-packages/django/core/management/base.py", line 335, in execute
75
- output = self.handle(*args, **options)
76
- File "/Users/xxxx/test/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 189, in handle
77
- collected = self.collect()
78
- File "/Users/xxxx/test/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 105, in collect
79
- for path, storage in finder.list(self.ignore_patterns):
80
- File "/Users/xxxx/test/lib/python3.6/site-packages/django/contrib/staticfiles/finders.py", line 125, in list
81
- for path in utils.get_files(storage, ignore_patterns):
82
- File "/Users/xxxx/test/lib/python3.6/site-packages/django/contrib/staticfiles/utils.py", line 28, in get_files
83
- directories, files = storage.listdir(location)
84
- File "/Users/xxxx/test/lib/python3.6/site-packages/django/core/files/storage.py", line 313, in listdir
85
- for entry in os.listdir(path):
86
- FileNotFoundError: [Errno 2] No such file or directory: '/Users/xxxx/Downloads/2018/App/static'
87
- ```
88
- と出ました。
89
-
90
- どう修正したらいいのでしょうか?