Python 蒂尼姆斯酒店

Python 蒂尼姆斯酒店,python,django,tinymce,Python,Django,Tinymce,我正在尝试使用TinyMCE编辑器或django中的任何其他文本编辑器来编辑textarea。我真的很难找到一个好的例子或教程。在youtube上找到一个视频,但它太快了,我无法理解。任何指导都会有帮助。谢谢。 设置.py """ Django settings for ali project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For t

我正在尝试使用TinyMCE编辑器或django中的任何其他文本编辑器来编辑textarea。我真的很难找到一个好的例子或教程。在youtube上找到一个视频,但它太快了,我无法理解。任何指导都会有帮助。谢谢。

设置.py

"""
Django settings for ali project.

For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""

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

# Django settings for corating project.

PROJECT_DIR = os.path.dirname(__file__)

print 'BASE_DIR ',BASE_DIR
print 'PROJECT_DIR ',PROJECT_DIR
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '-=153zwy^8$sz%gsw#kb377pp@r3wmcer(4tc$j-h4(^3s+zw+'

# 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',
    'tinymce',
)

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'ali.urls'

WSGI_APPLICATION = 'ali.wsgi.application'


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

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}

# Internationalization
# https://docs.djangoproject.com/en/1.6/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/1.6/howto/static-files/


STATIC_ROOT = os.path.join(PROJECT_DIR, 'static_root')
# URL prefix for static files.
# Example: "http://example.com/static/", "http://static.example.com/"
STATIC_URL = '/static/'

# Additional locations of static files
STATICFILES_DIRS = (
    os.path.join(PROJECT_DIR, 'static'),
    # Put strings here, like "/home/html/static" or "C:/www/django/static".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
)

TINYMCE_JS_URL = os.path.join(STATIC_URL, "js/tiny_mce/tiny_mce.js")
TINYMCE_JS_ROOT = os.path.join(STATIC_URL, "js/tiny_mce")

print "TINYMCE_JS_ROOT  ",TINYMCE_JS_ROOT
print "TINYMCE_JS_URL   ",TINYMCE_JS_URL


TEMPLATE_DIRS = (
    '/home/hussain/django/ali/ali/templates/',
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
)
from django import forms
from django.contrib.flatpages.models import FlatPage
from tinymce.widgets import TinyMCE


class FlatPageForm(forms.ModelForm):
    content = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows': 30}))

    class Meta:
        model = FlatPage
from django.shortcuts import render_to_response
from page.forms import FlatPageForm 

def HomePage(request):
    form = FlatPageForm()
    print " form :: ",form
    return render_to_response('HomePage.html',{'form':form})
from django.conf.urls import patterns, include, url
from ali.views import HomePage
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'ali.views.home', name='home'),
    # url(r'^blog/', include('blog.urls')),

    #url(r'^admin/', include(admin.site.urls)),
    url(r'^home/', 'ali.views.HomePage' ),
    url(r'^tinymce/', include('tinymce.urls') ),

)
forms.py

"""
Django settings for ali project.

For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""

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

# Django settings for corating project.

PROJECT_DIR = os.path.dirname(__file__)

print 'BASE_DIR ',BASE_DIR
print 'PROJECT_DIR ',PROJECT_DIR
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '-=153zwy^8$sz%gsw#kb377pp@r3wmcer(4tc$j-h4(^3s+zw+'

# 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',
    'tinymce',
)

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'ali.urls'

WSGI_APPLICATION = 'ali.wsgi.application'


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

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}

# Internationalization
# https://docs.djangoproject.com/en/1.6/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/1.6/howto/static-files/


STATIC_ROOT = os.path.join(PROJECT_DIR, 'static_root')
# URL prefix for static files.
# Example: "http://example.com/static/", "http://static.example.com/"
STATIC_URL = '/static/'

# Additional locations of static files
STATICFILES_DIRS = (
    os.path.join(PROJECT_DIR, 'static'),
    # Put strings here, like "/home/html/static" or "C:/www/django/static".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
)

TINYMCE_JS_URL = os.path.join(STATIC_URL, "js/tiny_mce/tiny_mce.js")
TINYMCE_JS_ROOT = os.path.join(STATIC_URL, "js/tiny_mce")

print "TINYMCE_JS_ROOT  ",TINYMCE_JS_ROOT
print "TINYMCE_JS_URL   ",TINYMCE_JS_URL


TEMPLATE_DIRS = (
    '/home/hussain/django/ali/ali/templates/',
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
)
from django import forms
from django.contrib.flatpages.models import FlatPage
from tinymce.widgets import TinyMCE


class FlatPageForm(forms.ModelForm):
    content = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows': 30}))

    class Meta:
        model = FlatPage
from django.shortcuts import render_to_response
from page.forms import FlatPageForm 

def HomePage(request):
    form = FlatPageForm()
    print " form :: ",form
    return render_to_response('HomePage.html',{'form':form})
from django.conf.urls import patterns, include, url
from ali.views import HomePage
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'ali.views.home', name='home'),
    # url(r'^blog/', include('blog.urls')),

    #url(r'^admin/', include(admin.site.urls)),
    url(r'^home/', 'ali.views.HomePage' ),
    url(r'^tinymce/', include('tinymce.urls') ),

)
视图.py

"""
Django settings for ali project.

