进口甲类纯功放机功放机有什么音质好的吗?

1713人阅读
django(9)
原文:http://wangye.org/blog/archives/572/
配置Django Admin,关于如何启用请参考Django官方文档。但是我在配置过程中登录/admin后台时出现样式表丢失的问题,比如说界面变成了这样:
上网搜索了不少文档,多是Apache环境下的解决方案,我配置的是Nginx服务器,所以根据Apache的解决提示进而摸索办法,最终要解决这个问题我这里总结有3步(假设已经配置好admin登录系统):
1. 修改settings.py中STATIC_ROOT为你的static静态文件的物理路径,比如说我静态文件存放在/home/user/www/static中,首先创建www目录下的static文件夹,最后修改settings.py中STATIC_ROOT指向/home/user/www/static。
2. 运行python manage.py collectstatic命令,这将从Django资源包中复制必须的静态文件到STATIC_ROOT指示的static文件夹中,这其中包括admin界面所必须的样式表(style)、图片(image)及脚本(js)等。
这里提示一下,假如不做第1步的话,直接运行这个命令会导致如下的错误提示(最后几行):
File &/usr/lib/python2.7/dist-packages/django/contrib/staticfiles/management/commands/collectstatic.py&, line 41, in __init__
self.storage = get_storage_class(settings.STATICFILES_STORAGE)()
File &/usr/lib/python2.7/dist-packages/django/contrib/staticfiles/storage.py&, line 23, in __init__
raise ImproperlyConfigured(&You're using the staticfiles app &
django.core.exceptions.ImproperlyConfigured: You're using the staticfiles app without having set the STATIC_ROOT setting.
其实已经提示需要配置STATIC_ROOT文件了(You’re using the staticfiles app without having set the STATIC_ROOT setting)。
3. 修改Nginx配置,Debian系统下/etc/nginx/nginx.conf或者/etc/nginx/sites-enabled/里面的配置文件,在server节中添加如下内容(请根据实际情况修改):
# ... 其余内容略
location /static {
root /home/user/
此处不修改的话,我测试下来结果貌似默认处理会交由Django,但是依旧会由Django提示Page not found (404)。
完成上面三步后,重新加载相应设置:
invoke-rc.d uwsgi reload
nginx -s reload
好了,基本上问题算是解决了,如果有什么不当的地方欢迎指出。
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:588125次
积分:6655
积分:6655
排名:第2752名
原创:103篇
转载:56篇
译文:10篇
评论:35条
(2)(9)(1)(3)(3)(3)(3)(5)(5)(3)(1)(3)(3)(6)(9)(2)(5)(3)(1)(7)(6)(14)(15)(3)(3)(4)(4)(4)(4)(5)(4)(4)(11)(2)(5)(2)(4)(3)(2)(4)(1)(3)(3)(3)你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
模板文件:
&!DOCTYPE html>
&html lang=&zh-CN&>
&meta charset=&utf-8&>
&title>事事网&/title>
&meta content=&width=device-width, initial-scale=1.0& name=&viewport&>
&meta content=&& name=&description&>
&meta content=&& name=&author&>
&!-- Le styles -->
&link rel=&stylesheet& href=&;>
&style type=&text/css&>
padding-top: 20
padding-bottom: 40
/* Custom container */
.container-narrow {
max-width: 1000
.container-narrow & hr {
margin: 30px 0;
/* Main marketing message and sign up button */
.jumbotron {
margin: 60px 0;
text-align:
.jumbotron h1 {
font-size: 72
line-height: 1;
.jumbotron .btn {
font-size: 21
padding: 14px 24
/* Supporting marketing content */
.marketing {
margin: 30px 0;
.marketing p + h4 {
margin-top: 28
&link rel=&stylesheet& href=&;>
&!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
&!--[if lt IE 9]>
&script src=&../assets/js/html5shiv.js&>&/script>
&![endif]-->
&!-- Fav and touch icons -->
&link href=&../assets/ico/apple-touch-icon-144-precomposed.png& sizes=&144x144& rel=&apple-touch-icon-precomposed&>
&link href=&../assets/ico/apple-touch-icon-114-precomposed.png& sizes=&114x114& rel=&apple-touch-icon-precomposed&>
&link href=&../assets/ico/apple-touch-icon-72-precomposed.png& sizes=&72x72& rel=&apple-touch-icon-precomposed&>
&link href=&../assets/ico/apple-touch-icon-57-precomposed.png& rel=&apple-touch-icon-precomposed&>
&link href=&../assets/ico/favicon.png& rel=&shortcut icon&>
&div class=&container-narrow&>
&div class=&masthead&>
&ul class=&nav nav-pills pull-right&>
&li>&a href=&;>火狐主页&/a>&/li>
&li>&a href=&;>火狐社区&/a>&/li>
&li>&a href=&;>下载火狐浏览器&/a>&/li>
&li>&input type=&text& class=&span2&>&/li>
&li>&nbsp&nbsp&nbsp&/li>
&li>&button type=&submit& class=&btn&>百度一下&/button>&/li>
&h3 class=&muted&>事事网&/h3>
&a title=&Apple Watch& href=&;>
&img src=&;>
&ul class=&nav nav-tabs&>
&li class=&active&>&a href=&#& data-toggle=&tab&>焦点&/a>&/li>
&li>&a href=&#about& data-toggle=&tab&>国内&/a>&/li>
&li>&a href=&#contact& data-toggle=&tab&>国际&/a>&/li>
&li>&a href=&#contact& data-toggle=&tab&>军事&/a>&/li>
&li>&a href=&#contact& data-toggle=&tab&>法治&/a>&/li>
&li>&a href=&#contact& data-toggle=&tab&>图片&/a>&/li>
&li>&a href=&#contact& data-toggle=&tab&>社会&/a>&/li>
&li>&a href=&#contact& data-toggle=&tab&>八卦&/a>&/li>
&li>&a href=&#contact& data-toggle=&tab&>体育&/a>&/li>
&li>&a href=&#contact& data-toggle=&tab&>科技&/a>&/li>
&li>&a href=&#contact& data-toggle=&tab&>财经&/a>&/li>
&li>&a href=&#contact& data-toggle=&tab&>时尚&/a>&/li>
&li>&a href=&#contact& data-toggle=&tab&>汽车&/a>&/li>
&li>&a href=&#contact& data-toggle=&tab&>视频&/a>&/li>
&div style=&background-color: #eeeeee&>
&h4 align=&center&>{{ detail.title }}&/h4>
{{ detail.detail }}
&p>你好&/p>
&div class=&footer&>
&p>& Company 2013&/p>
&!-- Bootstrap core JavaScript
================================================== -->
&!-- Placed at the end of the document so the pages load faster -->
&script src=&;>&/script>
&script src=&;>&/script>
视图函数:
def news_detail(request):
article = {}
article['title']='nihao'
article['detail'] = '&p> nihao &/p>'
return render_to_response('test.html', {'detail': article})
显示是这个样子的。
如图片所示
要回复问题请先或
浏览: 1581
关注: 1 人

我要回帖

更多关于 进口发烧甲类功放机 的文章

 

随机推荐