T
T
tarp202020-07-22 19:34:25
css
tarp20, 2020-07-22 19:34:25

Can't see css files in Django app. how to fix?

html file

{% load static %}

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{% block title %} {% endblock %}</title>
    <link rel = "stylesheet" href="{% static '/css/bootstrap.min.css' %}">
    <link rel = "stylesheet" href="{% static '/css/style.css' %}">

    <script scr = '{% static 'js/bootstrap.min.js' %}'></script>
</head>
<body class="bg-blue">

  <div class="container">
      <div сlass="row">
          <div class="col-lg-4 col-lg-4">
              <br/>
              <br/>
              <br/>
              <div class="panel panel-body">
                  <div class="panel-body">
                      <h3 class="text-center text-uppercase"><b>{% block heading %}{% endblock %}</b></h3>
                      <br/>
                      {% block content %}{% endblock %}
                  </div>
              </div>
          </div>
      </div>
  </div>

</body>
</html>

settings.py file
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR,'staticfiles')
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
STATICFILES_DIRS = [
    os.path.join(BASE_DIR,'static')
]
INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
  <b>  'django.contrib.staticfiles',</b>
    'TarFoodApp',
    'oauth2_provider',
    'social_django',
    'rest_framework_social_oauth2',
]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
_
_, 2020-07-22
@mrxor

collectstatic

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question