django css_在应用程序上实现CSS Django的

django css

CSS (Cascade Style Sheets) are used to implement design.

CSS(级联样式表)用于实现设计。

Step 1: Create a Sandbox, Activate it, Install Django and Create Sample Project

步骤1:创建一个沙箱,将其激活,安装Django并创建示例项目

Creating Sandbox

创建沙箱

Django | Implement CSS on an app 1

Activating it

激活它

Django | Implement CSS on an app 2

Installing Django

安装Django

Django | Implement CSS on an app 3

Creating Sample Project [myapp]

创建示例项目[myapp]

Django | Implement CSS on an app 4

Project Structure [myapp]

项目结构[myapp]

Django | Implement CSS on an app 5

Step 2: Add a new folder (i.e. static) in root location (i.e. myapp folder[outer])

步骤2:在根目录(即myapp文件夹[外部])中添加一个新文件夹(即静态)

Django | Implement CSS on an app 6

Step 3: Now go to https://getbootstrap.com/docs/3.3/ and download bootstrap files. I am using bootstrap CSS to style myapp

步骤3:现在转到https://getbootstrap.com/docs/3.3/并下载引导程序文件。 我正在使用Bootstrap CSS样式化myapp

Django | Implement CSS on an app 7

Step 4: Add bootstrap files to static folder

步骤4:将引导文件添加到静态文件夹

Django | Implement CSS on an app 8

Step 5: Add site.css (my own css) to static folder

步骤5:将site.css(我自己的css)添加到静态文件夹

Django | Implement CSS on an app 9
Django | Implement CSS on an app 10

Step 6: Add static folder path to settings.pyof admin app (i.e. myapp[inner])

步骤6:将静态文件夹路径添加到settings.pyof管理应用程序(即myapp [inner])

Django | Implement CSS on an app 11
Django | Implement CSS on an app 12

Step 7: Add a new folder templates for HTML Templates in project folder (i.e. myapp[outer])

步骤7:在项目文件夹(即myapp [outer])中为HTML模板添加新的文件夹模板

Django | Implement CSS on an app 13

Step 8: Add templates location to setting.py in admin app (i.emyapp[inner])

步骤8:在管理应用程式(i.emyapp [inner])中将范本位置新增至setting.py

Django | Implement CSS on an app 14
Django | Implement CSS on an app 15

Step 9: Add a master page (base.html) in templates folder

步骤9:在模板文件夹中添加母版页(base.html)

Django | Implement CSS on an app 16

Sections of Head Tag of base.html

base.html标题标签的部分

Django | Implement CSS on an app 17

Sections of Body Tag of base.html

base.html身体标签部分

Django | Implement CSS on an app 18
Django | Implement CSS on an app 19

Step 10: Now Add child pages (i.e. index.html, home.html etc)

步骤10:现在添加子页面(即index.html,home.html等)

Django | Implement CSS on an app 20

Index.html

Index.html

Django | Implement CSS on an app 21

Home.html

Home.html

Django | Implement CSS on an app 22

About.html

About.html

Django | Implement CSS on an app 23

Contact.html

Contact.html

Django | Implement CSS on an app 24

Gallary.html

Gallary.html

Django | Implement CSS on an app 25

Feedback.html

Feedback.html

Django | Implement CSS on an app 26

Register.html

Register.html

Django | Implement CSS on an app 27

Login.html

Login.html

Django | Implement CSS on an app 28

Step 11: Add a controller file (views.py) to manage views in admin app (i.e. myapp[inner])

步骤11:添加控制器文件(views.py)以管理管理应用程序中的视图(即myapp [inner])

Django | Implement CSS on an app 29

Step 12: Add controller actions (functions) to views.py to manage requests.

步骤12:将控制器动作(功能)添加到views.py以管理请求。

Django | Implement CSS on an app 30

Step 13: Add new url to urls.py in admin app (i.e. myapp[inner])

第13步:在管理应用程序(即myapp [inner])中将新的url添加到urls.py中

Django | Implement CSS on an app 31
Django | Implement CSS on an app 32

Step 14: Run the Server

步骤14:运行服务器

Django | Implement CSS on an app 33
Django | Implement CSS on an app 34

Step 15: Open Browser and type http://127.0.0.1:8000

步骤15:打开浏览器并输入http://127.0.0.1:8000

Django | Implement CSS on an app 35

翻译自: https://www.includehelp.com/Django/implement-css-on-an-app.aspx

django css

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/540916.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

PHPWeb开发入门体验学习笔记

