---
title: "django 返回自增长主键"
author: "2014马年"
date: "2016-04-06T12:18:31Z"
tags: []
categories: ["移动开发"]
slug: "django"
draft: false
lastmod: "2016-04-06T12:18:31Z"
id: 2288824
url: "https://20142014.iteye.com/blog/2288824"
---

定义model的时候使用

```
id = models.AutoField(primary_key=True)
```