CSS not linking with HTML

120 views
Skip to first unread message

sukhy gill

unread,
May 28, 2021, 2:39:24 PM5/28/21
to Django users
Dear Frnds
                I am unable to  link CSS with HTML
HTML working but CSS not working inside the .html file with the help of LINK in <head> tag 

I am using thefollowings:-
Setting.py -  STATICFILES_DIRS=[os.path.join(BASE_DIR, 'static'),]
HTML- {% load static %}
<Link rel="stylesheet" href="{% static 'css/syle.css %} />
 
Regards

course1.html

Aniket Balkhande

unread,
May 28, 2021, 4:09:48 PM5/28/21
to django...@googlegroups.com
Dear Sukhy Gill,

I think you should check the link.
The single inverted comma is missing here, 
<Link rel="stylesheet" href="{% static 'css/syle.css %} />

try this 
<Link rel="stylesheet" href="{% static 'css/syle.css' %} />

Thanks,
Aniket

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3ca2aba0-a58f-4298-b248-16c51bdf90a6n%40googlegroups.com.

Venu Gopal

unread,
May 29, 2021, 12:11:07 AM5/29/21
to django...@googlegroups.com
Hi, Have you tried deleting existing cache and cookies in the browser?

sukhy gill

unread,
May 29, 2021, 12:20:51 AM5/29/21
to django...@googlegroups.com
@Venu Gopal

No Sir, I don't know, how to do this.

May I know Sir, how to do the same?

Regards

You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/qGMoFXNAgww/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAOhYkiyqw8k5zCL1XZo9U%2BY9_JR57p55xf-%3DtFf6Fa4HVskPSw%40mail.gmail.com.

Venu Gopal

unread,
May 29, 2021, 1:19:59 AM5/29/21
to django...@googlegroups.com
In Firefox ---- Goto Preferences ---> Choose Privacy and Security ---> scroll down until you get cookies and site data --> clear data
Chrome ---- Goto Settings ---> Choose Privacy and Security ---> select cookies and other site data --> select see all cookies and site data --> Remove all

sukhy gill

unread,
May 29, 2021, 1:39:07 AM5/29/21
to django...@googlegroups.com

lalit suthar

unread,
May 29, 2021, 3:43:25 AM5/29/21
to Django users
have you checked Aniket's answer?

Chelsea Fan

unread,
May 29, 2021, 4:03:05 AM5/29/21
to django...@googlegroups.com
Style was wrong, you wrote syle, correct it

sukhy gill

unread,
May 29, 2021, 8:27:21 AM5/29/21
to django...@googlegroups.com
Yes Sir,There was no mistake in code. Code problem was only in mail content actually code was correct as instruction given by Aniket Sir

Regards


lalit suthar

unread,
May 29, 2021, 8:40:33 AM5/29/21
to Django users
read this https://docs.djangoproject.com/en/2.2/intro/tutorial06/ and check how you are giving paths. Also after loading the page on your browser go to "View Page Source" and click on the CSS file link and check if the file is opening or not.

Chelsea Fan

unread,
May 29, 2021, 8:59:58 AM5/29/21
to django...@googlegroups.com

sukhy gill

unread,
May 29, 2021, 9:04:50 AM5/29/21
to django...@googlegroups.com

Chelsea Fan

unread,
May 29, 2021, 9:07:23 AM5/29/21
to django...@googlegroups.com
Could you send me your settings.py and urls.py in project folder

sukhy gill

unread,
May 29, 2021, 9:22:28 AM5/29/21
to django...@googlegroups.com
urls.py
settings.py

Dev Burna

unread,
May 29, 2021, 9:46:19 AM5/29/21
to django...@googlegroups.com
How?????

Sent from my iPhone

On 28 May 2021, at 7:38 PM, sukhy gill <sukhy.g...@gmail.com> wrote:

Dear Frnds
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3ca2aba0-a58f-4298-b248-16c51bdf90a6n%40googlegroups.com.
<course1.html>

Fabiano Leite

unread,
May 29, 2021, 9:46:19 AM5/29/21
to Django users

Where is located your 'css/style.css';

sukhy gill

unread,
May 29, 2021, 11:14:48 AM5/29/21
to django...@googlegroups.com
Project Folder ➡️static ➡️css➡️style.css➡️

Mehdi Ismail

unread,
May 29, 2021, 11:52:57 AM5/29/21
to Django users
python manage.py collectstatic 


try that... and update

Chelsea Fan

unread,
May 29, 2021, 12:47:24 PM5/29/21
to django...@googlegroups.com
try to change settings 

STATIC_DIR = [
os.path.join(BASE_DIR,'static')
]

Natalie Smyth

unread,
May 29, 2021, 4:57:55 PM5/29/21
to django...@googlegroups.com
Did you name your css syle.css on purpose? If not you might just have a typo.

sukhy gill

unread,
May 29, 2021, 11:44:22 PM5/29/21
to django...@googlegroups.com
Getting error while using using command python manage.py collectstatic
Regarda

sukhy gill

