why is the static file not loading.i need solution

21 views
Skip to first unread message

Obodoma Uzondu Vincent

unread,
Oct 20, 2018, 11:35:52 AM10/20/18
to django...@googlegroups.com
THIS IS THE HTML FILE  
<head>
    <title>login</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
    {% load static %}
    <link rel="stylesheet" href= "{% static 'accounts\style.css' %}" type="text/css">
  </head>
  <body>

    <div class="container">
      <h1>welcome</h1>
      Welcome to my page!
      <button type="button" class="btn btn-default">Success</button>
    </div>
  </body>
THIS IS THE CSS FILE
h1 {
color: red;
  }

Siddharth Tamang

unread,
Oct 20, 2018, 11:45:20 AM10/20/18
to django...@googlegroups.com
Have you defined your static files entry in settings.py?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACsKspkppG6UHwhfXko0z5DO%2BXkk9LvxLwO6dmEjkARRbm7PjA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


--
Thank you
Siddharth Tamang
AWS Certified Solutions Architect - Associate

Gabriel Stone

unread,
Oct 20, 2018, 11:58:50 AM10/20/18
to django...@googlegroups.com
Also in your href try using a forward slash not a back slash to make references

Reply all
Reply to author
Forward
0 new messages