How to get ckeditor field value in modelform after submit in Django2.1?How do I sort a list of dictionaries by a value of the dictionary?How to get the ASCII value of a character?How do I return multiple values from a function?How to get the current time in PythonHow do I sort a dictionary by value?How do I get the number of elements in a list?How to access environment variable values?Can't add field to ModelForm at __init__Cannot display HTML stringDjango-Rest-Framework - How to serialize queryset from an unrelated model as nested serializer

Was there an original & definitive use of alternate dimensions/realities in fiction?

Can users with the same $HOME have separate bash histories?

Squares inside a square

What is the definition of Product

How secure are public hashed passwords (with a salt)?

Can a system of three stars exist?

The 7-numbers crossword

How can I improve my formal definitions?

Does a Rogue's proficiency with a Rapier apply to the Spiral Rapier?

Is the equational theory of groups axiomatized by the associative law?

Why do we need explainable AI?

Can UV radiation be safe for the skin?

Why is the output of this find -newermt command apparently not in order?

Why do modes sound so different, although they are basically the same as a mode of another scale?

German equivalent to "going down the rabbit hole"

What are the electrical characteristics of a PC gameport?

Is Borg adaptation only temporary?

Why do motor drives have multiple bus capacitors of small value capacitance instead of a single bus capacitor of large value?

Is there anything in the universe that cannot be compressed?

Doesn't the concept of marginal utility speak to a cardinal utility function?

Displaying Time in HH:MM Format

Why wasn't Linda Hamilton in T3?

Pandas transform inconsistent behavior for list

How do I get my neighbour to stop disturbing with loud music?



How to get ckeditor field value in modelform after submit in Django2.1?


How do I sort a list of dictionaries by a value of the dictionary?How to get the ASCII value of a character?How do I return multiple values from a function?How to get the current time in PythonHow do I sort a dictionary by value?How do I get the number of elements in a list?How to access environment variable values?Can't add field to ModelForm at __init__Cannot display HTML stringDjango-Rest-Framework - How to serialize queryset from an unrelated model as nested serializer






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















  1. I have installed ckeditor.

  2. Placed "path('ckeditor/', include('ckeditor_uploader.urls'))," in urls.py

  3. Placed "'ckeditor'," in INTALLED_APPS in settings.py


  4. Placed



     ## CKEDITOR CONFIGURATION ##
    ####################################
    CKEDITOR_JQUERY_URL = 'https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js'

    CKEDITOR_UPLOAD_PATH = 'uploads/help/'
    CKEDITOR_IMAGE_BACKEND = "pillow"

    CKEDITOR_CONFIGS =
    'default':
    'toolbar': None,
    'height':100,
    'width':500,
    ,


    ###################################


    at the end of file in settings.py




  5. models.py :



    from ckeditor.fields import RichTextField
    from django.db import models
    class Help(models.Model):
    title = models.CharField(max_length=255)
    description = RichTextField(blank=True, null=True) #models.TextField()
    class Meta:
    managed = False
    db_table = 'help'
    def __str__(self):
    return self.title



  6. forms.py



    from ckeditor.widgets import CKEditorWidget
    from django import forms
    class HelpForm(ModelForm):
    description = forms.CharField(widget=CKEditorWidget())
    def __init__(self, *args, **kwargs):
    super().__init__(*args, **kwargs)

    class Meta:
    model = Help
    exclude = ('created_by', 'updated_by', 'created', 'updated')



  7. help.html



    % load i18n static widget_tweaks %
    <form id="newFrm" method="post" novalidate>
    % csrf_token %
    form.media

    <div class="col-lg-6 col-md-8 col-sm-12 col-xs-24">
    <div class="form-group">
    <label for="">description <span class="required">*</span></label>
    % if form.title.errors %
    % render_field form.description class="form-control ckeditor error" placeholder="Description" %
    <div class="error-msg show form-error">
    form.description.errors
    </div>
    % else %
    % render_field form.description class="form-control ckeditor" placeholder="Description" %
    % endif %
    </div>
    </div>




Question: I am not getting the POST value of description after form submit(in views.py). Any help will be appreciated. Thanks in advance.










