django-codemirror-widget icon indicating copy to clipboard operation
django-codemirror-widget copied to clipboard

Trying to get this widget working in a view

Open radaniba opened this issue 9 years ago • 6 comments

Hello

I am trying to get the codemirror widget working on a form that I am deisplaying in a view, but following the doc, am probably missing a detail that does not exist.

I am calling the widget from the form class that I use to overwrite a generic view (CreateView). The app is added to settings.py and the codemirror_path is added as well.

Despite all this, am still not able to get it working properly.

Any clear direction on how to get this working in a view ? Is there any loading that should be done in the master html or in the block being rendered ?

An example would be more than welcome

Thanks

radaniba avatar Dec 25 '15 03:12 radaniba

Ok ! Actually we need to load individually all parts included in the rendering. As we pass the mode and the theme to the class it would be great to have something like a custom tag :

{% load codemirror %}

that can go to a header or something rather than doing it manually

radaniba avatar Dec 25 '15 04:12 radaniba

I'm sorry but I don't really get what you want. What the exact problem is?

lambdalisue avatar Dec 25 '15 11:12 lambdalisue

When you follow the steps in the readme, and you try to render a codemirror instance in a form inside a view, it wont work, unless you manually call the js and css assets in the header of the html.

radaniba avatar Dec 25 '15 15:12 radaniba

Which version of Python, Django, OS do you use?

lambdalisue avatar Dec 27 '15 03:12 lambdalisue

am using python 2.7 with Django 1.9, on a macbook pro (yosemite)

radaniba avatar Dec 27 '15 03:12 radaniba

Ok, I'll check the behavior

lambdalisue avatar Dec 27 '15 03:12 lambdalisue