From d5bc7d4ab2fba054c651bf69e05fdad1b60d1989 Mon Sep 17 00:00:00 2001 From: Maxim Kurnikov Date: Mon, 3 Dec 2018 18:45:48 +0300 Subject: [PATCH] update readme with installation and execution instructions --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index 139e483..0ee92bf 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,24 @@ [![Build Status](https://travis-ci.org/mkurnikov/django-stubs.svg?branch=master)](https://travis-ci.org/mkurnikov/django-stubs) [![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/) +This package contains type stubs and mypy plugin to provide more precise static types and type inference for Django framework. Django uses some Python "magic" that makes having precise types for some code patterns problematic. This is why we need to accompany the stubs with mypy plugins. The final goal is to be able to get precise types for most common patterns. + +## Installation + +``` +git clone https://github.com/mkurnikov/django-stubs.git +cd django-stubs +pip install -U . +``` + +To make mypy aware of the plugin, you need to add + +``` +[mypy] +plugins = + mypy_django_plugin.main +``` + +in your `mypy.ini` file. + +Also, it uses value of `DJANGO_SETTINGS_MODULE` from the environment, so set it before execution, otherwise some features will not work. \ No newline at end of file