Tinymce and filebrowser out the admin - django

I'm working on a django project, and I'm trying to implement a textfield form field with tinymce and filebrowser (or another solution to upload images and insert them into my text field content). I have check the aisayko package but seems like only run on admin site, and my form particularly, is not in the django admin site. how can I enable file uploads in my textfield usign rich text editor like tinymce? Thanks.

Related

YAML text editor field in Django

I am looking for a convenient way to write and edit YAML in Django admin panel.
Are there any text editors in django admin panel for YAML
solved by integrating django-ace field and in this we have support for CSS, python, HTML etc also.

How to link python file with the html file

I've started one new django project. I've linked the HTML file in the django's admin page. When I click view site in the admin page the html file has open.
In this html file there is a register button. When I click it, the html form will open for fill the details to register for signup.
When I filled the details and click submit button, the python file (signup.py) has to show the data and save in db. But I got the error
"Page not found (404)
Request Method: GET
Request URL: http://10.95.228.84:8000/signup.py?CID=aasa&user_name=sadsad&User_email=sasa%40gmail.com&DOB1=2016-08-30&Password11=sasasa&Password12=sasasa&submit=submit"
Please let me know how to link this signup.py file with this html.
What's going on is that you have a GET request to a URL that happens to be named 'signup.py' followed by the form parameters. This is not how Django fundamentally operates. Django forms automatically 'takes care of' saving new entries into the database if the forms are valid (assuming you are using a correct model and ModelForms).
I can't tell what your models are like or your urls, but I would suggest:
1) Creating Models in models.py that accurately match what you are trying to save into your database (if you haven't already)
2) Creating a view in views.py and that will link to a template (that you will need to create) displaying the data that is being saved into your database
3) Creating a url for this new view you created in urls.py
4) Editing the view that is currently handling the signup form to redirect your your view if the form is valid.
I would suggest looking at the Django tutorial. Going through it once or twice will solidify the basic workflow of using Django. This tutorial also has a solid tutorial on simple forms.
Django Tutorial
Simple Django Forms

HTML / rich text editor in Django Admin

Is there a way to have a rich text editor in the Django admin panel, as a widget for a TextField, instead of TextArea, as the admin will essentially put in a text that would be HTML text
it would basically be an HTML formatted email that would be sent out each time a certain row is created in the database table, and admin would manually input this HTML content
Thanks
Although there are lots of rich text editors(django plugins) available for admin site(like its mentioned in #obayhan's answer), I love to use ckeditor, and its a JS based editor, so its not required to install any django apps. Here its written about how to use it on admin site.
Tons of wysiwyg editors. Listed in here >> https://www.djangopackages.com/grids/g/wysiwyg/

Is there any django app for realtime preview of markdown?

I'm using django_markdown to save the markdown text in django admin. Is there some better application which can show real-time preview as in stackoverflow while writing?
I didn't notice any Django app which can handle that, but there is StackOverflow js library(pagedown) which can do it- you just have to replace widget in admin form.
http://thegoods.aj7may.com/django-bootstrap-markdown/
I developed this live preview markdown widget for Django. I Used it for my blog. I believe you could replace the textarea widget in the admin with this markdown widget.

Use django text plugin for model fields in custom plugin

Hi this is a long shot i think but here goes.....
Basically i have a few custom plugins and apps being used in my django /django-cms site. I have set tinymce up which is working fairly ok however what im wondering is it possible to use the built in text plugin for the TextField model fields in my custom plugins and apps?
so in effect the info text field for my main content plugin would actually render in the admin site as the text plugin
Like i said i think this is a long shot...
You cannot use single-plugins on models, however you can define PlaceholderFields on your custom models to put cms plugins in. So you can define a PlaceholderField, put a TextPlugin inside that placeholder and do whatever you want.
For more information, read the official documentation about this http://docs.django-cms.org/en/2.1.3/extending_cms/placeholders.html
I also had this requirement (formatted text on a django-cms plugin configuration) and ended up with the following workaround:
I installed django-tinymce and changed my TextField to an HTMLField in the CMS plugin configuration model. This will render a tinymce text editor in the plugin configuration form. You can then use the input from the HTMLField in your plugin template with the ...|safe filter.