PHPWeb开发入门体验学习笔记4一、PHP web应用开发须知1.入门要点程序员三个阶段:码农(速成技能)->工程师(长期知识)->专家(研究论文)编程三要素:声明变量(系统、全…

vb mysql 表格显示,在VB中编辑数据库和电子表格

在VB50中有很多功能强大的控件,其中数据控件与一些绑定控件(如文本框,图片框及 ActiveX控件)的相互协作,能够方便地实现对各种数据库记录、表格乃至电子表格的浏览和编辑操作。下面介绍实例,其中数据控件用于记录的浏览、移动、…

c# datetime._C#| DateTime.AddTicks()方法与示例

c# datetime.DateTime.AddTicks()方法 (DateTime.AddTicks() Method) DateTime.AddTicks() method is used to return a new date-time object that adds ticks value of this instance. This object does not change the original value of date-time but it returns an objec…

12345组成三个不重复数java,求大神帮忙!五子棋!只能识别按顺序识别!例如 12345 不能...

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼import java.util.Arrays;import java.util.Scanner;public class Gobang {public static void main(String[] args) {Scanner sc new Scanner(System.in);boolean finish false;// 有戏是否结束int flagNum 1;// 当前下棋者标记…

[转]Visual Studio 各版本下载

原文地址:[置顶] Visual Studio 各版本下载 文件名称文件大小百度网盘下载微软官方下载Visual Studio 2015 Enterprise - 企业版 - 简体中文3.89GBhttp://pan.baidu.com/s/1bnAY68Bvs2015.ent_chs.isoVisual Studio 2015 Professional - 专业版 - 简体中文3.84GBht…

JavaScript中的“ this”关键字

JavaScriptthis关键字 (JavaScript this keyword) The this keyword is widely used in JavaScript. It has many use cases and is also one of the most intimidating features of JavaScript. In most of the programming languages, this is used to refer to the current …

oracle 列级外键,Oracle外键列上是否需要索引?

外键列上缺少索引会带来两个问题,限制并发性、影响性能。而这两个问题中的任意一个都可能会造成严重性能问题。 无论是Or外键列上缺少索引会带来两个问题,限制并发性、影响性能。而这两个问题中的任意一个都可能会造成严重性能问题。无论是Oracle的官方文…

python 改变词典顺序_按词典顺序排列的功率集

python 改变词典顺序Description: 描述: This is a standard interview problem to find out the power sets in lexicographic order of a given set of numbers using backtracking. 这是一个标准的面试问题,它使用回溯来按给定数字集的字典顺序查找能…

oracle创建用户名了,oracle创建用户名

创建用户//创建用户名create user username identified by password‘’//赋权限Grant Connect,Resource,DBA to UserName;plsql developer配置下载地址http://ah1.down.chinaz.com/201011/plsql8.04cn.zip右击"我的电脑" - "属性" - "高级" - &…

webpack学习笔记1

webpack学习笔记1:基本概念 前言: 现在在日常的开发中,webpack已经是必不可少的东西了,现在的需求基本都是用webpack对资源进行打包整合,所以打算写一点关于webpack的东西,这是第一篇,主要是介绍…

ruby 嵌套函数_Ruby嵌套有示例的循环

ruby 嵌套函数嵌套循环 (Nested for loop) Nesting of for loop means one for loop is available inside another for loop. It means that there are two loops, then the first one is an outer loop and the second one is the inner loop. Execution will take place in t…

oracle10数据库链接失败,Oracle10g出现Enterprise Manager 无法连接到数据库实例解决办法...

刚装好 10g 时,把的监听端口是1521.后来把端口改成了1568了,登上em发现Enterprise Manager 无法连接到数据库实例 ,连接字符串的端口仍是1521,如何解决这个问题。登陆:出现下面错误:Enterprise …

springJdbc in 查询,Spring namedParameterJdbcTemplate in查询

springJdbc in 查询,Spring namedParameterJdbcTemplate in查询, SpringJdbc命名参数in查询,namedParameterJdbcTemplate in查询 >>>>>>>>>>>>>>>>>>>>>>>>>>…

oracle 11g r2版本号,Oracle 11g r2新增版本功能(二)

在11.2中,Oracle数据库引入的版本的概念,这为应用程序的升级提供了极大的方便。这篇简单描述版本的实现和查询方式。前一篇简单描述了版本,下面接着上面的例子看看Oracle是如何实现这个功能的:SQL> select synonym_name, table…

python 添加图例_Python | 在图例标签中添加Sigma

python 添加图例Sigma (𝜎) is very often used greek mathematical letters and has a higher repetition in probability. In this article, we are going to add 𝜎 using a command in matplotlib. Sigma(𝜎)是希腊数学字母中经常使用的字…

【51CTO学院】搜索V2.0——新的搜索,只为给你更好的

为了让你能快速、准确的找到自己心仪的内容,51CTO学院产品及研发用尽了洪荒之力研发近2个月终于将搜索进行了全面升级。 搜索看似简单,实则要做到精准和智能却不是件易事,为了让学员快速找到自己所需,节省找课时间,更高…

oracle扩容日志文件,ORACLE 加大日志文件

--新建临时日志文件alter database add logfile group 4 (‘/u01/app/oracle/oradata/orcl/redo04.log‘) size 10m;alter database add logfile group 5 (‘/u01/app/oracle/oradata/orcl/redo05.log‘) size 10m;alter database add logfile group 6 (‘/u01/app/oracle/orad…

java多线程总结(二)

线程一般有6个状态: 新建状态:NEW 可运行状态:RUNNABLE 休眠状态:TIMED_WAITING 等待状态:WAITING 阻塞状态:BLOCKED 终止状态“TERMINATED 当我们使用new创建线程之后,线程处于新建状态,当调用…

scandir函数_PHP scandir()函数与示例

scandir函数PHP scandir()函数 (PHP scandir() function) The full form of scandir is "Scan Directory", the function scandir() is used to get the list of the files and directories available in the specified directory. scandir的完整格式为“ Scan Direc…

韩顺平.2011最新版.玩转oracle视频教程笔记,韩顺平.2011最新版.玩转oracle视频教程(笔记)...

韩顺平.2011最新版.玩转oracle视频教程ORA-01045: user XIAOMING lacks CREATE SESSION privilege; logon denied 警告: 您不再连接到 ORACLE。 SQL> show user; USER 为 ""SQL> conn system/p; 已连接。SQL> grant connect to xiaoming; 授权成功。SQL>…