unread,
May 29, 2021, 11:46:15 PM5/29/21
to django...@googlegroups.com
Done but not working
Regards

You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/qGMoFXNAgww/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJwZnddGgtyEE%2BHRxPAf%2BHb1FTxUgN9%3DOCOV%2BdLB%3DF2KH77Jiw%40mail.gmail.com.

Mehdi Ismail

unread,
May 30, 2021, 7:17:50 AM5/30/21
to Django users
you want to mention (provide screenshot) of the error?

Kasper Laudrup

unread,
May 30, 2021, 9:02:55 AM5/30/21
to django...@googlegroups.com
On 30/05/2021 05.43, sukhy gill wrote:
> Getting error while using using command python manage.py collectstatic
> Regarda
>

Try fixing the error and see if that makes the problem go away.

I know it's a long shot, but it's worth a try at least.

Kind regards,

Kasper Laudrup


> On Sat, May 29, 2021, 21:23 Mehdi Ismail <mehdiz...@gmail.com
> <mailto:mehdiz...@gmail.com> wrote:
>
> python manage.py collectstatic 
>
>
> try that... and update
> On Saturday, 29 May 2021 at 20:44:48 UTC+5:30 sukhy.g...@gmail.com
> <https://groups.google.com/d/msgid/django-users/3ca2aba0-a58f-4298-b248-16c51bdf90a6n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this
> message because you are
> subscribed to a topic in
> the Google Groups
> "Django users" group.
> To unsubscribe from this
> topic, visit
> https://groups.google.com/d/topic/django-users/qGMoFXNAgww/unsubscribe
> <https://groups.google.com/d/topic/django-users/qGMoFXNAgww/unsubscribe>.
> To unsubscribe from this
> group and all its
> topics, send an email to
> django-users...@googlegroups.com.
> To view this discussion
> on the web visit
> https://groups.google.com/d/msgid/django-users/CAOhYkiyqw8k5zCL1XZo9U%2BY9_JR57p55xf-%3DtFf6Fa4HVskPSw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAOhYkiyqw8k5zCL1XZo9U%2BY9_JR57p55xf-%3DtFf6Fa4HVskPSw%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> 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 view this discussion on
> the web visit
> https://groups.google.com/d/msgid/django-users/CAJ8btZave0utnYTAcrxafKes6sUZ3%2BX%2B0v1EGs-pJSF1%2BT4qxw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAJ8btZave0utnYTAcrxafKes6sUZ3%2BX%2B0v1EGs-pJSF1%2BT4qxw%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message
> because you are subscribed to a
> topic in the Google Groups
> "Django users" group.
> To unsubscribe from this topic,
> visit
> https://groups.google.com/d/topic/django-users/qGMoFXNAgww/unsubscribe
> <https://groups.google.com/d/topic/django-users/qGMoFXNAgww/unsubscribe>.
> To unsubscribe from this group
> and all its topics, send an
> email to
> django-users...@googlegroups.com.
>
> To view this discussion on the
> web visit
> https://groups.google.com/d/msgid/django-users/CAOhYkiy80sPnGJ2uJPuJODECKv3UfQxATOit%2BwNZnr%3D%2BgiuojQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAOhYkiy80sPnGJ2uJPuJODECKv3UfQxATOit%2BwNZnr%3D%2BgiuojQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you
> are subscribed to a topic in the Google
> Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/qGMoFXNAgww/unsubscribe
> <https://groups.google.com/d/topic/django-users/qGMoFXNAgww/unsubscribe>.
> To unsubscribe from this group and all
> its topics, send an email to
> django-users...@googlegroups.com.
>
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d9863d84-b712-4edd-bcd3-cb56e56d93e2n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/d9863d84-b712-4edd-bcd3-cb56e56d93e2n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/6270c1f5-a1d9-4904-a5ed-85e21030b894n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/6270c1f5-a1d9-4904-a5ed-85e21030b894n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed
> to a topic in the Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/qGMoFXNAgww/unsubscribe
> <https://groups.google.com/d/topic/django-users/qGMoFXNAgww/unsubscribe>.
> To unsubscribe from this group and all its topics,
> send an email to django-users...@googlegroups.com.
>
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJwZnde0ziuGc5LwbYDRLfHBqS6ywB8TaWN9T5VMy1swYGe%3DJw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAJwZnde0ziuGc5LwbYDRLfHBqS6ywB8TaWN9T5VMy1swYGe%3DJw%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to a
> topic in the Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/qGMoFXNAgww/unsubscribe
> <https://groups.google.com/d/topic/django-users/qGMoFXNAgww/unsubscribe>.
> To unsubscribe from this group and all its topics, send an
> email to django-users...@googlegroups.com.
>
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8c05a29d-9c98-4e74-9c2d-0bdc0245632en%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/8c05a29d-9c98-4e74-9c2d-0bdc0245632en%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to a topic in
> the Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/qGMoFXNAgww/unsubscribe
> <https://groups.google.com/d/topic/django-users/qGMoFXNAgww/unsubscribe>.
> To unsubscribe from this group and all its topics, send an email to
> django-users...@googlegroups.com
> <mailto:django-users...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/031a9c57-9317-4bc3-bd3d-7832347d4ffdn%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/031a9c57-9317-4bc3-bd3d-7832347d4ffdn%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> 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
> <mailto:django-users...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJ8btZb%2B5%3DCyd06Q_LXUw803OVFziLAcscJAbwqtyfttMzN6Tg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAJ8btZb%2B5%3DCyd06Q_LXUw803OVFziLAcscJAbwqtyfttMzN6Tg%40mail.gmail.com?utm_medium=email&utm_source=footer>.

