Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Python 100 Days | 135,076 | a month ago | 682 | Python | ||||||
Python - 100天从新手到大师 | ||||||||||
Django Rest Framework | 25,649 | 24,595 | 1,508 | 2 days ago | 134 | December 15, 2021 | 132 | other | Python | |
Web APIs for Django. 🎸 | ||||||||||
Awesome Django | 7,045 | 2 days ago | 2 | cc0-1.0 | HTML | |||||
A curated list of awesome things related to Django | ||||||||||
Drf Yasg | 3,092 | 290 | 76 | 16 days ago | 59 | October 25, 2020 | 235 | other | Python | |
Automated generation of real Swagger/OpenAPI 2.0 schemas from Django REST Framework code. | ||||||||||
Django Rest Swagger | 2,516 | 2,031 | 41 | 3 years ago | 50 | April 30, 2018 | 168 | bsd-2-clause | Python | |
Swagger Documentation Generator for Django REST Framework: deprecated | ||||||||||
Django Rest Auth | 2,331 | 1,109 | 24 | 10 months ago | 25 | April 01, 2019 | 234 | mit | Python | |
This app makes it extremely easy to build Django powered SPA's (Single Page App) or Mobile apps exposing all registration and authentication related functionality as CBV's (Class Base View) and REST (JSON) | ||||||||||
Djoser | 2,288 | 212 | 5 | 7 days ago | 48 | October 30, 2020 | 166 | mit | Python | |
REST implementation of Django authentication system. | ||||||||||
Drf Nested Routers | 1,487 | 621 | 29 | 10 days ago | 19 | October 15, 2021 | 46 | apache-2.0 | Python | |
Nested Routers for Django Rest Framework | ||||||||||
Cookiecutter Django Rest | 1,405 | 7 hours ago | 4 | mit | Python | |||||
Build best practiced apis fast with Python3 | ||||||||||
Drf Extensions | 1,371 | 323 | 14 | 5 days ago | 16 | July 30, 2021 | 75 | mit | Python | |
DRF-extensions is a collection of custom extensions for Django REST Framework |
A simple plug-n-play LaTeX renderer for Django REST Framework.
REST Framework LaTeX can be downloaded from PyPI:
pip install rest-framework-latex
Currently the LaTeX plugin requires lualatex
- to install this on Ubuntu:
sudo aptitude install texlive-latex-extra texlive-xetex
This will probably take some time due to the size of LaTeX (around 1GB)
You can then configure the renderer in your settings or on each view:
REST_FRAMEWORK = {
'DEFAULT_RENDERER_CLASSES': [
'rest_framework_latex.renderers.LatexRenderer',
]
}
LATEX_RESOURCES
SettingThe LATEX_RESOURCES
directory contains the base template environment e.g.
any images or static resources to include in your template. This must be set for
the renderer to work:
LATEX_RESOURCES = '/home/user/path_to_resources'
This works just like TemplateHTMLRenderer
but by setting a latex_name
on
your view:
from rest_framework import viewsets
from rest_framework_latex import renderers
class SomeViewSet(viewsets.ViewSet):
"""
"""
renderer_classes = [
renderers.LatexRenderer,
]
latex_name = 'directory/latexfile.tex'
To use the template tags, add rest_framework_latex
to your INSTALLED_APPS
:
INSTALLED_APPS = [
...
'rest_framework_latex',
...
]
The TeX file used for rendering will be pushed through Django's templating system. This will cause some issues whereby you want to do something like:
\textt{{{ some_variable }}}
To get around this issue you will need to do something like the following:
\textt{% templatetag openbrace %}{{ some_variable }}{% templatetag closebrace %}
Tag | Tag/Filter | Purpose |
---|---|---|
latex_safe |
Filter | Escape all user-entered content for LaTeX rules |
latex_resources |
Tag | Print the value of settings.LATEX_RESOURCES
|
The renderer works by creating a new temporary directory, and then copying
over the LATEX_RESOURCES
directory into the new temporary directory.
Next it renders the TeX file into the temporary directory.
Then it runs lualatex over the TeX file, and this will produce the PDF file we read into memory.
Then we delete the temporary directory and return the PDF to the client.
The REST Framework LaTeX plugin is compatible with Django 1.11 and up and Django REST Framework 3.3 and up.