这些是我的文件请告诉我我做错了什么或需要做什么改变
你知道吗设置.py你知道吗
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'assets')
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)
你知道吗索引.html你知道吗
{% load static %}
<link rel="stylesheet" type="text/css" href="{% static
'firstapp/style.css' %}"/>
<h1>Here are all Albums</h1>
{% if all_albums %}
<ul>
{% for album in all_albums %}
<li><a href="{% url 'firstapp:detail' album.id %}">{{ album.album_title }}</a> </li>
{% endfor %}
</ul>
{% else %}
<h1>No data found</h1>
{% endif %}
你知道吗样式.css你知道吗
body{
background: white url{"images/background.png"};
}
mysite/firstapp/网址.py你知道吗
app_name = 'firstapp'
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^(?P<album_id>[0-9]+)/$',views.detail, name='detail'),
url(r'^(?P<album_id>[0-9]+)/favorite/$', views.favorite, name='favorite'),
]
我的网站/我的网站/网址.py你知道吗
urlpatterns = [
url('admin/', admin.site.urls),
url(r'^firstapp/', include('firstapp.urls')),
]
目前没有回答
相关问题 更多 >
编程相关推荐