Francis'Blog

加油!奋斗!奥里给!


  • Home

  • Categories

  • About

  • Archives

  • Search

django-vuejs-api-views

Posted on 2019-01-02 | In Django

Translation Table

English Chinese
front-end 前端
back-end 后端
pagination 分页
tweaking 拧(这里应该是修改的意思)
queries 查询
Decimal 十进制
querysets 查询集

Building a Modern Web Application with Django REST Framework and Vue: Building Views and REST API

Throughout this part of these tutorial series you will continue developing a CRUD (Create, Read, Update and Delete) application with a restful API back-end and a Vue front-end using Django, Django REST framework and Vue (with Axios as an HTTP client). In this part you’ll specifically build the REST API and the front-end views to consume and display data from the API endpoints. You will also see how to integrate your Vue application with your Django back-end in production. As always you can find the source code of the demo project in this Github repository.

You can check the second article from this link

  • Building the REST API: You will create a simple REST API around one model (Product) with DRF(Django REST Framework) and learn how to add pagination to your APIs.
  • Creating the Service to Consume the API: You will create the class that interfaces with your API using Axios.
  • Creating the Front End Views: You will create different views and routes for the Vue application and see how you can protect some routes from non authenticated users.
  • Getting Ready for Production: Finally you’ll prepare your app for production by tweaking some settings in Vue and Django parts.

Building the REST API

Django REST framework is a powerful and easy to use package for building Web APIs.

Let’s get started by building a simple REST API using Django REST framework.

Read more »

正则化方法小结

Posted on 2018-12-31 | In 机器学习

在总结正则化(Regularization)之前,我们先谈一谈正则化是什么,为什么要正则化。

个人认为正则化这个字眼有点太过抽象和宽泛,其实正则化的本质很简单,就是对某一问题加以先验的限制或约束以达到某种特定目的的一种手段或操作。在算法中使用正则化的目的是防止模型出现过拟合。一提到正则化,很多同学可能马上会想到常用的L1范数和L2范数,在汇总之前,我们先看下LP范数是什么鬼。

LP范数

范数简单可以理解为用来表征向量空间中的距离,而距离的定义很抽象,只要满足非负、自反、三角不等式就可以称之为距离。

LP范数不是一个范数,而是一组范数,其定义如下:

1

p的范围是[1, +∞],p在(0,1)范围内定义的并不是范数,因为违反了三角不等式。

Read more »

十大经典排序算法动画与解析

Posted on 2018-12-26 | In Alg

排序算法是《数据结构与算法》中最基本的算法之一

排序算法可以分为内部排序和外部排序。

内部排序是数据记录在内存中进行排序。

而外部排序是因排序的数据很大,一次不能容纳全部的排序记录,在排序过程中需要访问外存。

常见的内部排序算法有:插入排序、希尔排序、选择排序、冒泡排序、归并排序、快速排序、堆排序、基数排序等。

用一张图概括:

640

Read more »
1…8910…12
Francis Cheng

Francis Cheng

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

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