OpenPGP_signature

sukhy gill

unread,
May 31, 2021, 11:32:10 AM5/31/21
to django...@googlegroups.com
I deleted my project and will start project again from begining and then will let you know the progress.
Regards

Chelsea Fan

unread,
May 31, 2021, 11:37:04 AM5/31/21
to django...@googlegroups.com

sukhy gill

unread,
May 31, 2021, 11:44:44 AM5/31/21
to django...@googlegroups.com
Thanku so much all of you for your valuable guidance to me 🙏🙏🙏🙂🙂

Chelsea Fan

unread,
May 31, 2021, 1:10:58 PM5/31/21
to django...@googlegroups.com

sukhy gill

unread,
Jun 2, 2021, 12:17:49 PM6/2/21
to django...@googlegroups.com
Dear  frnd, 
         I am getting stuck at same point with static with new project.
May I get setting for settings.py ?

Regards

On Sat, May 29, 2021, 18:29 Chelsea Fan <allaberdi...@gmail.com wrote:

Michael Thomas

unread,
Jun 2, 2021, 12:58:19 PM6/2/21
to django...@googlegroups.com
I'm guessing you're running a development server (manage.py runserver). I'd suggest solving this as a two step process:

1) Determine if the request for the static file is actually hitting the development server or not (eg. if you're running behind a reverse proxy)
2) Fire up your debugger and walk through the code

Django core and related apps (eg. staticfiles) is extremely well documented and easy to read. Walking through the code will get you to the source of the problem pretty quickly, and you'll probably learn a thing or two about how Django generally processes requests too, which is invaluable in the long run.

Kind Regards,
Michael Thomas

Robert Edward

unread,
Jun 2, 2021, 1:27:29 PM6/2/21
to django...@googlegroups.com
You are missing a closing (') when loading style.css

Robert Edward

unread,
Jun 2, 2021, 1:31:53 PM6/2/21
to django...@googlegroups.com
Plus is it 'syle' or 'style' 

sukhy gill

unread,
Jun 3, 2021, 4:06:28 AM6/3/21
to django...@googlegroups.com
Dear frnd
        First of all thanks to all for spare your valueable time for me.🙏🙏


 Now my Server is working and inline CSS also working but Internal and External CSS not working.
In my last project, image css was also working but now it is not working.

Another problem is "python manage.py collectstatic"  commd giving error.

My Whatsapp no is - 9493878322 ( Anyone may contact me through my whatsapp also if you feel so)

Regards



V. J

unread,
Jul 26, 2021, 10:25:31 AM7/26/21
to django...@googlegroups.com
Hello, I'm making a list of potential customers, in about two months, we will have a business plan ready and we will issue a digital token (ICO) based on our product in the company.  Would you be interested in learning more ...?

Dne čt 3. čvn 2021 10:06 uživatel sukhy gill <sukhy.g...@gmail.com> napsal:

Nikalesh Patil

unread,
Jul 26, 2021, 11:10:55 AM7/26/21
to django...@googlegroups.com
<Link rel="stylesheet" href="{% static 'css/syle.css' %}" />
Try it 

Baxtiyor Boboraximov

unread,
Jul 26, 2021, 12:35:51 PM7/26/21
to django...@googlegroups.com
hello . you must add to sittings.py  this code. 
STATIC_URL = '/static/'
STATICFILES_DIRS = (str(BASE_DIR.joinpath('static')),)

пт, 28 мая 2021 г. в 23:39, sukhy gill <sukhy.g...@gmail.com>:

Bradie Poa

unread,
Jul 27, 2021, 8:00:31 PM7/27/21
to django...@googlegroups.com

I still see an error with that code bro...


Baxtiyor Boboraximov

unread,
Jul 27, 2021, 11:32:02 PM7/27/21
to django...@googlegroups.com
if you want to solve this problem you must sendmi ful project  not html file.

Aashish Kumar

unread,
Jul 28, 2021, 5:55:07 AM7/28/21
to django...@googlegroups.com

Do hard refresh 

Ctrl + f5 

Vishal Raju Narikulam

unread,
Jul 28, 2021, 6:07:26 AM7/28/21
to django...@googlegroups.com

esteem learning center

unread,
Jul 28, 2021, 6:46:52 AM7/28/21
to django...@googlegroups.com
Check the spelling of your style

Reply all
Reply to author
Forward
0 new messages