Trained 3

Python focus interview (web articles)

Note: Only part of the calculation will answer scores, not counting the scores supplementary question.

I will answer the first part

Note: In addition to the fourth 4 points, other issues have 3 points each.

  1. Write commonly used bootstrap style.

    栅格系统
    <body>
        <div class="container">
            <div class="row">
                <div class="col-md-1>1</div>
                <div class="col-md-2>2</div>
                <div class="col-md-3>3</div>
                <div class="col-md-4>4</div>
                <div class="col-md-2>2</div>
            </div>
        </div>
    </body>
    
    表格
    
    <table class="table">
      ...
    </table>
    
    表单
    
    <form class="form-horizontal">
      <div class="form-group">
        <label for="inputEmail3" class="col-sm-2 control-label">Email</label>
        <div class="col-sm-10">
          <input type="email" class="form-control" id="inputEmail3" placeholder="Email">
        </div>
      </div>
      <div class="form-group">
        <label for="inputPassword3" class="col-sm-2 control-label">Password</label>
        <div class="col-sm-10">
          <input type="password" class="form-control" id="inputPassword3" placeholder="Password">
        </div>
      </div>
      <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
          <div class="checkbox">
            <label>
              <input type="checkbox"> Remember me
            </label>
          </div>
        </div>
      </div>
      <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
          <button type="submit" class="btn btn-default">Sign in</button>
        </div>
      </div>
    </form>
    
    按钮
    <!-- Standard button -->
    <button type="button" class="btn btn-default">(默认样式)Default</button>
    
    <!-- Provides extra visual weight and identifies the primary action in a set of buttons -->
    <button type="button" class="btn btn-primary">(首选项)Primary</button>
    
    <!-- Indicates a successful or positive action -->
    <button type="button" class="btn btn-success">(成功)Success</button>
    
    <!-- Contextual button for informational alert messages -->
    <button type="button" class="btn btn-info">(一般信息)Info</button>
    
    <!-- Indicates caution should be taken with this action -->
    <button type="button" class="btn btn-warning">(警告)Warning</button>
    
    <!-- Indicates a dangerous or potentially negative action -->
    <button type="button" class="btn btn-danger">(危险)Danger</button>
    
    <!-- Deemphasize a button by making it look like a link while maintaining button behavior -->
    <button type="button" class="btn btn-link">(链接)Link</button>
  2. What is a responsive layout?

    一个网站能够兼容多个终端——而不是为每个终端做一个特定的版本
  3. Send a request via ajax jQuery.

    $.ajax({
                'url':'/calc/',
                'type':'post',
                'data':{
                    'k1':$('[name="i1"]').val(),
                    'k2':$('[name="i2"]').val(),
                },
                success:function (ret) {
                   $('[name="i3"]').val(ret)
                }
            })
  4. JavaScript associated with this face questions (4 points)

    name = '老男孩';
    
    info = {
        name:'alex',
        age:123,
        func:function(){
            console.log(this.name);
        }
    }
    
    info.func() 
    
    老男孩
    name = '老男孩';
    
    info = {
        name:'alex',
        age:123,
        func:function(){
            console.log(this.name);
            function f1(){
                console.log(this.name);
            }
            f1()
        }
    }
    
    info.func() 
    老男孩 Alex
    name = '老男孩';
    
    info = {
        name:'alex',
        age:123,
        func:function(){
            console.log(this.name);
            (function(){
                console.log(this.name);
            })()
        }
    }
    
    info.func() 
    老男孩 老男孩
    name = '老男孩';
    
    info = {
        name:'alex',
        age:123,
        func:function(){
            console.log(this.name); 
            var xxx = this;
            (function(){
                console.log(xxx.name); 
            })()
        }
    }
    
    info.func() 
    老男孩 Alex
  5. What is cross-domain? How to solve?

    当一个请求url的协议、域名、端口三者之间任意一个与当前页面url不同即为跨域
    
    使用代理
  6. Http briefly your understanding of the agreement?

    http协议是一种应用层超文本传输协议  默认端口 80
    无状态: 每次请求都是独立的, 两个请求之间没有联系, 但是会引入 Cookie 和 Session 机制来关联请求
    无连接:服务端收到客户端请求后, 响应完成并收到客户端的应答之后, 立即断开连接
    
    HTTP连接7步骤
    1.建立tcp/ip连接 (3次握手)
    2.客户端向服务端发送HTTP请求
    3.客户端发送请求头信息,请求内容,最后会发送一行空白,表示客户端发送完毕
    4.服务器做出应答
    5.服务器向客户端发送应答头信息
    6.服务端发送应答头信息,应答内容,最后会发送一行空白,表示服务端发送完毕
    7.服务端关闭tcp连接(4次挥手)
    
  7. Description of your understanding of the Https protocol?

    默认端口号是 443
    
    客户端请求 https 连接, 服务器收到请求后会把证书信息(包含公钥和签名) 返回给客户端
    客户端会校验这个证书签名的有效性从而获取到公钥
    客户端随机生成会话密钥(对称加密), 然后利用证书里面的公钥将会话密钥加密, 连同加密后的内容传送给服务端
    服务器利用私钥解密出会话密钥, 然后解密出内容
    服务端利用会话密钥通信
    
    
  8. Listed common http request header and effect?

    Accept: 浏览器可以接受的 MIME 类型
    Accept-Encoding:浏览器支持的编码类型
    Accept-Language: 浏览器支持的语言
    Content-Length : 请求消息的正文长度
    Content-Type : 客户端接受服务器返回的文件类型
    User-Agent : 请求的用户信息, 浏览器类型
    Host : 给出接受请求的服务器主机名和端口号
    
    
  9. Listed common http request method and effect?

    GET 、POST 、HEAD、PUT、DELETE、OPTIONS
    
    GET: 可以说是最常见的了,它本质就是发送一个请求来取得服务器上的某一资源。资源通过一组HTTP头和呈现据(如HTML文本,或者图片或者视频等)返回给客户端。GET请求中,永远不会包含呈现数据。
    HEAD:HEAD和GET本质是一样的,区别在于HEAD不含有呈现数据,而仅仅是HTTP头信息。有的人可能觉得这个方法没什么用,其实不是这样的。想象一个业务情景:欲判断某个资源是否存在,我们通常使用GET,但这里用HEAD则意义更加明确。
    PUT:这个方法比较少见。HTML表单也不支持这个。本质上来讲, PUT和POST极为相似,都是向服务器发送数据,但它们之间有一个重要区别,PUT通常指定了资源的存放位置,而POST则没有,POST的数据存放位置由服务器自己决定。
    DELETE:删除某一个资源。基本上这个也很少见,不过还是有一些地方比如amazon的S3云服务里面就用的这个方法来删除资源。
    POST:向服务器提交数据。这个方法用途广泛,几乎目前所有的提交操作都是靠这个完成。
    OPTIONS:这个方法很有趣,但极少使用。它用于获取当前URL所支持的方法。若请求成功,则它会在HTTP头中包含一个名为“Allow”的头,值是所支持的方法,如“GET, POST”。
    
  10. Listed common http response status code.

    1xx : 临时响应, 需要请求者继续执行操作
    2xx: 成功处理了请求的状态码
    3xx : 如果要完成请求, 需要进一步操作, 重定向
    4xx : 请求出错
    5xx: 服务器内部错误
    
  11. http in connections:keep-alivethe role of head of the request?

    因为HTTP是无状态的,connections记录了个人信息,简单地说,当一个网页打开完成后,客户端和服务器之间用于传输HTTP数据的TCP连接不会关闭,如果客户端再次访问这个服务器上的网页,会继续使用这一条已经建立的TCP连接。但是Keep-Alive不会永久保持连接,它有一个保持时间,可以在不同的服务器软件(如Apache)中设定这个时间。
    
  12. django request lifecycle?

    客户端发送请求   经过中间件找到url
    根据请求URL在路由系统查询相应的视图函数
    视图函数根据调用数据库获取相应数据
    视图函数根据模板渲染生成页面
    返回客户端
    
  13. What is wsgi?

    WSGI的全称是Web Server Gateway Interface,翻译过来就是Web服务器网关接口。具体的来说,WSGI是一个规范,定义了Web服务器如何与Python应用程序进行交互,使得使用Python写的Web应用程序可以和Web服务器对接起来。WSGI一开始是在PEP-0333中定义的,最新版本是在Python的PEP-3333定义的。
    
    
  14. What is MVC? What is MTV?

     mvc
     1.模型层:  model     负责业务对象和数据库的对象(ORM)的映射
    
     2.视图层       views  负责与用户的交互(书写逻辑)
    
     3.控制器  Controller   完成用户对模型层和视图层调用,来完成用户的请求
    mtv
    
     1.模型层:  model     负责业务对象与数据库的对象(ORM)的映射
    
      2.模板层  Template   负责如何把页面展示给用户(html)
    
     3.视图层:  View    负责业务逻辑,并在适当的时候调用Model和Template
    
  15. django middleware, as well as the role of scenarios?

    作用:在request和response之间的一道处理过程,用于全局范围改变django输入和输出
    应用场景:比如博客园你需要登录才能发表博客,在你每次访问博客园或刷新的时候中间件判断你有没有登录,避免了每次刷新都要登录一遍 
    
  16. django of FBV and CBV What is the difference?

    • Then use the function in view FBV processing request
    • CBV then used in view of handling method
  17. How django orm in bulk create a data?

  18. How django execute native SQL?

  19. How django orm of data query id is not equal to 5.

  20. cookie and session difference?

    • cookie stored in the browser cache, close the browser to fail
    • session stored in the database, they do not delete, have been effective over the life of the set
  21. django orm in on_delete of the role?

    • cascade
    • When models.CASCADE Cascade delete the association table when the data deleted, the foreign key is also deleted
    • models.SET_NULL blanking association table when the data deletion, the foreign key blank, of course, you have to allow the foreign key field is empty, null = True
    • When models.SET_DEFAULT set defaults deleted, the foreign key field set to the default values, so the definition of the foreign key when the attention plus a default value.
  22. Description crm What are the features?

    • Public households turn private households (batch)
    • Turn public private households households (batch)
    • Create a class
    • Creating a course
    • Follow-up record
    • authority management
  23. crm what is male household? What is private households? Why do this distinction?

    • Male household is no follow-up sales, sales of private households is that there is follow-up
    • Because the sales person's time in the election do not know who has been selected over other sales, repeat selection
  24. Please list the CRM system tables.

    • Sector Table
    • user table
    • Customer table
    • Campus table
    • Class Table
    • Follow-up record table
    • Registration Form
    • Payment records table
    • Course record form
    • Learning record table
  25. When the data in the database for display, different field types have different display methods, what they are?

  26. Please tell us in detail how to use your company's sales of CRM.

  27. CRM technology which point there?

  28. Why not ready crm but to develop their own?

  29. Please briefly describe the implementation process of access control.

  30. How many tables list the permissions? Table has those fields?

  31. Why put the right information into the session? Right information into the session what advantages and disadvantages?

  32. Level access control to how the buttons are implemented?

  33. How to achieve the granularity of control rights to the data line?

The second part of the supplementary question

  1. Jsonp implementation mechanism is described in detail?
  2. How django orm generation of class models by data automation?
  3. django how to set the cache?
  4. Django role in signal?
  5. django how to set up separate read and write

Guess you like

Origin www.cnblogs.com/wangyu2850/p/12394652.html