· 7 years ago · Aug 25, 2018, 08:12 PM
1TemplateSyntaxError 'staticfiles' is not a valid tag library'
2'staticfiles' is not a valid tag library: Template library staticfiles not found, tried django.templatetags.staticfiles,django.contrib.admin.templatetags.staticfiles
3
4{% load staticfiles %}
5<html>
6 <head>
7 {% block stylesheets %}
8 <link rel="stylesheet" href="{% static "styles/bootstrap-1.2.0.min.css" %}">
9 {% endblock %}
10 <title>{% block title %}Tzibor{% endblock %}</title>
11 </head>
12 <body>
13 <h1>It Works!</h1>
14 {% block scripts %}
15 <script type="text/javascript" src="{% static "scripts/jquery-1.6.2.min.js" %}"></script>
16 {% endblock %}
17 </body>
18</html>
19
20DEBUG = True
21TEMPLATE_DEBUG = DEBUG
22
23ADMINS = (
24
25)
26
27MANAGERS = ADMINS
28
29DATABASES = {
30 'default': {
31 'ENGINE': 'django.db.backends.sqlite3',
32 'NAME': '/tmp/project.db',
33 'USER': '',
34 'PASSWORD': '',
35 'HOST': '',
36 'PORT': '',
37 }
38}
39
40TIME_ZONE = 'UTC'
41LANGUAGE_CODE = 'en-us'
42
43SITE_ID = 1
44
45USE_I18N = True
46USE_L10N = True
47MEDIA_ROOT = '' # abs fs path to upload dir
48MEDIA_URL = ''
49STATIC_URL = '/static/'
50
51ADMIN_MEDIA_PREFIX = '/media/'
52
53SECRET_KEY = '4qo&twl!=ty!n%1@h2nidz^ie@$^uu@*pz)(ol%ise0&g6*@&_'
54
55#TEMPLATE_CONTEXT_PROCESSORS = (
56# "django.contrib.auth.context_processors.auth",
57# "django.core.context_processors.debug",
58# "django.core.context_processors.i18n",
59# "django.core.context_processors.media",
60# "django.core.context_processors.static",
61# "django.contrib.messages.context_processors.messages",
62#)
63
64TEMPLATE_LOADERS = (
65 'django.template.loaders.filesystem.Loader',
66 'django.template.loaders.app_directories.Loader',
67 'django.template.loaders.eggs.Loader',
68)
69
70TEMPLATE_DIRS = (
71
72)
73
74MIDDLEWARE_CLASSES = (
75 'django.middleware.common.CommonMiddleware',
76 'django.contrib.sessions.middleware.SessionMiddleware',
77 'django.middleware.csrf.CsrfViewMiddleware',
78 'django.contrib.auth.middleware.AuthenticationMiddleware',
79 'django.contrib.messages.middleware.MessageMiddleware',
80)
81
82ROOT_URLCONF = 'project.urls'
83
84INSTALLED_APPS = (
85 'django.contrib.auth',
86 'django.contrib.contenttypes',
87 'django.contrib.sessions',
88 'django.contrib.sites',
89 'django.contrib.messages',
90 'django.contrib.admin',
91 'django.contrib.admindocs',
92 'django.contrib.staticfiles',
93 'project.web',
94 'south',
95)
96
97{% load static %}
98<img src="{% get_static_prefix %}images/hi.jpg" />