For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""

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

# Django settings for corating project.

PROJECT_DIR = os.path.dirname(__file__)

print 'BASE_DIR ',BASE_DIR
print 'PROJECT_DIR ',PROJECT_DIR
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '-=153zwy^8$sz%gsw#kb377pp@r3wmcer(4tc$j-h4(^3s+zw+'

# 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',
    'tinymce',
)

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'ali.urls'

WSGI_APPLICATION = 'ali.wsgi.application'


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

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}

# Internationalization
# https://docs.djangoproject.com/en/1.6/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/1.6/howto/static-files/


STATIC_ROOT = os.path.join(PROJECT_DIR, 'static_root')
# URL prefix for static files.
# Example: "http://example.com/static/", "http://static.example.com/"
STATIC_URL = '/static/'

# Additional locations of static files
STATICFILES_DIRS = (
    os.path.join(PROJECT_DIR, 'static'),
    # Put strings here, like "/home/html/static" or "C:/www/django/static".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
)

TINYMCE_JS_URL = os.path.join(STATIC_URL, "js/tiny_mce/tiny_mce.js")
TINYMCE_JS_ROOT = os.path.join(STATIC_URL, "js/tiny_mce")

print "TINYMCE_JS_ROOT  ",TINYMCE_JS_ROOT
print "TINYMCE_JS_URL   ",TINYMCE_JS_URL


TEMPLATE_DIRS = (
    '/home/hussain/django/ali/ali/templates/',
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
)
from django import forms
from django.contrib.flatpages.models import FlatPage
from tinymce.widgets import TinyMCE


class FlatPageForm(forms.ModelForm):
    content = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows': 30}))

    class Meta:
        model = FlatPage
from django.shortcuts import render_to_response
from page.forms import FlatPageForm 

def HomePage(request):
    form = FlatPageForm()
    print " form :: ",form
    return render_to_response('HomePage.html',{'form':form})
from django.conf.urls import patterns, include, url
from ali.views import HomePage
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'ali.views.home', name='home'),
    # url(r'^blog/', include('blog.urls')),

    #url(r'^admin/', include(admin.site.urls)),
    url(r'^home/', 'ali.views.HomePage' ),
    url(r'^tinymce/', include('tinymce.urls') ),

)
url.py

