# view to be dynamically directed to the single page generated by Paginator

**URL:** <https://forum.djangoproject.com/t/view-to-be-dynamically-directed-to-the-single-page-generated-by-paginator/42243>\
**Category:** Getting Started\
**Created:** [August 5, 2025, 3:49pm UTC](https://forum.djangoproject.com/t/view-to-be-dynamically-directed-to-the-single-page-generated-by-paginator/42243 "2025-08-05T15:49:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![offlinem](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/offlinem/32/29429_2.png) [@offlinem](https://forum.djangoproject.com/u/offlinem)\
**Post date:** [August 5, 2025, 3:49pm UTC](https://forum.djangoproject.com/t/view-to-be-dynamically-directed-to-the-single-page-generated-by-paginator/42243/1 "2025-08-05T15:49:14Z")

</div>

Hi everyone, I’m a new developer in Django.

I have a project with an app: “perfume” I have a single view with paginator (numeric index) “one” I have a total view “perfumes”

I want the records of the “name” field of the “all” model in the total view to be dynamically directed to the single page generated by paginator (example: localhost:8000/uno/?page=1)

```python
# my models.py
class Perfume(models.Model):
    name = models.ForeignKey(Name, on_delete=models.CASCADE)
    class Meta:
        ordering = ['name']
        verbose_name_plural = "Perfumes"
    def __str__ (self):
        return str(self.name)

class Name(models.Model):
    class Meta:
        verbose_name_plural = "Names"
    name = models.CharField(max_length=50)
    def __str__ (self):
        return str(self.name)    

```

```python
# my view
def all(request):
    perfumes = Perfume.objects.order_by('name')
    return render(request, 'perfumes/perfumes.html', {'perfumes': perfumes})

def uno(request):
    perfumes = Perfume.objects.all().order_by('name')
    paginator = Paginator(perfumes, 1) # Show 1 posts per page

    page_number = request.GET.get('page')
    try:
        page_obj = paginator.get_page(page_number)
    except PageNotAnInteger:
        page_obj = paginator.page(1)
    except EmptyPage:
        page_obj = paginator.page(paginator.num_pages)

    context = {'page_obj': page_obj}
    return render(request, 'one.html', context) 

```

```python
# my urls app
urlpatterns = [
    path('', views.perfumes, name='perfumes'),
    path('one/', views.one, name='one'),
]

```

```python
# my urls project
urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('perfumes.urls')),
]

```

thanks to anyone who helps me!!

---

<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:** [August 5, 2025, 4:24pm UTC](https://forum.djangoproject.com/t/view-to-be-dynamically-directed-to-the-single-page-generated-by-paginator/42243/2 "2025-08-05T16:24:16Z")

</div>

Welcome @offlinem !

This is really an inefficient way of trying to do this.

To do this the “Django Way”, your “all” view would render the list of elements where each element has the link to the url for `uno` with a parameter identifying which `Perfume` object to render.

The [Official Django Tutorial](https://docs.djangoproject.com/en/5.1/intro/tutorial01/) covers this technique in sections 3 and 4. (If you haven’t worked your way through the official tutorial yet, you should. It demonstrates a number of common patterns that you should be familiar with.)
