python安装django找不到set.up_up Django编辑器不显示

新手在使用Python安装Django并创建第一个应用时遇到问题,教程中提到的HTML编辑器未显示。在尝试访问/admin/blog/entry/add/时,只看到默认文本字段。已提供项目文件包括models.py、admin.py、urls.py和settings.py的详细内容,寻求问题诊断和解决方案。
摘要由CSDN通过智能技术生成

我正在创建我的第一个Django应用程序(我也是Python的新手,所以问题可能出在任何地方)

我将按照本教程一步一步地学习,在5:53(here)获取HTML编辑器,但是我仍然在http://127.0.0.1:8000/admin/blog/entry/add/处获得默认的文本字段

如能帮助诊断问题,我们将不胜感激。

谢谢!在

我的文件:

项目/qblog/blog/管理员py:from django.contrib import admin

from . import models

from django_markdown.admin import MarkdownModelAdmin

class EntryAdmin(MarkdownModelAdmin):

list_display = ("title" , "created")

prepopulated_fields = {"slug" : ("title", )}

admin.site.register(models.Entry, EntryAdmin)

项目/qblog/qblog/网址.py:

^{pr2}$

项目/qblog/blog/模型.py:from django.db import models

# Create your models here.

class EntryQuerySet(models.QuerySet):

def published(self):

return self.filter(publish=True)

class Entry(models.Model):

title=models.CharField(max_length=200)

body = models.TextField()

slug = models.SlugField(max_length=200,unique = True)

publish = models.BooleanField(default=True)

created = models.DateTimeField(auto_now_add = True)

modified = models.DateTimeField(auto_now = True)

objects = EntryQuerySet.as_manager()

def __str__(self):

return self.title

class Meta:

verbose_name = "Blog Entry"

verbose_name_plural = "Blog Entries"

ordering = ["-created"]

项目/qblog/qblog/设置.py:"""

Django settings for qblog project.

Generated by 'django-admin startproject' using Django 1.9.dev20150210173028.

For more information on this file, see

https://docs.djangoproject.com/en/dev/topics/settings/

For the full list of settings and their values, see

https://docs.djangoproject.com/en/dev/ref/settings/

"""

import os

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

# Quick-start development settings - unsuitable for production

# See https://docs.djangoproject.com/en/dev/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!

SECRET_KEY = 'secretkey'

# SECURITY WARNING: don't run with debug turned on in production!

DEBUG = True

TEMPLATE_DEBUG = True

ALLOWED_HOSTS = []

# Application definition

INSTALLED_APPS = [

'django.contrib.admin',

'django.contrib.auth',

'django.contrib.contenttypes',

'django.contrib.sessions',

'django.contrib.messages',

'django.contrib.staticfiles',

'blog',

'django_markdown',

]

MIDDLEWARE_CLASSES = [

'django.contrib.sessions.middleware.SessionMiddleware',

'django.middleware.common.CommonMiddleware',

'django.middleware.csrf.CsrfViewMiddleware',

'django.contrib.auth.middleware.AuthenticationMiddleware',

'django.contrib.auth.middleware.SessionAuthenticationMiddleware',

'django.contrib.messages.middleware.MessageMiddleware',

'django.middleware.clickjacking.XFrameOptionsMiddleware',

'django.middleware.security.SecurityMiddleware',

]

ROOT_URLCONF = 'qblog.urls'

TEMPLATES = [

{

'BACKEND': 'django.template.backends.django.DjangoTemplates',

'DIRS': [],

'APP_DIRS': True,

'OPTIONS': {

'context_processors': [

'django.template.context_processors.debug',

'django.template.context_processors.request',

'django.contrib.auth.context_processors.auth',

'django.contrib.messages.context_processors.messages',

],

},

},

]

WSGI_APPLICATION = 'qblog.wsgi.application'

# Database

# https://docs.djangoproject.com/en/dev/ref/settings/#databases

DATABASES = {

'default': {

'ENGINE': 'django.db.backends.sqlite3',

'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),

}

}

# Internationalization

# https://docs.djangoproject.com/en/dev/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True

# Static files (CSS, JavaScript, Images)

# https://docs.djangoproject.com/en/dev/howto/static-files/

STATIC_URL = '/static/'

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值