-
Notifications
You must be signed in to change notification settings - Fork 75
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
docs: update 12-factor tutorials #2085
base: main
Are you sure you want to change the base?
Conversation
Hey Erin, I really appreciate this work! Just a note, this is going to conflict with #2083 as it also moves these files to rst. You may want to try to coordinate with @jahn-junior, though I imagine we'll be merging his PR on Monday or Tuesday. |
Hi @lengau, thanks for letting me know about the other PR. I was under the impression that the 12-factor docs weren't going to be touched since we had planned work to refactor them (See this comment on PR #2010 ). I see there's also #2048 with the how-to guide that I'm planning on refactoring, but that's for a later PR, so I will hold off on that work until after the PR has been merged. It seems unfortunately that any changes to the Django tutorial might be overwritten by the work in this PR, but I will not touch the FastAPI or Go tutorials until after #2083 has been merged. Thanks again for letting me know. |
da4cfba
to
dc917b1
Compare
Hey @erinecon ! On #2048: I'm happy for you to take over that one or to close it unmerged if you want to redo the MD -> rST conversion in your own PR, or we can work together to prioritise the completion so it won't affect you. Hopefully you should be able to rebase this PR either on #2083 or on main once it's merged and not have too many conflicts. |
…raft into update-tutorials
Thanks @lengau for the update!! I'll get started on resolving the conflicts and making the rest of the planned updates shortly :) (I'll also turn off the spread tests before marking the PR as ready for review.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing the update!
|
||
See more: `Multipass | How to install Multipass | ||
<https://multipass.run/docs/install-multipass>`_ | ||
.. include:: /reuse/tutorial/setup_edge.rst |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we do setup stable now for Django?
|
||
.. code-block:: bash | ||
|
||
sudo snap install juju --channel 3.5/stable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we go with juju version 3.6?
Install Juju and bootstrap a development controller: | ||
Juju is required to deploy the |12FactorApp| application. | ||
Install Juju using the ``3.5/stable`` track, and bootstrap a | ||
development controller: | ||
|
||
.. code-block:: bash | ||
|
||
sudo snap install juju --channel 3.5/stable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we go with juju version 3.6?
|
||
.. code-block:: bash | ||
|
||
sudo microk8s status --wait-ready |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be done after enabling the add-ons for slightly more efficient use of time
|
||
ALLOWED_HOSTS = json.loads(os.environ.get('DJANGO_ALLOWED_HOSTS', '{ref}`]')) | ||
ALLOWED_HOSTS = json.loads(os.environ.get('DJANGO_ALLOWED_HOSTS', '{ref}`]')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know where the {ref}
]` came from? I doubt it would work since it isn't valid JSON
|
||
Use ``juju status --watch 2s`` again to wait until the App is active | ||
again. You may visit http://django-hello-world from a web browser, or | ||
you can use ``curl 127.0.0.1 -H "Host: django-hello-world"`` inside the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we had an alternate way of doing this without the host, curl http://django-hello-world --resolve django-hello-world:80:127.0.0.1
should work
To demonstrate how to provide a configuration to the Django application, | ||
we will make the greeting configurable. We will expect this | ||
configuration option to be available in the Django app configuration under the | ||
keyword ``GREETING``. Go back out to the rock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not correct, that is how it works for Flask but not in Django. In Django, it will be available under the DJANGO_GREETING
environment vairable
greeting. | ||
After we wait for a bit monitoring ``juju status`` the application | ||
should go back to ``active`` again. Sending a request to the root | ||
endpoint using ``curl 127.0.0.1 -H "Host: django-hello-world"`` or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also be updated with the above curl command
|
||
After we wait for a moment for the app to be restarted, using | ||
``curl 127.0.0.1 -H "Host: django-hello-world"`` or visiting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also be updated
- Creating a Django application | ||
- Deploying the application locally | ||
- Building an OCI image using Rockcraft | ||
- Packaging the application using Charmcraft |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the intended wording? I would have guessed that packing the application is more like Rockcraft, perhaps bundling the application with ops code using Charmcraft?
Update the 12-factor tutorials.
Specific updates: