Python Forum
[Django] css file is not applying to the page
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Django] css file is not applying to the page
#2
If your on an apache2 web server, you may need to setup an alias for the static folder.
Or you may need to do the collect static command. I don't remember the command.
Here is how mine is setup. The static folder resides in the django root folder.
I did not see tags for and code other than python.
{% load static %}
<!DOCTYPE html>
<html lang="en" dir="ltr">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>{% block title %}{% endblock title %}</title>
        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
        <link rel="stylesheet" href="{% static 'css/homepages/home.css' %}">
        <link href="https://fonts.googleapis.com/css?family=Peralta&display=swap" rel="stylesheet">
        <link rel="stylesheet" href="{% static 'css/all.css' %}">
    </head>
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags


Reply


Messages In This Thread
RE: [Django] css file is not applying to the page - by menator01 - May-09-2020, 06:54 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  <title> django page title dynamic and other field (not working) lemonred 1 2,115 Nov-04-2021, 08:50 PM
Last Post: lemonred
  creating an exe file for a python django project Sanjish 0 2,627 Dec-27-2020, 07:33 AM
Last Post: Sanjish
  use Xpath in Python :: libxml2 for a page-to-page skip-setting apollo 2 3,650 Mar-19-2020, 06:13 PM
Last Post: apollo
  upload big file in Django with process bar and i get error : MemoryError ma_norouzifar 3 4,430 Aug-06-2019, 06:57 AM
Last Post: fishhook
  Django Two blocks of dynamic content on one page iFunKtion 5 4,437 Jul-04-2019, 02:31 AM
Last Post: noisefloor
  Django: How to automatically substitute a variable in the admin page at Django 1.11? m0ntecr1st0 3 3,337 Jun-30-2019, 12:21 AM
Last Post: scidam
  Sorting getting off, when I switch page Django 1.11 m0ntecr1st0 0 1,993 Feb-12-2019, 06:40 PM
Last Post: m0ntecr1st0
  Open Sqlite database file directly in django sourabhjaiswal92 0 2,960 May-22-2018, 05:55 AM
Last Post: sourabhjaiswal92
  Django-cms link to a page Alkatron 4 8,288 Apr-06-2018, 10:58 AM
Last Post: Alkatron
  How do I make a Django model from a tab-delimited data file? newbietostuff 0 2,532 Jan-09-2018, 02:44 AM
Last Post: newbietostuff

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020