以下URLの参考ページをもとにdjangoアプリをAWS ElasticBeanstalkを使ってデプロイしました。
しかし、CSS,JSなどは反映されておらずstaticファイルが読み込めていない状況です。
どうすればローカルで開発したwebアプリと同様に表示されるのか教えて欲しいです。
よろしくお願いします。
.ebextensions / 02_python.config
03_collectstatic: command: "source /opt/python/run/venv/bin/activate && python manage.py collectstatic --noinput" "aws:elasticbeanstalk:container:python:staticfiles": "/static/": "www/static/"
setting.py
STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'static'), ] STATIC_ROOT = os.path.join(BASE_DIR, "..", "www", "static") STATIC_URL = '/static/'
css読み込み (base.html)
<link rel="stylesheet" href="{% static "css/hatenk.css" %}" type="text/css" />
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。