# Get\_Absolute\_url Error

**URL:** <https://forum.djangoproject.com/t/get-absolute-url-error/34537>\
**Category:** Templates & Frontend\
**Created:** [September 6, 2024, 2:45am UTC](https://forum.djangoproject.com/t/get-absolute-url-error/34537 "2024-09-06T02:45:14Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![pmorales4](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/pmorales4/32/23733_2.png) [@pmorales4](https://forum.djangoproject.com/u/pmorales4)\
**Post date:** [September 6, 2024, 2:45am UTC](https://forum.djangoproject.com/t/get-absolute-url-error/34537/1 "2024-09-06T02:45:14Z")

</div>

Hello Everyone,  
I am using the Django 5 By Example book and going through each chapter. Currently, I have having issues with the get\_absolute\_url function with chapter 2. Basically, linking back to a blog post with the db. I have followed the book and written the code out by each step but keep getting the error of ( **no linking to any post** ). With that being said the html page list.html has a href that should link to all my post with the format from the get\_absolute\_url function but does not pull it. I am losing my mind on it. Looking for some help on it. It may be a simple step but just not seeing it.

I have add views.py, models.py, details.html, list.html, urls.py

Views.py

 ![Screenshot 2024-09-05 at 10.36.44 PM](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/3X/8/0/80be83aa58f92562095775599e3b18692f1f3c64.png)

---

<div class="post-metadata">

**Author:** ![pmorales4](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/pmorales4/32/23733_2.png) [@pmorales4](https://forum.djangoproject.com/u/pmorales4)\
**Post date:** [September 6, 2024, 2:45am UTC](https://forum.djangoproject.com/t/get-absolute-url-error/34537/2 "2024-09-06T02:45:49Z")

</div>

models.py

 ![Screenshot 2024-09-05 at 10.38.47 PM](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/3X/0/4/0476eb8669ee7c4d062eae50dfc65a5955afcccc.png)

---

<div class="post-metadata">

**Author:** ![pmorales4](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/pmorales4/32/23733_2.png) [@pmorales4](https://forum.djangoproject.com/u/pmorales4)\
**Post date:** [September 6, 2024, 2:46am UTC](https://forum.djangoproject.com/t/get-absolute-url-error/34537/3 "2024-09-06T02:46:27Z")

</div>

![Screenshot 2024-09-05 at 10.39.16 PM](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/3X/5/0/503599085082d3c84335a281a39cc753c14bed21.png)

---

<div class="post-metadata">

**Author:** ![pmorales4](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/pmorales4/32/23733_2.png) [@pmorales4](https://forum.djangoproject.com/u/pmorales4)\
**Post date:** [September 6, 2024, 2:46am UTC](https://forum.djangoproject.com/t/get-absolute-url-error/34537/4 "2024-09-06T02:46:58Z")

</div>

details.html (html homepage)

 ![Screenshot 2024-09-05 at 10.40.57 PM](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/3X/b/7/b74deb93b98b22fba7a7215c944937042489f787.png)

---

<div class="post-metadata">

**Author:** ![pmorales4](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/pmorales4/32/23733_2.png) [@pmorales4](https://forum.djangoproject.com/u/pmorales4)\
**Post date:** [September 6, 2024, 2:47am UTC](https://forum.djangoproject.com/t/get-absolute-url-error/34537/5 "2024-09-06T02:47:28Z")

</div>

list.html (separate post once link is clicked, not working here)

 ![Screenshot 2024-09-05 at 10.42.21 PM](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/3X/a/8/a8e3d400f7ef517733b32ac0c72d4b5f4819f049.png)

---

<div class="post-metadata">

**Author:** ![pmorales4](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/pmorales4/32/23733_2.png) [@pmorales4](https://forum.djangoproject.com/u/pmorales4)\
**Post date:** [September 6, 2024, 2:47am UTC](https://forum.djangoproject.com/t/get-absolute-url-error/34537/6 "2024-09-06T02:47:59Z")

</div>

urls.py (blog app)

 ![Screenshot 2024-09-05 at 10.43.12 PM](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/3X/a/b/ab35d95a4839c745a0227065258a25796c227886.png)

---

<div class="post-metadata">

**Author:** ![pmorales4](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/pmorales4/32/23733_2.png) [@pmorales4](https://forum.djangoproject.com/u/pmorales4)\
**Post date:** [September 6, 2024, 2:52am UTC](https://forum.djangoproject.com/t/get-absolute-url-error/34537/7 "2024-09-06T02:52:24Z")

</div>

database items so no null values missing.

 ![Screenshot 2024-09-05 at 10.51.40 PM](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/3X/a/f/af1e31d9bda80316c2ff8f5eadc14562d343e94b.png)

---

<div class="post-metadata">

**Author:** ![pmorales4](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/pmorales4/32/23733_2.png) [@pmorales4](https://forum.djangoproject.com/u/pmorales4)\
**Post date:** [September 6, 2024, 2:53am UTC](https://forum.djangoproject.com/t/get-absolute-url-error/34537/8 "2024-09-06T02:53:16Z")

</div>

django backend pic within admin …

 ![Screenshot 2024-09-05 at 10.51.12 PM](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/3X/7/4/74293330b520f77aad2be820a581a8e3ff9ccf08.png)

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [September 6, 2024, 3:00am UTC](https://forum.djangoproject.com/t/get-absolute-url-error/34537/9 "2024-09-06T03:00:54Z")

</div>

First a side note: Please do _not_ post images of code. Copy / paste the code into the body of your post and enclose the code between lines of three backtick - ` characters. This means you’ll have a line of ```, then your code, then another line of ```. This forces the forum software to keep your code properly formatted.  
(I can’t determine whether or not your code is indented properly from the images.)

You don’t need to repost anything about the detail page. We only need to see the list view, the model, and the template for it.

Also, please show the html that was actually rendered in your list. Not the template, but what the links are that were received in the browser.

---

<div class="post-metadata">

**Author:** ![white-seolpyo](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/white-seolpyo/32/22386_2.png) [@white-seolpyo](https://forum.djangoproject.com/u/white-seolpyo)\
**Post date:** [September 6, 2024, 4:48am UTC](https://forum.djangoproject.com/t/get-absolute-url-error/34537/10 "2024-09-06T04:48:00Z")

</div>

get\_absolute\_url must be Model method.

but you set the Meta method.

that’s wrong.

---

<div class="post-metadata">

**Author:** ![pmorales4](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/pmorales4/32/23733_2.png) [@pmorales4](https://forum.djangoproject.com/u/pmorales4)\
**Post date:** [September 7, 2024, 2:20am UTC](https://forum.djangoproject.com/t/get-absolute-url-error/34537/11 "2024-09-07T02:20:40Z")

</div>

Thank you for the insight on uploading code, I thought it was to add several pics at a time. Going forward I will use that way.
