Home:ALL Converter>Django loading static files?

Django loading static files?

Ask Time:2015-05-09T02:14:18         Author:Groovietunes

Json Formatter

Django is not loading my static files. However it is loading my templates which are in the static folder. Also chrome is not seeing the static files either I'm not even getting a 404 error and yes they are linked in the html...but they are not showing up in the network panel

Heres my settings.py file

    STATIC_ROOT = ''

    STATIC_URL = '/static/'

    STATICFILES_DIRS =(
         os.path.join(BASE_DIR, 'static'),
     )

Here's my html

    <head>
        <title>MySite | Home</title>
        <meta charset="UTF-8">
        <link rel="stylesheet" type='text/css' src='css/normalize.css'>
        <link href='http://fonts.googleapis.com/css?family=Questrial|Josefin+Sans' rel='stylesheet' type='text/css'>
        <link rel="stylesheet" type="text/css" src='css/main.css'>
        <script src="https://maps.googleapis.com/maps/api/js"></script>
    </head>

Sorry I know this question has been asked multiple times and i've tried all those solutions with no luck. I've spent 2 days trying to figure this out

Author:Groovietunes,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/30130308/django-loading-static-files
Brandon Taylor :

The approach I take with static files is basically what's outlined in the docs.\n\nIn local development, Django will serve static files automatically from the directory specified in STATIC_ROOT as long as django.contrib.staticfiles is in your INSTALLED_APPS and DEBUG = True\n\nMy project structure typically looks like this:\n\nmy_project/\n some_app/\n lib/\n static/ <------- STATIC_ROOT - used in production. `collectstatic` collects here\n static_assets/ <- STATICFILES_DIRS - used in local dev\n css/\n less/\n js/\n images/\n templates/ <---- TEMPLATE_DIRS\n manage.py\n\n\nsettings.py is typically:\n\nINSTALLED_APPS = (\n . . .\n 'django.contrib.staticfiles',\n . . .\n)\n\nSTATIC_URL = '/static/'\nSTATIC_ROOT = os.path.join(BASE_DIR, 'static')\nSTATICFILES_DIRS = (\n os.path.join(BASE_DIR, 'static_assets'),\n)\nSTATICFILES_FINDERS = (\n 'django.contrib.staticfiles.finders.FileSystemFinder',\n 'django.contrib.staticfiles.finders.AppDirectoriesFinder',\n)\n\nTEMPLATE_DIRS = (\n os.path.join(BASE_DIR, 'templates'),\n)\n\n\nThen in templates, you can again use the staticfiles app's template tags to build out paths to static files:\n\n{% load static from staticfiles %}\n\n<link rel=\"stylesheet\" href=\"{% static 'css/normalize.css' %}\" />\n\n\nAlso note that with <link> tags, you need to use the href property for the url instead of src. ",
2015-05-08T19:12:04
yy