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

Image referencing path incorrect in Django tutorial #38082

Closed
ya01in opened this issue Feb 10, 2025 · 2 comments · Fixed by #38098
Closed

Image referencing path incorrect in Django tutorial #38082

ya01in opened this issue Feb 10, 2025 · 2 comments · Fixed by #38098
Assignees
Labels
accepting PR Feel free to open a PR to resolve this issue Content:Learn:Django Learning area Django docs

Comments

@ya01in
Copy link
Contributor

ya01in commented Feb 10, 2025

MDN URL

https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Server-side/Django/Home_page

What specific section or headline is this issue about?

Part Referencing static files in templates, in Section Creating The Index Page

What information was incorrect, unhelpful, or incomplete?

The path of the image file to reference is incorrect.

Image

src="{% static 'catalog/images/local_library_model_uml.png' %}"

Without specifying how to modify the STATIC_URL, the catalog of the image path should be removed in order the image to be shown.

What did you expect to see?

The webpage is showing the image after running the web server.

Do you have any supporting links, references, or citations?

Image

Do you have anything more you want to share?

After verifying that removing the catalog can show the image, I have forked the project and create a branch for the fix.

static-image-reference-path-fail

If this issue is identified as a typo, can I fixed it?

@ya01in ya01in added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Feb 10, 2025
@github-actions github-actions bot added Content:Learn Learning area docs and removed Content:Learn Learning area docs labels Feb 10, 2025
@Josh-Cena Josh-Cena added Content:Learn:Express Learning area Express docs Content:Learn:Django Learning area Django docs and removed Content:Learn:Express Learning area Express docs labels Feb 10, 2025
@Josh-Cena
Copy link
Member

@hamishwillee could verify

@hamishwillee
Copy link
Collaborator

@ya01in Thank you, you're right - the path is app-relative. Can you please create a PR for the docs.

Note that there is no need to update the corresponding "worked version" as that does the right thing already https://github.com/mdn/django-locallibrary-tutorial/blob/main/catalog/templates/index.html#L15

@Josh-Cena Josh-Cena added accepting PR Feel free to open a PR to resolve this issue and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepting PR Feel free to open a PR to resolve this issue Content:Learn:Django Learning area Django docs
Projects
None yet
3 participants