Skip to content

Commit

Permalink
writing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
eshaan7 committed Oct 25, 2020
1 parent e536588 commit 0057049
Show file tree
Hide file tree
Showing 34 changed files with 801 additions and 511 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"python.formatting.provider": "black",
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.linting.enabled": true
"python.linting.enabled": true,
"restructuredtext.confPath": "${workspaceFolder}/venv/lib/python3.8/site-packages/django/urls"
}
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- James McMahon
- Eshaan Bansal
- Shabda Raaj
- Matteo Lodi
23 changes: 4 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# django-rest-durin
# Django-Rest-Durin

[![django-rest-durin on pypi](https://img.shields.io/pypi/v/django-rest-durin)](https://pypi.org/project/django-rest-durin/)
[![Build Status](https://travis-ci.com/Eshaan7/django-rest-durin.svg?branch=main)](https://travis-ci.com/Eshaan7/django-rest-durin)
Expand All @@ -16,29 +16,14 @@ Durin authentication is token based, similar to the `TokenAuthentication`
built in to DRF. However, it adds some extra sauce:

- Durin allows multiple tokens per user. But only one token each user per API client.

- Each user token is associated with an API Client. These API Clients are configurable via Django's Admin Interface.

- All Durin tokens have an expiration time. This expiration time can be different per API client.

- Durin provides an option for a logged in user to remove *all*
tokens that the server has - forcing him/her to re-authenticate for all API clients.

- Durin tokens can be renewed to get a fresh expiry.
- Durin provides a `CachedTokenAuthentication` backend as well which uses memoization for faster look ups.

- Durin provides a [Cached Token Authentication](#cache-backend) backend as well.

More information can be found in the [Documentation]()

## Cache Backend

If you want to use a cache for the session store, you can install [django-memoize](https://pythonhosted.org/django-memoize/) and add `'memoize'` to `INSTALLED_APPS`.

Then you need to use ``CachedTokenAuthentication`` instead of ``TokenAuthentication``.

```bash
pip install django-memoize
```
More information can be found in the [Documentation](https://django-rest-durin.readthedocs.io/).

## Django Compatibility Matrix

Expand All @@ -62,4 +47,4 @@ This project is published with the [MIT License](LICENSE). See [https://chooseal

## Credits

Durin is inpired by the [django-rest-knox](https://github.com/James1345/django-rest-knox) and [django-rest-multitokenauth](https://github.com/anexia-it/django-rest-multitokenauth) libraries and includes some learnings and code from both.
Durin is inpired by the [django-rest-knox](https://github.com/James1345/django-rest-knox) and [django-rest-multitokenauth](https://github.com/anexia-it/django-rest-multitokenauth) libraries and includes some learnings, docs and code from both.
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
108 changes: 0 additions & 108 deletions docs/auth.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/changelog.md

This file was deleted.

31 changes: 0 additions & 31 deletions docs/index.md

This file was deleted.

66 changes: 0 additions & 66 deletions docs/installation.md

This file was deleted.

35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
11 changes: 11 additions & 0 deletions docs/requirements.docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
../requirements.dev.txt
commonmark==0.9.1
docutils==0.16
Sphinx==3.2.1
sphinx-rtd-theme
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==1.0.3
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.4
4 changes: 4 additions & 0 deletions docs/serve_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
export DJANGO_SETTINGS_MODULE="example_project.settings"
make html
cd build/html && python3 -m http.server 6969 && cd ../../
Loading

0 comments on commit 0057049

Please sign in to comment.