I recently deployed my first simple Django 1.8.6 application to AWS via Elastic Beanstalk.
While everything appears to be working properly, the styles are not loading as expected.
Below is the template code:
{% load blog_tags %}
{% load staticfiles %}
<!DOCTYPE html>
<html>
<head>
<title>{% block title %}{% endblock %}</title>
<link href="{% static "css/blog.css" %}" rel="stylesheet">
</head>
<body>
<div id="content">
{% block content %}
{% endblock %}
</div>
<div id="sidebar">
<h2>My blog!</h2>
<p>This is my blog. I have written {% total_posts %} posts so far.</p>
<h3>Latest posts</h3>
{% show_latest_posts 3 %}
</div>
</body>
</html>
And here is the page's source code:
<!DOCTYPE html>
<html>
<head>
<title>My Blog !!!</title>
<link href="/static/css/blog.css" rel="stylesheet">
</head>
<body>
<div id="content"> ...
When clicking on the link "/static/css/blog.css" on the local machine, the CSS file opens correctly. However, on Beanstalk, it cannot be found.
I suspect this issue is related to some configurations. Any suggestions on where to look for a solution?
Edit:
Here is the contents of the .ebextensions/django.config file:
option_settings:
aws:elasticbeanstalk:container:python:
WSGIPath: django_by_example_blog/wsgi.py
StaticFiles: /static/=static/