share|improve this question






























    0















    1. I have installed ckeditor.

    2. Placed "path('ckeditor/', include('ckeditor_uploader.urls'))," in urls.py

    3. Placed "'ckeditor'," in INTALLED_APPS in settings.py


    4. Placed



       ## CKEDITOR CONFIGURATION ##
      ####################################
      CKEDITOR_JQUERY_URL = 'https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js'

      CKEDITOR_UPLOAD_PATH = 'uploads/help/'
      CKEDITOR_IMAGE_BACKEND = "pillow"

      CKEDITOR_CONFIGS =
      'default':
      'toolbar': None,
      'height':100,
      'width':500,
      ,


      ###################################


      at the end of file in settings.py




    5. models.py :



      from ckeditor.fields import RichTextField
      from django.db import models
      class Help(models.Model):
      title = models.CharField(max_length=255)
      description = RichTextField(blank=True, null=True) #models.TextField()
      class Meta:
      managed = False
      db_table = 'help'
      def __str__(self):
      return self.title



    6. forms.py



      from ckeditor.widgets import CKEditorWidget
      from django import forms
      class HelpForm(ModelForm):
      description = forms.CharField(widget=CKEditorWidget())
      def __init__(self, *args, **kwargs):
      super().__init__(*args, **kwargs)

      class Meta:
      model = Help
      exclude = ('created_by', 'updated_by', 'created', 'updated')



    7. help.html



      % load i18n static widget_tweaks %
      <form id="newFrm" method="post" novalidate>
      % csrf_token %
      form.media

      <div class="col-lg-6 col-md-8 col-sm-12 col-xs-24">
      <div class="form-group">
      <label for="">description <span class="required">*</span></label>
      % if form.title.errors %
      % render_field form.description class="form-control ckeditor error" placeholder="Description" %
      <div class="error-msg show form-error">
      form.description.errors
      </div>
      % else %
      % render_field form.description class="form-control ckeditor" placeholder="Description" %
      % endif %
      </div>
      </div>




    Question: I am not getting the POST value of description after form submit(in views.py). Any help will be appreciated. Thanks in advance.










    share|improve this question


























      0












      0








      0








      1. I have installed ckeditor.

      2. Placed "path('ckeditor/', include('ckeditor_uploader.urls'))," in urls.py

      3. Placed "'ckeditor'," in INTALLED_APPS in settings.py


      4. Placed



         ## CKEDITOR CONFIGURATION ##
        ####################################
        CKEDITOR_JQUERY_URL = 'https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js'

        CKEDITOR_UPLOAD_PATH = 'uploads/help/'
        CKEDITOR_IMAGE_BACKEND = "pillow"

        CKEDITOR_CONFIGS =
        'default':
        'toolbar': None,
        'height':100,
        'width':500,
        ,


        ###################################


        at the end of file in settings.py




      5. models.py :



        from ckeditor.fields import RichTextField
        from django.db import models
        class Help(models.Model):
        title = models.CharField(max_length=255)
        description = RichTextField(blank=True, null=True) #models.TextField()
        class Meta:
        managed = False
        db_table = 'help'
        def __str__(self):
        return self.title



      6. forms.py



        from ckeditor.widgets import CKEditorWidget
        from django import forms
        class HelpForm(ModelForm):
        description = forms.CharField(widget=CKEditorWidget())
        def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        class Meta:
        model = Help
        exclude = ('created_by', 'updated_by', 'created', 'updated')



      7. help.html



        % load i18n static widget_tweaks %
        <form id="newFrm" method="post" novalidate>
        % csrf_token %
        form.media

        <div class="col-lg-6 col-md-8 col-sm-12 col-xs-24">
        <div class="form-group">
        <label for="">description <span class="required">*</span></label>
        % if form.title.errors %
        % render_field form.description class="form-control ckeditor error" placeholder="Description" %
        <div class="error-msg show form-error">
        form.description.errors
        </div>
        % else %
        % render_field form.description class="form-control ckeditor" placeholder="Description" %
        % endif %
        </div>
        </div>




      Question: I am not getting the POST value of description after form submit(in views.py). Any help will be appreciated. Thanks in advance.










      share|improve this question














      1. I have installed ckeditor.

      2. Placed "path('ckeditor/', include('ckeditor_uploader.urls'))," in urls.py

      3. Placed "'ckeditor'," in INTALLED_APPS in settings.py


      4. Placed



         ## CKEDITOR CONFIGURATION ##
        ####################################
        CKEDITOR_JQUERY_URL = 'https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js'

        CKEDITOR_UPLOAD_PATH = 'uploads/help/'
        CKEDITOR_IMAGE_BACKEND = "pillow"

        CKEDITOR_CONFIGS =
        'default':
        'toolbar': None,
        'height':100,
        'width':500,
        ,


        ###################################


        at the end of file in settings.py




      5. models.py :



        from ckeditor.fields import RichTextField
        from django.db import models
        class Help(models.Model):
        title = models.CharField(max_length=255)
        description = RichTextField(blank=True, null=True) #models.TextField()
        class Meta:
        managed = False
        db_table = 'help'
        def __str__(self):
        return self.title



      6. forms.py



        from ckeditor.widgets import CKEditorWidget
        from django import forms
        class HelpForm(ModelForm):
        description = forms.CharField(widget=CKEditorWidget())
        def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        class Meta:
        model = Help
        exclude = ('created_by', 'updated_by', 'created', 'updated')



      7. help.html



        % load i18n static widget_tweaks %
        <form id="newFrm" method="post" novalidate>
        % csrf_token %
        form.media

        <div class="col-lg-6 col-md-8 col-sm-12 col-xs-24">
        <div class="form-group">
        <label for="">description <span class="required">*</span></label>
        % if form.title.errors %
        % render_field form.description class="form-control ckeditor error" placeholder="Description" %
        <div class="error-msg show form-error">
        form.description.errors
        </div>
        % else %
        % render_field form.description class="form-control ckeditor" placeholder="Description" %
        % endif %
        </div>
        </div>




      Question: I am not getting the POST value of description after form submit(in views.py). Any help will be appreciated. Thanks in advance.







      python ckeditor modelform






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 28 at 0:26









      sudhanshusudhanshu

      12 bronze badges




      12 bronze badges

























          1 Answer
          1






          active

          oldest

          votes


















          0















          I found the solution.
          Please put below script in your code.



           for (var i in CKEDITOR.instances) 
          CKEDITOR.instances[i].on('change', function()
          CKEDITOR.instances[i].updateElement() );



          This code will update the raw data of ckeditor in to related textarea.
          Now on submit the form, you will get the data in POST.






          share|improve this answer
























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55388442%2fhow-to-get-ckeditor-field-value-in-modelform-after-submit-in-django2-1%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0















            I found the solution.
            Please put below script in your code.



             for (var i in CKEDITOR.instances) 
            CKEDITOR.instances[i].on('change', function()
            CKEDITOR.instances[i].updateElement() );



            This code will update the raw data of ckeditor in to related textarea.
            Now on submit the form, you will get the data in POST.






            share|improve this answer





























              0















              I found the solution.
              Please put below script in your code.



               for (var i in CKEDITOR.instances) 
              CKEDITOR.instances[i].on('change', function()
              CKEDITOR.instances[i].updateElement() );



              This code will update the raw data of ckeditor in to related textarea.
              Now on submit the form, you will get the data in POST.






              share|improve this answer



























                0














                0










                0









                I found the solution.
                Please put below script in your code.



                 for (var i in CKEDITOR.instances) 
                CKEDITOR.instances[i].on('change', function()
                CKEDITOR.instances[i].updateElement() );



                This code will update the raw data of ckeditor in to related textarea.
                Now on submit the form, you will get the data in POST.






                share|improve this answer













                I found the solution.
                Please put below script in your code.



                 for (var i in CKEDITOR.instances) 
                CKEDITOR.instances[i].on('change', function()
                CKEDITOR.instances[i].updateElement() );



                This code will update the raw data of ckeditor in to related textarea.
                Now on submit the form, you will get the data in POST.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 28 at 23:57









                sudhanshusudhanshu

                12 bronze badges




                12 bronze badges





















                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55388442%2fhow-to-get-ckeditor-field-value-in-modelform-after-submit-in-django2-1%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                    Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript