title: How to save data with Django ckeditor in database using normal forms?
body: <p>I am working with custom form application and I want to integrate ckeditor into it. It works perfectly fine in Django Admin forms but does not work in normal forms.</p>
  
  <p>models.py</p>
  
  <pre><code>from django.db import models
  from django.contrib.auth.models import User
  from ckeditor.fields import RichTextField
  
  class Post(models.Model):
      text = RichTextField()
  
      updated = models.DateTimeField(auto_now=True)
      created = models.DateTimeField(auto_now_add=True)
  
      class Meta:
          ordering = ['created']
  
      def __unicode__(self):
           return self.text
  </code></pre>
  
  <p>urls.py</p>
  
  <pre><code>from django.conf.urls import patterns, url
  
  urlpatterns = patterns(
      'editor.views',
      url(r'^$', 'home'),
      url(r'^create_post/$', 'create_post'),
      url(r'^delete_post/$', 'delete_post'),
  )
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code>def home(req):
  
      tmpl_vars = {
          'all_posts': Post.objects.reverse(),
          'form': PostForm()
      }
      return render(req, 'editor/index.html', tmpl_vars)
  
  def create_post(request):
      if request.method == 'POST':
          post_text = request.POST.get('the_post')
          response_data = {}
          post = Post(text=post_text, author=request.user)
          post.save()
          post_form = Post()
  
          response_data['result'] = 'Create post successful!'
          response_data['postpk'] = post.pk
          response_data['text'] = post.text
          response_data['created'] = post.created.strftime('%B %d, %Y %I:%M %p')
  
          return HttpResponse(
              json.dumps(response_data),
              content_type="application/json"
          )
  
      else:
          return HttpResponse(
              json.dumps({"nothing to see": "this isn't happening"}),
              content_type="application/json"
          )
  </code></pre>
  
  <p>forms.py</p>
  
  <pre><code>class PostForm(forms.ModelForm):
      text = forms.CharField(widget = CKEditorWidget())
      class Meta:
          model = Post
  </code></pre>
  
  <p>index.html</p>
  
  <pre><code>&lt;form method="POST" id="post-form"&gt;
          {% csrf_token %}
          &lt;div id="the_post"&gt;
              {{ form.media }}
              {{ form.as_p }}
          &lt;/div&gt;
          &lt;div id="results"&gt;&lt;/div&gt;
          &lt;button type="submit"&gt;{% trans 'Submit' %}&lt;/button&gt;
   &lt;/form&gt;
  </code></pre>
  
  <p>In django admin data is saving with ckeditor, while using ckeditor in custom form data is not saving in database. Please help.</p>