Django will not serve my static files. This returns an error :
[13/Jun/2014 06:12:09] "GET /refund/ HTTP/1.1" 200 2927 [13/Jun/2014 06:12:09] "GET /static/css/bootstrap.min.css HTTP/1.1" 404 1667 [13/Jun/2014 06:12:09] "GET /static/css/cover.css HTTP/1.1" 404 1643 [13/Jun/2014 06:12:09] "GET /static/js/bootstrap.min.js HTTP/1.1" 404 1661 [13/Jun/2014 06:12:09] "GET /static/assets/js/docs.min.js HTTP/1.1" 404 1667 [13/Jun/2014 06:12:09] "GET /static/js/bootstrap.min.js HTTP/1.1" 404 1661 [13/Jun/2014 06:12:09] "GET /static/assets/js/docs.min.js HTTP/1.1" 404 1667
Here is the relevant part of my base.html for bootstrap:
!DOCTYPE html> <html lang="en"> {% load static %} <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <link rel="shortcut icon" href="../../assets/ico/favicon.ico"> <title>Cover Template for Bootstrap</title> { <link href="{% static "css/bootstrap.min.css"%}" rel="stylesheet"> <link href="{% static "css/cover.css" %}" rel="stylesheet">
Relevant code from settings.py (Note. The templates worked fine.)
TEMPLATE_DIRS = ( os.path.join(BASE_DIR, 'templates'), ) STATIC_URL = '/static/' STATIC_ROOT = ''
And here is how my django project works out:
- admin
- db.sqlite3
- Project name
- manage.py
- app name
- Static
- template
Any help at all would be greatly appreciated. I donβt know what I may have done wrong, I looked through the code a million times and obviously this should be a gap in my understanding of how Django serves static files; however, I did this earlier without any problems.
python django static twitter-bootstrap web
Cowardly franc
source share