Francis'Blog

加油!奋斗!奥里给!


  • Home

  • Categories

  • About

  • Archives

  • Search

Django流程

Posted on 2018-12-04 | In Django

创建项目

1
Django-admin startproject mysite

注意:路径中不要带有中文

层级目录说明

1

manage.py 一个命令行工具,可以让我们用多种方式对Django项目进行交互
__init__.py 一个空文件,它告诉Python这个目录应该被看做一个包
settings.py 项目的配置文件(主要处理文件)
urls.py 项目的url声明 (主要处理文件)
wsgi.py 项目与WSGI兼容的Web服务器入口

配置数据库(mysql)

在Django中,默认使用 SQLite数据库,在settings.py文件中通过DATABASES选项进行数据库配置。

配置mysql

1.在mysite/__init__.py中写入两行代码

1
2
import mysql
mysql.install_as_MySQLdb()

2.在settings.py中对DATABASES进行配置

1
2
3
4
5
6
7
8
9
10
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': "my_site",
'USER': "root",
'PASSWORD': "m",
'HOST': "localhost",
'PORT': "3306"
}
}
Read more »

tf.strided_slice

Posted on 2018-11-27 | In TensorFlow

tf.strided_slice其实就是TensorFlow中用来分片的函数。

1
2
3
4
5
6
7
8
9
10
11
def strided_slice(input_,
begin,
end,
strides=None,
begin_mask=0,
end_mask=0,
ellipsis_mask=0,
new_axis_mask=0,
shrink_axis_mask=0,
var=None,
name=None):

begin是分片开始, end是分片结束,strides是步长,注意这边的步长其实是从步长的最后一位开始的

Read more »

HTML5

Posted on 2018-11-22 | In HTML

HTML Attributes

Attribute Description
alt Specifies an alternative text for an image, when the image cannot be displayed 图片无法显示时候提示是怎么样的图片
disabled Specifies that an input element should be disabled
href Specifies the URL (web address) for a link
id Specifies a unique id for an element
src Specifies the URL (web address) for an image 也就是图片的source
style Specifies an inline CSS style for an element
title Specifies extra information about an element (displayed as a tool tip) 鼠标停留时显示的字样
width, height 图片的宽和高

HTML Horizontal Rules 标签水平

The <hr> tag defines a thematic break in an HTML page, and is most often displayed as a horizontal rule.

The <hr> element is used to separate content (or define a change) in an HTML page:

1
2
3
4
5
6
<h1>This is heading 1</h1>
<p>This is some text.</p>
<hr>
<h2>This is heading 2</h2>
<p>This is some other text.</p>
<hr>
Read more »
1…9101112
Francis Cheng

Francis Cheng

很惭愧,就做了一点微小的工作。

35 posts
14 categories
16 tags
© 2019 Francis Cheng
Powered by Hexo
Theme - NexT.Gemini