> For the complete documentation index, see [llms.txt](https://close.gitbook.io/yun-wei-bi-ji/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://close.gitbook.io/yun-wei-bi-ji/python/django/18django-zi-ding-yi-ye-mian-tiao-zhuan-lian-jie.md).

# 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 
```