"""
Django settings for ali project.

For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""

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

# Django settings for corating project.

PROJECT_DIR = os.path.dirname(__file__)

print 'BASE_DIR ',BASE_DIR
print 'PROJECT_DIR ',PROJECT_DIR
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '-=153zwy^8$sz%gsw#kb377pp@r3wmcer(4tc$j-h4(^3s+zw+'

# 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',
    'tinymce',
)

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'ali.urls'

WSGI_APPLICATION = 'ali.wsgi.application'


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

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}

# Internationalization
# https://docs.djangoproject.com/en/1.6/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/1.6/howto/static-files/


STATIC_ROOT = os.path.join(PROJECT_DIR, 'static_root')
# URL prefix for static files.
# Example: "http://example.com/static/", "http://static.example.com/"
STATIC_URL = '/static/'

# Additional locations of static files
STATICFILES_DIRS = (
    os.path.join(PROJECT_DIR, 'static'),
    # Put strings here, like "/home/html/static" or "C:/www/django/static".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
)

TINYMCE_JS_URL = os.path.join(STATIC_URL, "js/tiny_mce/tiny_mce.js")
TINYMCE_JS_ROOT = os.path.join(STATIC_URL, "js/tiny_mce")

print "TINYMCE_JS_ROOT  ",TINYMCE_JS_ROOT
print "TINYMCE_JS_URL   ",TINYMCE_JS_URL


TEMPLATE_DIRS = (
    '/home/hussain/django/ali/ali/templates/',
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
)
from django import forms
from django.contrib.flatpages.models import FlatPage
from tinymce.widgets import TinyMCE


class FlatPageForm(forms.ModelForm):
    content = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows': 30}))

    class Meta:
        model = FlatPage
from django.shortcuts import render_to_response
from page.forms import FlatPageForm 

def HomePage(request):
    form = FlatPageForm()
    print " form :: ",form
    return render_to_response('HomePage.html',{'form':form})
from django.conf.urls import patterns, include, url
from ali.views import HomePage
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'ali.views.home', name='home'),
    # url(r'^blog/', include('blog.urls')),

    #url(r'^admin/', include(admin.site.urls)),
    url(r'^home/', 'ali.views.HomePage' ),
    url(r'^tinymce/', include('tinymce.urls') ),

)
错误:

Environment:


Request Method: GET
Request URL: http://localhost:8000/home/

Django Version: 1.6.1
Python Version: 2.7.3
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'tinymce')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware')


Traceback:
File "/usr/local/lib/python2.7/dist-packages/Django-1.6.1-py2.7.egg/django/core/handlers/base.py" in get_response
  114.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/hussain/django/ali/ali/views.py" in HomePage
  6.     print " form :: ",form
File "/usr/local/lib/python2.7/dist-packages/Django-1.6.1-py2.7.egg/django/utils/encoding.py" in <lambda>
  60.         klass.__str__ = lambda self: self.__unicode__().encode('utf-8')
File "/usr/local/lib/python2.7/dist-packages/Django-1.6.1-py2.7.egg/django/forms/forms.py" in __str__
  103.         return self.as_table()
File "/usr/local/lib/python2.7/dist-packages/Django-1.6.1-py2.7.egg/django/forms/forms.py" in as_table
  223.             errors_on_separate_row = False)
File "/usr/local/lib/python2.7/dist-packages/Django-1.6.1-py2.7.egg/django/forms/forms.py" in _html_output
  186.                     'field': six.text_type(bf),
File "/usr/local/lib/python2.7/dist-packages/Django-1.6.1-py2.7.egg/django/forms/forms.py" in __str__
  425.         return self.as_widget()
File "/usr/local/lib/python2.7/dist-packages/Django-1.6.1-py2.7.egg/django/forms/forms.py" in as_widget
  475.         return widget.render(name, self.value(), attrs=attrs)
File "/usr/local/lib/python2.7/dist-packages/Django-1.6.1-py2.7.egg/django/forms/widgets.py" in render
  572.         options = self.render_options(choices, value)
File "/usr/local/lib/python2.7/dist-packages/Django-1.6.1-py2.7.egg/django/forms/widgets.py" in render_options
  528.         for option_value, option_label in chain(self.choices, choices):
File "/usr/local/lib/python2.7/dist-packages/Django-1.6.1-py2.7.egg/django/forms/models.py" in __iter__
  1044.             for obj in self.queryset.all():
File "/usr/local/lib/python2.7/dist-packages/Django-1.6.1-py2.7.egg/django/db/models/query.py" in __iter__
  96.         self._fetch_all()
File "/usr/local/lib/python2.7/dist-packages/Django-1.6.1-py2.7.egg/django/db/models/query.py" in _fetch_all
  854.             self._result_cache = list(self.iterator())
File "/usr/local/lib/python2.7/dist-packages/Django-1.6.1-py2.7.egg/django/db/models/query.py" in iterator
  220.         for row in compiler.results_iter():
File "/usr/local/lib/python2.7/dist-packages/Django-1.6.1-py2.7.egg/django/db/models/sql/compiler.py" in results_iter
  710.         for rows in self.execute_sql(MULTI):
File "/usr/local/lib/python2.7/dist-packages/Django-1.6.1-py2.7.egg/django/db/models/sql/compiler.py" in execute_sql
  781.         cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/Django-1.6.1-py2.7.egg/django/db/backends/util.py" in execute
  69.             return super(CursorDebugWrapper, self).execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/Django-1.6.1-py2.7.egg/django/db/backends/util.py" in execute
  53.                 return self.cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/Django-1.6.1-py2.7.egg/django/db/utils.py" in __exit__
  99.                 six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/usr/local/lib/python2.7/dist-packages/Django-1.6.1-py2.7.egg/django/db/backends/util.py" in execute
  53.                 return self.cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/Django-1.6.1-py2.7.egg/django/db/backends/sqlite3/base.py" in execute
  450.         return Database.Cursor.execute(self, query, params)

Exception Type: OperationalError at /home/
Exception Value: no such table: django_site
环境:
请求方法:获取
请求URL:http://localhost:8000/home/
Django版本:1.6.1
Python版本:2.7.3
已安装的应用程序:
(“django.contrib.admin”,
“django.contrib.auth”,
“django.contrib.contenttypes”,
“django.contrib.sessions”,
“django.contrib.messages”,
“django.contrib.staticfiles”,
"tinymce")
已安装的中间件:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
“django.middleware.csrf.CsrfViewMiddleware”,
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.xframeoptions中间件')
回溯:
get_响应中的文件“/usr/local/lib/python2.7/dist packages/Django-1.6.1-py2.7.egg/Django/core/handlers/base.py”
114响应=包装的回调(请求,*回调参数,**回调参数)
主页中的文件“/home/hussain/django/ali/ali/views.py”
6.打印“表格::”,表格
文件“/usr/local/lib/python2.7/dist packages/Django-1.6.1-py2.7.egg/Django/utils/encoding.py”
60klass.\uuuu str\uuuu=lambda self:self.\uuuuuu unicode\uuuuu().encode('utf-8'))
__str中的文件“/usr/local/lib/python2.7/dist packages/Django-1.6.1-py2.7.egg/Django/forms/forms.py”__
103返回self.as_表()
as_表中的文件“/usr/local/lib/python2.7/dist packages/Django-1.6.1-py2.7.egg/Django/forms/forms.py”
223错误(在单独的行上=错误)
html输出中的文件“/usr/local/lib/python2.7/dist packages/Django-1.6.1-py2.7.egg/Django/forms/forms.py”
186.                     '字段“:6.文本类型(bf),
__str中的文件“/usr/local/lib/python2.7/dist packages/Django-1.6.1-py2.7.egg/Django/forms/forms.py”__
425返回self.as_小部件()
as_小部件中的文件“/usr/local/lib/python2.7/dist packages/Django-1.6.1-py2.7.egg/Django/forms/forms.py”
475return widget.render(名称,self.value(),attrs=attrs)
render中的文件“/usr/local/lib/python2.7/dist packages/Django-1.6.1-py2.7.egg/Django/forms/widgets.py”
572选项=self.render_选项(选项,值)
render_选项中的文件“/usr/local/lib/python2.7/dist packages/Django-1.6.1-py2.7.egg/Django/forms/widgets.py”
528对于选项值,选项标签位于链中(self.choices,choices):
iter中的文件“/usr/local/lib/python2.7/dist packages/Django-1.6.1-py2.7.egg/Django/forms/models.py”__
1044对于self.queryset.all()中的obj:
iter中的文件“/usr/local/lib/python2.7/dist packages/Django-1.6.1-py2.7.egg/Django/db/models/query.py”__
96self._fetch_all()
文件“/usr/local/lib/python2.7/dist packages/Django-1.6.1-py2.7.egg/Django/db/models/query.py”
854self.\u result\u cache=list(self.iterator())
迭代器中的文件“/usr/local/lib/python2.7/dist packages/Django-1.6.1-py2.7.egg/Django/db/models/query.py”
220对于编译器.results\u iter()中的行:
结果文件中的文件“/usr/local/lib/python2.7/dist packages/Django-1.6.1-py2.7.egg/Django/db/models/sql/compiler.py”
710对于self.execute_sql(多)中的行:
execute_sql中的文件“/usr/local/lib/python2.7/dist packages/Django-1.6.1-py2.7.egg/Django/db/models/sql/compiler.py”
781cursor.execute(sql,params)
execute中的文件“/usr/local/lib/python2.7/dist packages/Django-1.6.1-py2.7.egg/Django/db/backends/util.py”
69返回super(CursorDebugWrapper,self).execute(sql,params)
execute中的文件“/usr/local/lib/python2.7/dist packages/Django-1.6.1-py2.7.egg/Django/db/backends/util.py”
53返回self.cursor.execute(sql,params)
文件“/usr/local/lib/python2.7/dist packages/Django-1.6.1-py2.7.egg/Django/db/utils.py”位于__
996.重新播放(dj_exc_类型、dj_exc_值、回溯)
execute中的文件“/usr/local/lib/python2.7/dist packages/Django-1.6.1-py2.7.egg/Django/db/backends/util.py”
53返回self.cursor.execute(sql,params)
execute中的文件“/usr/local/lib/python2.7/dist packages/Django-1.6.1-py2.7.egg/Django/db/backends/sqlite3/base.py”
450返回Database.Cursor.execute(self、query、params)
异常类型:主/主操作错误/
异常值:无此类表:django_站点

有这样一个项目:


基本上你可以下载项目,下载tinymce。将tinymce文件添加到模板中,然后按照django tinymce项目中的配置教程进行操作。

Yitsaeb我需要一些帮助。我正在阅读文档,但在这里看到一个错误,读取
异常值:未定义名称“ModelForm”
您有什么想法吗?如果您没有看到更多代码,就不会有。您的代码中是否有此代码所需的导入。这个错误指的是您没有从django.Odif导入forms.ModelForm,我更新了我的问题。这个更新对任何人都没有多大帮助。如果出现错误,则应发布完整的错误消息。您还可以从视图中删除此打印,因为它不起任何作用。另外,render_to_response应该包括context_实例,否则将不使用context处理器。回溯显示您可能没有创建数据库某种数据库表,因为它清楚地表明:没有这样的表:django_站点