Jonathan Cheng
Jonathan Cheng

Reputation: 479

Import css in Django

I use django1.10

i reference the official doc https://docs.djangoproject.com/en/1.10/intro/tutorial06/

my project name:mysite

structure:

add

{% load staticfiles % } <link rel="stylesheet" text = 'html/css' href="{% static 'mysite/static/main.css' %}" />

it said i have a Invalid block tag about TemplateSyntaxError <link rel="stylesheet" type = 'text/css' href="{% static 'mysite/static/assets/css/main.css' %}" />

views.py (about static files part) STATICFILES_DIRS = [ os.path.join(BASE_DIR, "static"), '/mysite/static/', ] STATIC_URL = '/static/' STATIC_ROOT='/mysite/static/'

what's part should i notice?

Upvotes: 0

Views: 2429

Answers (1)

A.H
A.H

Reputation: 62

Hi dear try to make python manage.py collectstatic... hope it solves your problem 😊

Upvotes: 1

Related Questions