How to upload images (like from my computer) to my django-tinymce formField?Need a minimal Django file upload exampleException UnicodeEncodeError while uploading an imageRadio buttons in django admin'NoneType' object is not subscriptable in using django smart selectsDjango-Rest-Framework - How to serialize queryset from an unrelated model as nested serializerDjango - 'TypeError: expected string or bytes-like object' when clearing an uploaded image with CloudinaryCustomer User Authentication error : AttributeError: Manager isn't available; 'auth.User' has been swapped for 'user_management.CustomUser'django how to hide specific form filed and loop data inputHow to edit requested params in Django Admin Page?Direct assignment to the forward side of a many-to-many set is prohibited. Use particular.set() instead

Unethical behavior : should I report it?

Could the rotation of a black hole cause other planets to rotate?

Does academia have a lazy work culture?

Commercial jet accompanied by small plane near Seattle

Does a Rogue's Evasion work for spells?

Correlation length anisotropy in the 2D Ising model

How to apply the changes to my `.zshrc` file after edit?

Is a topological space considered to be a class in set theory?

The best place for swimming in Arctic Ocean

Checking if an integer is a member of an integer list

Why didn't Britain or any other European power colonise Abyssinia/Ethiopia before 1936?

Are there any examples of technologies have been lost over time?

Defining a Function programmatically

How much were the LMs maneuvered to their landing points?

Send a single HTML email from Thunderbird, overriding the default "plain text" setting

The Sword in the Stone

Are the named pipe created by `mknod` and the FIFO created by `mkfifo` equivalent?

Why isn't there a serious attempt at creating a third mass-appeal party in the US?

Decreasing star size

Old French song lyrics with the word "baiser."

Did the IBM PC use the 8088's NMI line?

Why do planes need a roll motion?

How to store my pliers and wire cutters on my desk?

Am I allowed to use personal conversation as a source?



How to upload images (like from my computer) to my django-tinymce formField?


Need a minimal Django file upload exampleException UnicodeEncodeError while uploading an imageRadio buttons in django admin'NoneType' object is not subscriptable in using django smart selectsDjango-Rest-Framework - How to serialize queryset from an unrelated model as nested serializerDjango - 'TypeError: expected string or bytes-like object' when clearing an uploaded image with CloudinaryCustomer User Authentication error : AttributeError: Manager isn't available; 'auth.User' has been swapped for 'user_management.CustomUser'django how to hide specific form filed and loop data inputHow to edit requested params in Django Admin Page?Direct assignment to the forward side of a many-to-many set is prohibited. Use particular.set() instead






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








0















