generated from maykinmedia/default-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Improve general docs #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,108 @@ | ||
.. _quickstart: | ||
|
||
========== | ||
Quickstart | ||
========== | ||
|
||
maykin-common is based around the principle of "zero-cost" utilities and optional | ||
dependency groups. A barebones installation gives you some useful bits, but depending | ||
on you're project needs you likely want to install some extras. | ||
|
||
.. note:: A quick recap: extra's in python packages are additional labels you can | ||
pass between square brackets to opt-in to additional dependencies, like so: | ||
|
||
.. code-block:: bash | ||
|
||
pip install maykin-common[extra1,extra2] | ||
|
||
Installation | ||
============ | ||
|
||
Install from PyPI with pip: | ||
You'll always want to install the base package, e.g.: | ||
|
||
.. code-block:: bash | ||
|
||
pip install maykin-common | ||
|
||
However, the usefulness increases with each extra. Each one of them is described below. | ||
|
||
.. tip:: default-project is pre-configured with the typical set of extras that apply | ||
to the majority of projects: | ||
|
||
.. code-block:: bash | ||
|
||
pip install maykin-common[axes,mfa] | ||
|
||
MFA | ||
--- | ||
|
||
Install command: | ||
|
||
.. code-block:: bash | ||
|
||
pip install maykin-common[mfa] | ||
|
||
The MFA (multi-factor authentication) extra integrates | ||
`django-admin-index <https://pypi.org/project/django-admin-index>`_ and | ||
`maykin-2fa <https://pypi.org/project/maykin-2fa>`_. In particular, it controls the | ||
navigation menu when you're authenticated but not verified with your second factor yet. | ||
|
||
These packages and this extra are by default enabled in default-project. | ||
|
||
For more details, see :mod:`maykin_common.django_two_factor_auth`. | ||
|
||
Axes | ||
---- | ||
|
||
Install command: | ||
|
||
.. code-block:: bash | ||
|
||
pip install maykin-common[axes] | ||
|
||
Used for the throttling view mixins. | ||
|
||
`django-axes <https://pypi.org/project/django-axes>`_ is our standard solution to | ||
prevent brute forced logins and is included by default via default-project. It provides | ||
a helper to get the remote IP address of the person trying to log in, which is used in | ||
the throttling implementation. | ||
|
||
For more details, see :mod:`maykin_common.throttling`. | ||
|
||
.. _quickstart_pdf: | ||
|
||
--- | ||
|
||
Install command: | ||
|
||
.. code-block:: bash | ||
|
||
pip install maykin-common[pdf] | ||
|
||
.. note:: You must define the setting ``PDF_BASE_URL_FUNCTION`` - a callable taking no | ||
arguments that returns the absolute base URL where your site/project is running. It | ||
is used to recognize references to your static assets (CSS and uploaded media). | ||
|
||
The PDF extra provides an easy to use template-based PDF generation helper, using | ||
`WeasyPrint <https://pypi.org/project/weasyprint>`_. It is optimized to load static | ||
assets (CSS/images/...) from disk rather than making network roundtrips. | ||
|
||
For details about the API, see :mod:`maykin_common.pdf`. | ||
|
||
Usage | ||
===== | ||
|
||
<document how to use the app here> | ||
All modules in maykin-common either only require Django to be available, or require some | ||
optional dependencies. Optional modules have zero footprint as long as you don't import | ||
them, and when you do use them, ensure you've installed the appropriate extra. | ||
|
||
API projects (team bron) | ||
------------------------ | ||
|
||
For API projects, see TODO. | ||
|
||
Other | ||
----- | ||
|
||
See the reference documentation for details. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
.. _reference_index: | ||
|
||
========= | ||
Reference | ||
========= | ||
|
||
Python API reference. | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
:caption: Core utilities | ||
|
||
checks | ||
context_processors | ||
migration_operations | ||
views | ||
templatetags | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
:caption: MFA | ||
|
||
django_two_factor_auth | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
:caption: Axes | ||
|
||
throttling | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
:caption: PDF | ||
|
||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.. _settings: | ||
|
||
======== | ||
Settings | ||
======== | ||
|
||
maykin-common requires a number of settings to function properly. These settings are | ||
typically provided through default-project already. | ||
|
||
.. automodule:: maykin_common.settings | ||
:members: | ||
:undoc-members: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
""" | ||
Custom Django system checks to prevent common mistakes. | ||
""" | ||
|
||
import os | ||
|
||
from django.conf import settings | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.