M
M
michael ivanov2015-07-17 18:01:47
Python
michael ivanov, 2015-07-17 18:01:47

When using wysiwyg editors in django, the text is not formatted properly. What to do?

Tried using cked and django-summernote - no text formatting and can't set up image uploads . All the time some bullshit. Summernote - uploads pictures, but does not insert into text !
And yet, none of those editors that I have tried - do not format the text, or rather, do not format it correctly .
When displaying the text, I see such nonsense :
pastebin.com/k30JqLnK
Who can - help, otherwise it doesn’t work (

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Aleksey Solovyev, 2018-11-29
@Overlrdd

The error says that random_id
Vk api is not provided

random_id Unique identifier to avoid resending the message.
int (number), accessible for versions from 5.45

Here is off the vk_api documentation
Here is the code that is responsible for sending the message:
vk.messages.send(
    user_id=event.user_id,
    message='No results'
)

I don't know where you got your code from. Probably your source is outdated (or try adding radnom_id yourself, mb will work. Something like this:
vk.method('messages.send', {
    'user_id': user_id,
    'message': msg,
    'random_id': random_id
})

). VK updated something recently

A
alternativshik, 2018-11-29
@alternativshik

Try to read the VK API documentation... The text of the error is written very clearly.

W
whiteblackness, 2015-07-17
@whiteblackness

{{ var|safe|escape }}
https://docs.djangoproject.com/en/dev/ref/template...
But you need to be sure that no malicious code was embedded there.
Those. It is necessary to somehow clear the text entered by the user.
django escapes all special characters by default.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question