mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
doc: Add filename to code snippets in tutorial
[sunil: Add caption for another file too] Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
1 parent
ec67b71aa6
commit
213e01abcd
6 files changed
+29
-1
No files matched your search
@@ -11,6 +11,7 @@ file is provided by the framework. In some cases, we will need to customize this
|
||||
template. Let us create a custom template file in ``transmission.html``.
|
||||
|
||||
.. code-block:: django
|
||||
:caption: ``templates/transmission.html``
|
||||
|
||||
{% extends "app.html" %}
|
||||
|
||||
@@ -48,6 +49,7 @@ To start using our custom template, we need to pass this to our view. In
|
||||
``views.py``, add the following line:
|
||||
|
||||
.. code-block:: python3
|
||||
:caption: ``views.py``
|
||||
|
||||
class TransmissionAppView(AppView):
|
||||
...
|
||||
@@ -60,6 +62,7 @@ Our app needs some configuration. So, we need to write a configuration form to
|
||||
provide options to the user. Add the following to ``forms.py``.
|
||||
|
||||
.. code-block:: python3
|
||||
:caption: ``forms.py``
|
||||
|
||||
from django import forms
|
||||
|
||||
@@ -95,6 +98,7 @@ The view we have created needs to display the form and process the form after
|
||||
the user submits it. Let us implement that in ``views.py``.
|
||||
|
||||
.. code-block:: python3
|
||||
:caption: ``views.py``
|
||||
|
||||
from django.contrib import messages
|
||||
|
||||
@@ -157,6 +161,7 @@ enable and disable the web configuration. We will do this by creating a file
|
||||
``actions/transmission``.
|
||||
|
||||
.. code-block:: python3
|
||||
:caption: ``actions/transmission``
|
||||
|
||||
import argparse
|
||||
import json
|
||||
|
||||
Reference in new issue
Block a user