I have an HTML page (not django admin) showing a WYSIYYG tinymce field:
What i need to do with it is writing some text (it works), upload some images to illustrate the text (it doesn't work) and finally if possible give a class to these uploaded images.



This is for a kind of 'page' generator, every content written in the edidor will show up as new page on my webite.



the form :



class PageForm(forms.Form):
name = forms.CharField(max_length=255)
content = forms.CharField(widget=TinyMCE())


the model:



class Page(models.Model):
name = models.CharField(max_length=255,
null=False,
blank=False,
unique=True,)
content = models.TextField(null=False,
blank=False)
slug = models.CharField(max_length=255)

def save(self, *args, **kwargs):
self.slug = slugify(self.name)
super(Page, self).save(*args, **kwargs)


the html page (basic):



<body>
% if error %
<p>Une erreur est survenue</p>
% endif %

% if action == "update-page" %
<form method="post" action="% url "page_update" page.slug %">
% elif action == "create-page" %
<form method="post" action="% url 'page_create' %">
% endif %
% csrf_token %
form.as_p
<input type="submit" value="Enregistrer" />
</form>
</body>


For the moment when i click on the insert/edit icon it just offers me to give a 'link' and not upload an image.



So how do i have to setup my django and/or setup tinymce



Thank you.
(please consider in your answers that my english and my dev lvl is sometimes too weak to understand some parts of technical documentation)










share|improve this question






























    0















    I have an HTML page (not django admin) showing a WYSIYYG tinymce field:
    What i need to do with it is writing some text (it works), upload some images to illustrate the text (it doesn't work) and finally if possible give a class to these uploaded images.



    This is for a kind of 'page' generator, every content written in the edidor will show up as new page on my webite.



    the form :



    class PageForm(forms.Form):
    name = forms.CharField(max_length=255)
    content = forms.CharField(widget=TinyMCE())


    the model:



    class Page(models.Model):
    name = models.CharField(max_length=255,
    null=False,
    blank=False,
    unique=True,)
    content = models.TextField(null=False,
    blank=False)
    slug = models.CharField(max_length=255)

    def save(self, *args, **kwargs):
    self.slug = slugify(self.name)
    super(Page, self).save(*args, **kwargs)


    the html page (basic):



    <body>
    % if error %
    <p>Une erreur est survenue</p>
    % endif %

    % if action == "update-page" %
    <form method="post" action="% url "page_update" page.slug %">
    % elif action == "create-page" %
    <form method="post" action="% url 'page_create' %">
    % endif %
    % csrf_token %
    form.as_p
    <input type="submit" value="Enregistrer" />
    </form>
    </body>


    For the moment when i click on the insert/edit icon it just offers me to give a 'link' and not upload an image.



    So how do i have to setup my django and/or setup tinymce



    Thank you.
    (please consider in your answers that my english and my dev lvl is sometimes too weak to understand some parts of technical documentation)










    share|improve this question


























      0












      0








      0








      I have an HTML page (not django admin) showing a WYSIYYG tinymce field:
      What i need to do with it is writing some text (it works), upload some images to illustrate the text (it doesn't work) and finally if possible give a class to these uploaded images.



      This is for a kind of 'page' generator, every content written in the edidor will show up as new page on my webite.



      the form :



      class PageForm(forms.Form):
      name = forms.CharField(max_length=255)
      content = forms.CharField(widget=TinyMCE())


      the model:



      class Page(models.Model):
      name = models.CharField(max_length=255,
      null=False,
      blank=False,
      unique=True,)
      content = models.TextField(null=False,
      blank=False)
      slug = models.CharField(max_length=255)

      def save(self, *args, **kwargs):
      self.slug = slugify(self.name)
      super(Page, self).save(*args, **kwargs)


      the html page (basic):



      <body>
      % if error %
      <p>Une erreur est survenue</p>
      % endif %

      % if action == "update-page" %
      <form method="post" action="% url "page_update" page.slug %">
      % elif action == "create-page" %
      <form method="post" action="% url 'page_create' %">
      % endif %
      % csrf_token %
      form.as_p
      <input type="submit" value="Enregistrer" />
      </form>
      </body>


      For the moment when i click on the insert/edit icon it just offers me to give a 'link' and not upload an image.



      So how do i have to setup my django and/or setup tinymce



      Thank you.
      (please consider in your answers that my english and my dev lvl is sometimes too weak to understand some parts of technical documentation)










      share|improve this question
















      I have an HTML page (not django admin) showing a WYSIYYG tinymce field:
      What i need to do with it is writing some text (it works), upload some images to illustrate the text (it doesn't work) and finally if possible give a class to these uploaded images.



      This is for a kind of 'page' generator, every content written in the edidor will show up as new page on my webite.



      the form :



      class PageForm(forms.Form):
      name = forms.CharField(max_length=255)
      content = forms.CharField(widget=TinyMCE())


      the model:



      class Page(models.Model):
      name = models.CharField(max_length=255,
      null=False,
      blank=False,
      unique=True,)
      content = models.TextField(null=False,
      blank=False)
      slug = models.CharField(max_length=255)

      def save(self, *args, **kwargs):
      self.slug = slugify(self.name)
      super(Page, self).save(*args, **kwargs)


      the html page (basic):



      <body>
      % if error %
      <p>Une erreur est survenue</p>
      % endif %

      % if action == "update-page" %
      <form method="post" action="% url "page_update" page.slug %">
      % elif action == "create-page" %
      <form method="post" action="% url 'page_create' %">
      % endif %
      % csrf_token %
      form.as_p
      <input type="submit" value="Enregistrer" />
      </form>
      </body>


      For the moment when i click on the insert/edit icon it just offers me to give a 'link' and not upload an image.



      So how do i have to setup my django and/or setup tinymce



      Thank you.
      (please consider in your answers that my english and my dev lvl is sometimes too weak to understand some parts of technical documentation)







      django django-forms tinymce django-tinymce






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 26 at 20:20







      Paul Choppin

















      asked Mar 26 at 18:48









      Paul ChoppinPaul Choppin

      238 bronze badges




      238 bronze badges






















          2 Answers
          2






          active

          oldest

          votes


















          0














          For image handling, I'd suggest you to use the popular Pillow library and a models.ImageField.



          This field only saves the URL / path of the image and not the actual image within the database. However, django saves the actual image in your static files assets folder.



          The image will be served by your server when you put something like into a template containing the image object as a context variable.



          A great tutorial is here: https://coderwall.com/p/bz0sng/simple-django-image-upload-to-model-imagefield






          share|improve this answer























          • Hello I get this, but my question is specific about the use of tinymce. I want to be able to upload images through the editor and not have a specific field for the images.

            – Paul Choppin
            Mar 26 at 20:11


















          0














          finally i found exactly what I was looking for here:



          https://fosstack.com/how-to-set-up-tinymce-in-django-app/



          So if you what to setup a WYSIWYG editor in your django project, be able to upload images/files from the client computer and use it in admin and/or in your personalised forms just follow the steps, if it doesn't work perfectly you may need to check the code he uploaded on github witch is a bit different but functional with the very lasts versions of django (2.1 if you read this in 2054).






          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%2f55364313%2fhow-to-upload-images-like-from-my-computer-to-my-django-tinymce-formfield%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            For image handling, I'd suggest you to use the popular Pillow library and a models.ImageField.



            This field only saves the URL / path of the image and not the actual image within the database. However, django saves the actual image in your static files assets folder.



            The image will be served by your server when you put something like into a template containing the image object as a context variable.



            A great tutorial is here: https://coderwall.com/p/bz0sng/simple-django-image-upload-to-model-imagefield






            share|improve this answer























            • Hello I get this, but my question is specific about the use of tinymce. I want to be able to upload images through the editor and not have a specific field for the images.

              – Paul Choppin
              Mar 26 at 20:11















            0














            For image handling, I'd suggest you to use the popular Pillow library and a models.ImageField.



            This field only saves the URL / path of the image and not the actual image within the database. However, django saves the actual image in your static files assets folder.



            The image will be served by your server when you put something like into a template containing the image object as a context variable.



            A great tutorial is here: https://coderwall.com/p/bz0sng/simple-django-image-upload-to-model-imagefield






            share|improve this answer























            • Hello I get this, but my question is specific about the use of tinymce. I want to be able to upload images through the editor and not have a specific field for the images.

              – Paul Choppin
              Mar 26 at 20:11













            0












            0








            0







            For image handling, I'd suggest you to use the popular Pillow library and a models.ImageField.



            This field only saves the URL / path of the image and not the actual image within the database. However, django saves the actual image in your static files assets folder.



            The image will be served by your server when you put something like into a template containing the image object as a context variable.



            A great tutorial is here: https://coderwall.com/p/bz0sng/simple-django-image-upload-to-model-imagefield






            share|improve this answer













            For image handling, I'd suggest you to use the popular Pillow library and a models.ImageField.



            This field only saves the URL / path of the image and not the actual image within the database. However, django saves the actual image in your static files assets folder.



            The image will be served by your server when you put something like into a template containing the image object as a context variable.



            A great tutorial is here: https://coderwall.com/p/bz0sng/simple-django-image-upload-to-model-imagefield







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Mar 26 at 19:45









            Ben JordanBen Jordan

            965 bronze badges




            965 bronze badges












            • Hello I get this, but my question is specific about the use of tinymce. I want to be able to upload images through the editor and not have a specific field for the images.

              – Paul Choppin
              Mar 26 at 20:11

















            • Hello I get this, but my question is specific about the use of tinymce. I want to be able to upload images through the editor and not have a specific field for the images.

              – Paul Choppin
              Mar 26 at 20:11
















            Hello I get this, but my question is specific about the use of tinymce. I want to be able to upload images through the editor and not have a specific field for the images.

            – Paul Choppin
            Mar 26 at 20:11





            Hello I get this, but my question is specific about the use of tinymce. I want to be able to upload images through the editor and not have a specific field for the images.

            – Paul Choppin
            Mar 26 at 20:11













            0














            finally i found exactly what I was looking for here:



            https://fosstack.com/how-to-set-up-tinymce-in-django-app/



            So if you what to setup a WYSIWYG editor in your django project, be able to upload images/files from the client computer and use it in admin and/or in your personalised forms just follow the steps, if it doesn't work perfectly you may need to check the code he uploaded on github witch is a bit different but functional with the very lasts versions of django (2.1 if you read this in 2054).






            share|improve this answer



























              0














              finally i found exactly what I was looking for here:



              https://fosstack.com/how-to-set-up-tinymce-in-django-app/



              So if you what to setup a WYSIWYG editor in your django project, be able to upload images/files from the client computer and use it in admin and/or in your personalised forms just follow the steps, if it doesn't work perfectly you may need to check the code he uploaded on github witch is a bit different but functional with the very lasts versions of django (2.1 if you read this in 2054).






              share|improve this answer

























                0












                0








                0







                finally i found exactly what I was looking for here:



                https://fosstack.com/how-to-set-up-tinymce-in-django-app/



                So if you what to setup a WYSIWYG editor in your django project, be able to upload images/files from the client computer and use it in admin and/or in your personalised forms just follow the steps, if it doesn't work perfectly you may need to check the code he uploaded on github witch is a bit different but functional with the very lasts versions of django (2.1 if you read this in 2054).






                share|improve this answer













                finally i found exactly what I was looking for here:



                https://fosstack.com/how-to-set-up-tinymce-in-django-app/



                So if you what to setup a WYSIWYG editor in your django project, be able to upload images/files from the client computer and use it in admin and/or in your personalised forms just follow the steps, if it doesn't work perfectly you may need to check the code he uploaded on github witch is a bit different but functional with the very lasts versions of django (2.1 if you read this in 2054).







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 28 at 11:16









                Paul ChoppinPaul Choppin

                238 bronze badges




                238 bronze badges



























                    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%2f55364313%2fhow-to-upload-images-like-from-my-computer-to-my-django-tinymce-formfield%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