# 18、Django自定义页面跳转链接

* model.py

```python
# 空内容model
class Feedback_Stat(models.Model):
    pass
```

* admin.py

```python
# 重写了modeladmin负责默认页面渲染行为的changelist_view函数实现了对自定义页面的渲染:

from django.contrib import admin
from django.shortcuts import render
from models import Feedback, Feedback_Stat
from views import feedback_stats


@admin.register(Feedback_Stat)
class FeedbackStatsAdmin(admin.ModelAdmin):
    def changelist_view(self, request, extra_content=None):
        return feedback_stats(request)

# 由于重写了其 changelist_view 方法，其将会跳转到用户自定义的 feedback_stats 页面
```

***

***

* 或者

```python
 class MyAdminSite(admin.AdminSite):
     def get_app_list(self，request):
         app_list = super().get_app_list(request)
         app_list + = [
             {
            " name"："我的自定义应用程序"，
            " app_label"： " my_test_app"，
            ＃" app_url"："/admin/test_view"，
            " models"：[
                     {
                    " name"：" tcptraceroute"，
                     " object_name"：" tcptraceroute"，
                    " admin_url"：" /admin/test_view"，
                    " view_only"：True，
                    } 
               ]，
            } 
        ] 
         return app_list 
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://close.gitbook.io/yun-wei-bi-ji/python/django/18django-zi-ding-yi-ye-mian-tiao-zhuan-lian-jie.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
