Skip to content
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

Language changes, pop-up warning, clarify instructions #709

Merged
merged 8 commits into from
Sep 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions docs/tutorial/django.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Build a rock for a Django application
-------------------------------------

In this tutorial you will create a simple Django application and learn how to
In this tutorial, we'll create a simple Django application and learn how to
containerise it in a rock, using Rockcraft's ``django-framework``
:ref:`extension <django-framework-reference>`.

Expand Down Expand Up @@ -73,7 +73,7 @@ The Django application looks good, so you can stop it for now using ``ctrl+C``.
Pack the Django application into a rock
=======================================

First, you'll need a ``rockcraft.yaml`` file. Rockcraft will automate its
First, we'll need a ``rockcraft.yaml`` file. Rockcraft will automate its
creation and tailoring for a Django application by using the
``django-framework`` profile:

Expand Down Expand Up @@ -136,7 +136,7 @@ tutorial.
Run the Django rock with Docker
===============================

You already have the rock as an `OCI <OCI_image_spec_>`_ archive. Now you'll
We already have the rock as an `OCI <OCI_image_spec_>`_ archive. Now we'll
need to load it into Docker:

.. literalinclude:: code/django/task.yaml
Expand Down Expand Up @@ -166,7 +166,7 @@ size:
The size of the image reported by Docker is the uncompressed size which is
larger than the size of the compressed ``.rock`` file.

Now you're ready to run the rock and test your containerised Django application:
Now we're ready to run the rock and test your containerised Django application:

.. literalinclude:: code/django/task.yaml
:language: text
Expand Down Expand Up @@ -216,8 +216,8 @@ You can also choose to follow the logs by using the ``-f`` option with the
Cleanup
~~~~~~~

Now you have a fully functional rock for you Django application! This concludes
the first part of this tutorial, so you can stop the container and remove the
Now we have a fully functional rock for our Django application! This concludes
the first part of this tutorial, so we can stop the container and remove the
respective image for now:

.. literalinclude:: code/django/task.yaml
Expand Down Expand Up @@ -272,7 +272,7 @@ As before, verify that the new rock was created:
You'll verify that the new Django rock is now approximately **15% smaller**
in size! And that's just because of the simple change of ``base``.

And the functionality is still the same. As before, you can confirm this by
And the functionality is still the same. As before, we can confirm this by
running the rock with Docker:

.. literalinclude:: code/django/task.yaml
Expand All @@ -295,7 +295,7 @@ Unsurprisingly, the Django application should still respond with
Cleanup
~~~~~~~

And that's it. You can now stop the container and remove the corresponding
And that's it. We can now stop the container and remove the corresponding
image:

.. literalinclude:: code/django/task.yaml
Expand All @@ -309,16 +309,16 @@ image:
Update Django application
=========================

As a final step, let's say you want to update your application. For example,
you want to add a new ``/time/`` endpoint which returns the current time.
As a final step, let's update our application. For example,
we want to add a new ``/time/`` endpoint which returns the current time.

.. literalinclude:: code/django/task.yaml
:language: bash
:start-after: [docs:create-time-app]
:end-before: [docs:create-time-app-end]
:dedent: 2

Open the file ``time_app/views.py`` and insert the following contents:
Open the file ``time_app/views.py`` and replace its contents with the following:

.. literalinclude:: code/django/time_app_views.py
:language: python
Expand All @@ -328,12 +328,13 @@ Create the file ``time_app/urls.py`` with the following contents:
.. literalinclude:: code/django/time_app_urls.py
:language: python

Open the file ``django_hello_world/urls.py`` and insert the following contents:
Open the file ``django_hello_world/urls.py`` and replace its contents with
the following:

.. literalinclude:: code/django/urls.py
:language: python

Since you are creating a new version of your application, go back to the
Since we are creating a new version of the application, go back to the
tutorial root directory using ``cd ..`` and open the ``rockcraft.yaml`` file and
change the ``version`` (e.g. to ``0.2``).

Expand Down Expand Up @@ -375,7 +376,7 @@ The updated application should respond with the current date and time (e.g.
Cleanup
~~~~~~~

You can now stop the container and remove the corresponding image:
We can now stop the container and remove the corresponding image:

.. literalinclude:: code/django/task.yaml
:language: bash
Expand All @@ -386,7 +387,7 @@ You can now stop the container and remove the corresponding image:
Reset your environment
======================

You've reached the end of this tutorial.
We've reached the end of this tutorial.

If you'd like to reset your working environment, you can simply run the
following:
Expand Down
Loading