在官方Django教程中注册应用 [英] Registering app in official Django tutorial

查看:87
本文介绍了在官方Django教程中注册应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在遵循官方的Django教程。 我被困住了在第2部分中

I am following the official Django tutorial. I'm stuck in Part 2.

我为管理员注册了Poll对象,但从未见过。我在哪里开始调试和修复此问题?

I register the Poll object for admin but never see it. Where do I start to debug and fix this?

我在民意调查/文件夹中创建了一个admin.py:

I created an admin.py in my polls/ folder:

from polls.models import Poll
from django.contrib import admin

admin.site.register(Poll)


推荐答案

要检查的两件好事:


  1. 您是否重新启动开发服务器?

  2. 您的应用是否已添加到settings.py?即INSTALLED_APPS = {‘民意调查’,}

如果您检查了我的问题的评论,就可以看到如何解决。本质上我的问题是该应用程序不在INSTALLED_APPS中。

If you check the comments on my question you can see how this got resolved. Essentially my problem was that the app was not in INSTALLED_APPS.

感谢@Daniel Roseman和@pastylegs

Thanks to @Daniel Roseman and @pastylegs

这篇关于在官方Django教程中注册应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