# Django how to pass link specific url to another html page showing static images

**URL:** <https://forum.djangoproject.com/t/django-how-to-pass-link-specific-url-to-another-html-page-showing-static-images/16804>\
**Category:** Templates & Frontend\
**Created:** [November 4, 2022, 1:29am UTC](https://forum.djangoproject.com/t/django-how-to-pass-link-specific-url-to-another-html-page-showing-static-images/16804 "2022-11-04T01:29:10Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![nathanramoscfa](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/nathanramoscfa/32/10680_2.png) [@nathanramoscfa](https://forum.djangoproject.com/u/nathanramoscfa)\
**Post date:** [November 4, 2022, 1:29am UTC](https://forum.djangoproject.com/t/django-how-to-pass-link-specific-url-to-another-html-page-showing-static-images/16804/1 "2022-11-04T01:29:11Z")

</div>

I have table of tickers on one HTML page, and four charts displayed on another HTML page. These charts come from my static/images folder full of hundreds of images named by each ETF’s benchmark index ticker. If I click the ETF ticker “PSCD” in the first row of the table, how can it be linked to another HTML page named charts.html which shows four charts whose filenames contain the ETF’s benchmark index ticker, example: `chart1/S6COND.jpg`, `chart2/S6COND.jpg`, `chart3/S6COND.jpg`, `chart4/S6COND.jpg`. ← In this example, I hardcoded S6COND.jpg into the link, and it works…but I need it to be dynamically tied to the index ticker of whatever etf ticker row I click on in the table. The index ticker for each ETF for each row in the table is included in my models.py which you can see below.

In the charts.html code example below, I hardcoded S6COND into the image tag but I want this dynamically linked.

[![enter image description here](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/2X/5/5d5450f49c704704f608c79a135ed5d561cc0e8b.png)](https://i.stack.imgur.com/wPp3p.png)

Below you will see my table.html page showing my table from above. Next is the charts.html where I would like the etf\_ticker that was clicked in that table to be entered into the image tags such as `<img src="{% static 'myapp/images/chart1_S6COND.jpg' %}" alt="chart1"/></div>` where you see I have hardcoded “S6COND” into the image tag. But I need this to be dynamic, from which you click on the link in table.html, and it gets inserted into the image tag in charts.html.

table.html

```plaintext
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>ETF Table</title>
    {% load static %}
    <link rel="stylesheet" type="text/css" href="{% static 'myapp/css/table_style.css' %}">
    <style type="text/css"></style>
</head>
<body>
<div class="container">
  <table id="table" class="table table-dark table-hover table-striped table-bordered table-sm">
   <thead>
     <tr>
      <th data-sortable="true">ETF Ticker</th>
      <th>ETF Name</th>
      <th>Index Name</th>
     </tr>
   </thead>
   <tbody>
    {% if d %}
    {% for i in d %}
     <tr>
        <td><a href="{% url 'myapp:charts' %}" target="_blank">{{i.etf_ticker}}</a></td>
        <td><a href="{% url 'myapp:charts' %}" target="_blank">{{i.etf_name}}</a></td>
        <td><a href="{% url 'myapp:charts' %}" target="_blank">{{i.index_name}}</a></td>
     </tr>
    {% endfor %}
    {% endif %}
   </tbody>
  </table>
  <script>
  $('#table').DataTable({
    "bLengthChange": true,
    "lengthMenu": [[20, 50, 100 -1], [20, 50, 100, "All"] ],
    "iDisplayLength": 20,
    bInfo: false,
    responsive: true,
    order: [[4, 'desc']],
  });
  </script>
</div>
</body>
</html>

```

charts.html

```plaintext
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Charts</title>
    {% load static %}
    <link rel="stylesheet" type="text/css" href="{% static 'myapp/css/charts_style.css' %}">
    <style type="text/css">
        ul {
            list-style-type: none;
            margin: 0;
            padding: 0;
        }
    </style>
</head>
<body>
<nav>
  <ul>
    <li><a class="nav" href="{% url 'myapp:index' %}">Home</a></li><br><br>
    <li><a class="nav" href="{% url 'myapp:table' %}">Table</a></li><br>
  </ul>
</nav>
<div class="container">
    <div class="box"><img src="{% static 'myapp/images/chart1_S6COND.jpg' %}" alt="chart1"/></div>
    <div class="box"><img src="{% static 'myapp/images/chart2_S6COND.jpg' %}" alt="chart2"/></div>
    <div class="box"><img src="{% static 'myapp/images/chart3_S6COND.jpg' %}" alt="chart3"/></div>
    <div class="box"><img src="{% static 'myapp/images/chart4_S6COND.jpg' %}" alt="chart4"/></div>
</div>
</body>
</html>

```

urls.py

```python
from django.urls import path
from . import views
from .views import ChartView

app_name = 'myapp'
urlpatterns = [
    path('', views.index, name='index'),
    path('table/', views.table, name='table'),
    path('charts/', ChartView.as_view(), name='charts'),
]

```

models.py

```python
from django.db import models

class Table(models.Model):
    etf_ticker = models.CharField(max_length=10)
    etf_name = models.CharField(max_length=200)
    index_name = models.CharField(max_length=200)
    index_ticker = models.CharField(max_length=200)

```

views.py

```python
from django.shortcuts import render
from django.views.generic import TemplateView
from .models import Table

def index(request):
    return render(request, 'index.html')

def table(request):
    data = Table.objects.all().values()
    context = {'d': data}
    return render(request, 'table.html', context)

class ChartView(TemplateView):
    template_name = 'charts.html'

```

---

<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:** [November 4, 2022, 3:21am UTC](https://forum.djangoproject.com/t/django-how-to-pass-link-specific-url-to-another-html-page-showing-static-images/16804/2 "2022-11-04T03:21:48Z")

</div>

You typically pass selections from one view to another through URL parameters.

Build your link url using the ticker symbol (or the pk of the table containing that symbol) as a parameter in the second view’s URL.

Your second view can then build the page with the links to the proper images based on that symbol.

---

<div class="post-metadata">

**Author:** ![nathanramoscfa](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/nathanramoscfa/32/10680_2.png) [@nathanramoscfa](https://forum.djangoproject.com/u/nathanramoscfa)\
**Post date:** [November 4, 2022, 4:17am UTC](https://forum.djangoproject.com/t/django-how-to-pass-link-specific-url-to-another-html-page-showing-static-images/16804/3 "2022-11-04T04:17:08Z")

</div>

Could you point me to an example of how to do that?

I tried:

table.html

```auto
<a href="{% url 'myapp:charts' i.index_ticker %}" target="_blank">{{i.etf_ticker}}</a>

```

views.html

```auto
class ChartView(TemplateView):
    template_name = 'charts.html'

    def get(self, request, ticker=None):
        if ticker:
            return render(request, self.template_name, {'ticker': ticker})
        else:
            return render(request, self.template_name)

```

charts.html

```auto
<div class="container">
    <img src="{% static 'myapp/images/chart1_'|add:ticker|add:'.jpg' %}" alt="chart1"/>
    <img src="{% static 'myapp/images/chart2_'|add:ticker|add:'.jpg' %}" alt="chart2"/>
    <img src="{% static 'myapp/images/chart3_'|add:ticker|add:'.jpg' %}" alt="chart3"/>
    <img src="{% static 'myapp/images/chart4_'|add:ticker|add:'.jpg' %}" alt="chart4"/>
</div>

```

But this raised a NoReverseMatch exception on table.html at the link I included in this comment.

```auto
NoReverseMatch at /myapp/table/
Reverse for 'charts' not found. 'charts' is not a valid view function or pattern name.

```

---

<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:** [November 4, 2022, 4:21am UTC](https://forum.djangoproject.com/t/django-how-to-pass-link-specific-url-to-another-html-page-showing-static-images/16804/4 "2022-11-04T04:21:08Z")

</div>

What does your urls.py file look like for this app? The error is saying that you don’t have a url defined with a name of ‘charts’.

Also note that you will need to change that url to accept a parameter, and that you access parameters in CBV in `self.kwargs`, not as function parameters.

---

<div class="post-metadata">

**Author:** ![nathanramoscfa](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/nathanramoscfa/32/10680_2.png) [@nathanramoscfa](https://forum.djangoproject.com/u/nathanramoscfa)\
**Post date:** [November 4, 2022, 4:28am UTC](https://forum.djangoproject.com/t/django-how-to-pass-link-specific-url-to-another-html-page-showing-static-images/16804/5 "2022-11-04T04:28:37Z")

</div>

Looks like this.

urls.py

```auto
from django.urls import path
from . import views
from .views import ChartView

app_name = 'myapp'
urlpatterns = [
    path('', views.index, name='index'),
    path('table/', views.table, name='table'),
    path('charts/<str:ticker>', ChartView.as_view(), name='charts')
]

```

---

<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:** [November 4, 2022, 4:44am UTC](https://forum.djangoproject.com/t/django-how-to-pass-link-specific-url-to-another-html-page-showing-static-images/16804/6 "2022-11-04T04:44:17Z")

</div>

Would you please post the entire error with traceback that you are getting? I don’t see anything wrong with what you’ve posted, so I’m hoping the full message with traceback provides some clues.

(Side note of no relevance to this current issue: I noticed in your template you have an `if d` before your `for i in d`. That’s really not necessary to do that. If `d` doesn’t exist or is an empty iterable, the loop isn’t going to execute.)

---

<div class="post-metadata">

**Author:** ![nathanramoscfa](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/nathanramoscfa/32/10680_2.png) [@nathanramoscfa](https://forum.djangoproject.com/u/nathanramoscfa)\
**Post date:** [November 4, 2022, 5:14am UTC](https://forum.djangoproject.com/t/django-how-to-pass-link-specific-url-to-another-html-page-showing-static-images/16804/7 "2022-11-04T05:14:34Z")

</div>

Here is the traceback. Good to know on the unnecessary if statement.

```auto
Environment:

Request Method: GET
Request URL: http://127.0.0.1:8000/myapp/table/

Django Version: 4.0
Python Version: 3.8.12
Installed Applications:
['myapp.apps.TableConfig',
 'django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']

Template error:
In template mysite\myapp\templates\myapp\myapp.html, error at line 51
   Reverse for 'charts' not found. 'charts' is not a valid view function or pattern name.
   48 : {% if d %}
   49 : {% for i in d %}
   50 : <tr>
   51 : <td><a href="{% url 'myapp:charts' i.index_ticker %}" target="_blank">{{i.etf_ticker}}</a></td>
   52 : <td><a href="{% url 'myapp:charts' i.index_ticker %}" target="_blank">{{i.etf_name}}</a></td>
   53 : <td><a href="{% url 'myapp:charts' i.index_ticker %}" target="_blank">{{i.index_name}}</a></td>
   54 : </tr>
   55 : {% endfor %}
   56 : {% endif %}
   57 : </tbody>

Traceback (most recent call last):
  File "django\core\handlers\exception.py", line 47, in inner
    response = get_response(request)
  File "django\core\handlers\base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "mysite\myapp\views.py", line 13, in table
    return render(request, 'table.html', context)
  File "django\shortcuts.py", line 19, in render
    content = loader.render_to_string(template_name, context, request, using=using)
  File "django\template\loader.py", line 62, in render_to_string
    return template.render(context, request)
  File "django\template\backends\django.py", line 61, in render
    return self.template.render(context)
  File "django\template\base.py", line 176, in render
    return self._render(context)
  File "django\template\base.py", line 168, in _render
    return self.nodelist.render(context)
  File "django\template\base.py", line 977, in render
    return SafeString(''.join([
  File "django\template\base.py", line 978, in <listcomp>
    node.render_annotated(context) for node in self
  File "django\template\base.py", line 938, in render_annotated
    return self.render(context)
  File "django\template\defaulttags.py", line 295, in render
    return nodelist.render(context)
  File "django\template\base.py", line 977, in render
    return SafeString(''.join([
  File "django\template\base.py", line 978, in <listcomp>
    node.render_annotated(context) for node in self
  File "django\template\base.py", line 938, in render_annotated
    return self.render(context)
  File "django\template\defaulttags.py", line 214, in render
    nodelist.append(node.render_annotated(context))
  File "django\template\base.py", line 938, in render_annotated
    return self.render(context)
  File "django\template\defaulttags.py", line 442, in render
    url = reverse(view_name, args=args, kwargs=kwargs, current_app=current_app)
  File "django\urls\base.py", line 86, in reverse
    return resolver._reverse_with_prefix(view, prefix, *args, **kwargs)
  File "django\urls\resolvers.py", line 729, in _reverse_with_prefix
    raise NoReverseMatch(msg)

Exception Type: NoReverseMatch at /myapp/table/
Exception Value: Reverse for 'charts' not found. 'charts' is not a valid view function or pattern name.

```

---

<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:** [November 4, 2022, 1:43pm UTC](https://forum.djangoproject.com/t/django-how-to-pass-link-specific-url-to-another-html-page-showing-static-images/16804/8 "2022-11-04T13:43:25Z")

</div>

I’m really fishing here - I’m sure I’m overlooking something but I have no idea what.

Everything _looks_ right to me from what I’m seeing.

Is there any chance that there’s a space or other “url-special” character (e.g. `#`, `%`, `/`, `&`, etc) in `index_ticker`?

Also, if you have debug=True and you enter an incorrect url, Django will display a web page showing all the valid patterns being matched. You might want to enter a totally-wrong URL and verify that `charts` shows up in the list of urls being searched - there might be something more fundamentally wrong here.

---

<div class="post-metadata">

**Author:** ![nathanramoscfa](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/nathanramoscfa/32/10680_2.png) [@nathanramoscfa](https://forum.djangoproject.com/u/nathanramoscfa)\
**Post date:** [November 4, 2022, 9:24pm UTC](https://forum.djangoproject.com/t/django-how-to-pass-link-specific-url-to-another-html-page-showing-static-images/16804/9 "2022-11-04T21:24:04Z")

</div>

i.index\_ticker returns just the index ticker of that ETF ticker. I’ve included below after the 404 error quote, examples showing code that worked in at least showing a chart, or 4 charts, but never 4 charts shown based on the ETF ticker of the table row the user clicks on. It broke on this line when I added the i.index\_ticker to the URL tag. If I remove i.index\_ticker from this tag, it works in directing me to the charts.html page.

```auto
<a href="{% url 'myapp:charts' i.index_ticker %}" target="_blank">{{i.etf_ticker}}</a>

```

These are the URL patterns Django when I tried a wrong URL:

```auto
Page not found (404)
Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:

admin/
myapp/ [name='index']
myapp/ table/ [name='table']
myapp/ charts/<str:ticker> [name='charts']
The current path, myapp/charts/, didn’t match any of these.

```

These lines worked in terms of charts.html loading with a chart or charts. But unfortunately, either only 1 dynamically linked chart is shown as jpg image alone in browser or if I hardcode the index\_ticker into the URL, it’ll show my 4 charts but the charts need to be tied to ETF ticker the user clicks in the table.

This one only shows 1 chart.

```auto
<a href="{% static '/myapp/images/chart1_'|add:i.index_ticker|add:'.jpg' %}" target="_blank">{{i.etf_ticker}}</a>

```

This one works to link to the charts.html page but does not tell charts.html which specific charts I want displayed according to the index\_ticker.

```auto
<a href="{% url 'myapp:charts' %}" target="_blank">{{i.etf_ticker}}</a>

```

This works in charts.html because I hardcoded S6COND into the URL myself and only shows a single jpg image of S6COND, not dynamically linked.

```auto
<div class="box"><img src="{% static 'myapp/images/chart1_S6COND.jpg' %}" alt="chart1"/></div>

```

---

<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:** [November 4, 2022, 9:47pm UTC](https://forum.djangoproject.com/t/django-how-to-pass-link-specific-url-to-another-html-page-showing-static-images/16804/10 "2022-11-04T21:47:31Z")

</div>

> [@nathanramoscfa](#):
>
> i.index\_ticker returns just the index ticker of that ETF ticker.

Unfortunately, that by itself doesn’t really mean anything to me.

Is there any chance that **any** of the entries in that column contain any “url-hostile” characters? (That sort of situation is why it’s generally preferred to pass the pk of the reference as the url parameter instead of arbitrary strings. But if you’re sure that none of the entries has any of those characters then this isn’t the issue.)

---

<div class="post-metadata">

**Author:** ![nathanramoscfa](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/nathanramoscfa/32/10680_2.png) [@nathanramoscfa](https://forum.djangoproject.com/u/nathanramoscfa)\
**Post date:** [November 4, 2022, 10:24pm UTC](https://forum.djangoproject.com/t/django-how-to-pass-link-specific-url-to-another-html-page-showing-static-images/16804/11 "2022-11-04T22:24:16Z")

</div>

Here are the index tickers. None of them have url-hostile characters. Just alpha-numeric characters.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/2X/6/63de140b9727a5f24c488d876de9b77b2e7dd8e6.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:** [November 4, 2022, 10:31pm UTC](https://forum.djangoproject.com/t/django-how-to-pass-link-specific-url-to-another-html-page-showing-static-images/16804/12 "2022-11-04T22:31:09Z")

</div>

Try this - remove the `.values()` clause from your query in the `table` view. Allow Django to pass the objects directly into the template rendering engine.

---

<div class="post-metadata">

**Author:** ![nathanramoscfa](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/nathanramoscfa/32/10680_2.png) [@nathanramoscfa](https://forum.djangoproject.com/u/nathanramoscfa)\
**Post date:** [November 5, 2022, 12:04am UTC](https://forum.djangoproject.com/t/django-how-to-pass-link-specific-url-to-another-html-page-showing-static-images/16804/13 "2022-11-05T00:04:01Z")

</div>

I removed `.values()` clause from table view and still get the `Reverse for 'charts' not found. 'charts' is not a valid view function or pattern name.`

views.py now looks like this:

```auto
from django.shortcuts import render
from django.views.generic import TemplateView
from .models import Table

def index(request):
    return render(request, 'index.html')

def table(request):
    data = Table.objects.all()
    context = {'d': data}
    return render(request, 'table.html', context)

class ChartView(TemplateView):
    template_name = 'charts.html'

    def get(self, request, ticker=None):
        if ticker:
            return render(request, self.template_name, {'ticker': ticker})
        else:
            return render(request, self.template_name)

```

---

<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:** [November 5, 2022, 12:34am UTC](https://forum.djangoproject.com/t/django-how-to-pass-link-specific-url-to-another-html-page-showing-static-images/16804/14 "2022-11-05T00:34:12Z")

</div>

I don’t know what to say at this point. I can’t recreate this issue in my environment based upon what you’ve got here and I can’t think of what you might have in your project that could cause this to happen - especially if this works without the parameter. That’s why I’m focused so much on what that parameter _is_ - I gotta believe it’s somehow related to that parameter.

In the category of “trying anything to see if it works”, I’d probably be trying things like:

- Change the parameter from i.index\_ticker to i.pk, and the url parameter from str to int
- Try a more trivial template with a constant value as a parameter
- Try a more trivial template with a value passed in through the context

---

<div class="post-metadata">

**Author:** ![nathanramoscfa](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/nathanramoscfa/32/10680_2.png) [@nathanramoscfa](https://forum.djangoproject.com/u/nathanramoscfa)\
**Post date:** [November 5, 2022, 2:13am UTC](https://forum.djangoproject.com/t/django-how-to-pass-link-specific-url-to-another-html-page-showing-static-images/16804/15 "2022-11-05T02:13:25Z")

</div>

If it helps, here is the actual project Github page showing you the app with the changes you suggested so far.

> **[cape/django\_apps/mysite/forecast at branch1 · nathanramoscfa/cape](https://github.com/nathanramoscfa/cape/tree/branch1/django_apps/mysite/forecast)**
>
> branch1/django\_apps/mysite/forecast

---

<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:** [November 5, 2022, 2:23am UTC](https://forum.djangoproject.com/t/django-how-to-pass-link-specific-url-to-another-html-page-showing-static-images/16804/16 "2022-11-05T02:23:34Z")

</div>

What I’m looking at in branch1 is vastly different from what you’ve been reporting here.

Specifically, your `url` tag entries do not match the url definition. You’re got `'forecast:forecast_charts'` in the template, but the name entry is ` name='charts'`

---

<div class="post-metadata">

**Author:** ![nathanramoscfa](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/nathanramoscfa/32/10680_2.png) [@nathanramoscfa](https://forum.djangoproject.com/u/nathanramoscfa)\
**Post date:** [November 5, 2022, 2:27am UTC](https://forum.djangoproject.com/t/django-how-to-pass-link-specific-url-to-another-html-page-showing-static-images/16804/17 "2022-11-05T02:27:12Z")

</div>

Yea, I had removed all references to the word “forecast” to make my code example as generic as possible. But this is the actual project I am working on. It’s all the same, but just with the word “forecast” everywhere.

I am going to try to create a model of images and see if I can create a view with context variable referring to that model of images, and see what happens. I will of course share any solution I might find.

Thank you for your time even though a solution couldn’t be found!

---

<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:** [November 5, 2022, 2:28am UTC](https://forum.djangoproject.com/t/django-how-to-pass-link-specific-url-to-another-html-page-showing-static-images/16804/18 "2022-11-05T02:28:03Z")

</div>

If what you’ve got in the repo is what you’re actually working with, then you should be able to just fix the name entry in the urls.py file.

---

<div class="post-metadata">

**Author:** ![nathanramoscfa](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/nathanramoscfa/32/10680_2.png) [@nathanramoscfa](https://forum.djangoproject.com/u/nathanramoscfa)\
**Post date:** [November 7, 2022, 4:33am UTC](https://forum.djangoproject.com/t/django-how-to-pass-link-specific-url-to-another-html-page-showing-static-images/16804/19 "2022-11-07T04:33:00Z")

</div>

I figured out the issue. Thanks for your help.

> <https://stackoverflow.com/questions/74284715/django-how-to-pass-clicked-on-link-text-to-a-url-on-another-html-page-showing-st/74341883#74341883>
