如何更改pinax(0.9a2)模板?【JAVA教程】

!
也想出现在这里? 联系我们
信息

如何更改pinax(0.9a2)模板?,第1张

概述如何更改pinax(0.9a2)模板

我已经安装pinax(0.9a2)pinax-bootstrap主题!

现在我想定制它并重新devise主题,但是我没有在我的模板文件夹中find任何* .CSS文件。 因此如何自定义引导主题的CSS?

使用mod_wsgi在Apache上部署多个django应用程序

将计算密集的请求处理到Django Web应用程序,可能使用预分配RPC服务器

Django减less模板渲染时间

套接字错误“IP地址在其上下文中无效” – Python

Nginx / uwsgi不提供任何请求

所以这就是我如何得到我的基本pinax项目运行:

mkvirtualenv -p python2.7 –distribute mysite cd ~/work pinax-admin setup_project -b basic mysite cd mysite pip install -r requirements/base.txt python manage.py collectstatic python manage.py syncdb python manage.py runserver 8001

这给了我这个: –

现在,我的pinax默认运行在引导主题上,我可以继续使用CSS覆盖来自定义我的主题。

由于我的pinax settings.py指向

# Additional directorIEs which hold static files STATICfileS_Dirs = [ os.path.join(PROJECT_ROOT,\”static\”),]

我们将把所有的CSS文件放在我们的项目根目录“mysite”下的静态目录中。

CSS覆盖的工作,我们自己的自定义CSS文件加载后引导的CSS加载到我们的模板。

我们特定的CSS类和它的新定义将覆盖bootstrap提供的默认值。 这就是我们如何定制我们的引导主题,同时保留bootstrap.CSS,这就是为什么我们的static目录在开始时是空的。

例如,我们有默认情况下在bootstrap.min.CSS定义的topbar类。

.topbar-inner,.topbar .fill { background-color: #222; … }

我们可以在static目录中指定我们自己的CSS文件,在我们的templates/site_base.HTML文件中加载这个CSS文件,并在我们自己的CSS文件中为顶部条指定一个新的颜色,如下所示:

.topbar-inner,.topbar .fill { background-color: red; background-image: -webkit-linear-gradIEnt(top,#333,#FF4242); background-image: -o-linear-gradIEnt(top,#FF4242); background-image: linear-gradIEnt(top,#FF4242); }

这将导致我们的主页上的黑色顶部栏呈现为黑色。 这是使用覆盖来定制我们的CSS类的基本前提,其默认值已经在bootstrap.min.CSS中定义了。

在mysite/templates/homepage.HTML修改示例

{% extends \”banner_base.HTML\” %} {% load i18n %} {% block extra_head %} <link rel=\”stylesheet\” href=\”{{ STATIC_URL }}CSS/my_custom_stuff.CSS\”> {% endblock %} {% block head_Title %}{% trans \”Welcome\” %}{% endblock %} {% block body_class %}home{% endblock %} {% block banner %} <h1>{% trans \”Welcome to Pinax\” %}</h1> <p> {% blocktrans %} <b>Pinax</b> is a <a href=\”http://djangoproject.com/\”>Django</a> project intended to provIDe a starting point for websites. By integrating numerous reusable Django apps to take care of the things that many sites have in common,it lets you focus on what makes your site different. {% endblocktrans %} </p> <h2>About Zero Project</h2> <p> {% blocktrans %} This project lays the foundation for all other Pinax starter projects. It provIDes the project directory layout and some key infrastructure apps on which the other starter projects are based. {% endblocktrans %} </p> <p><a href=\”http://pinaxproject.com/\” >{% trans \”Learn more &raquo;\” %}</a></p> {% endblock %}

添加的特定块是

{% block extra_head %} <link rel=\”stylesheet\” href=\”{{ STATIC_URL }}CSS/my_custom_stuff.CSS\”> {% endblock %}

请注意,我们也可以将其添加到mysite/templates/site_base.HTML 。 这一切都取决于你想在我们的my_custom_stuff.CSS文件中加载哪个模板。

my_custom_stuff.CSS需要驻留在mysite/static/CSS目录下。

总结

以上是内存溢出为你收集整理的如何更改pinax(0.9a2)模板?全部内容,希望文章能够帮你解决如何更改pinax(0.9a2)模板?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

© 版权声明
THE END
喜欢就支持一下吧
点赞136 分享
评论 抢沙发

请登录后发表评论

    请登录后查看评论内容