Ckeditor responsive images and responsive tables - django

I'm using ckeditor in my django project. It's a responsive page hence everything changes when the width of the page changes except for tables and images, they remain the same size.
I'm using 'safe' filter to render everything, it works fine, but the images and tables do not resize.
How do I make them responsive for different screens sizes?
Thanks in advance.

Related

I want to update a DIV that will contain an image from a database PostgreSQL, without refreshing the entire page. Backend Django

I want to update a DIV that will contain an image, initially there is no image, the image is in a database (the images table will have a field with the image path) PostgreSQL. Every time the database loads an image (it can be at any time) the DIV must be updated, showing the new image, without refreshing the HTML page. If the user wants to see the next image loaded in the database, he will only have to refresh the page. Thank you very much for your support.
Simple solution for you...
USE AJAX

resizing images to load faster in django

Hi everyone i'm working in a blog project in django framework where you can upload images and text. I have 30 images uploaded and the page takes 2234kb for most of its images when loading and all the images are loading at the same time. So when my users hit the page (the post list page) load all the images and its make the page slower. If anyhow i could load, not all the images, but a typically 20 images at a time when they are loading and rest images will be loading when the user scroll the page. is there anything how to do it i'm using html template in django. please help me.
What you are looking for is called image lazy loading. You can find here a guide about it. It should be fairly easy to implement, if you follow the instructions.

Sitecore - Rendering an image with Glass has stopped working, but only on the Web database

So I have some components which render images using #Html.Glass().RenderImage. Seemingly overnight the images went from rendering to not. Everything works fine in experience editor which uses the master database but after publishing to the web database and browsing to the site no html is made for the render image call and no image is rendered. Other field types work fine, this is only happening to images.
What I've tried:
Using a breakpoint in the view and examining what I get in the Glass generated
model. I receive the correct sitecore item and the correct values for any non-image field, the image field is null.
Creating different components which use different images: same issue
rendering the imagefield.raw.url: null exception
Deleting the items from the web database and republishing: same issue
Deleting the glass generated code and regenerating: same issue
Renaming the image field names: same issue
A coworker even copied my component into his sitecore site (literally copy/pasted everything) and it worked just fine, image and all.
I am unsure what else to try.
This is sitecore mvc.

django cms and responsive images

I'm building an responsive website with django and django-cms. So far everything is fine. Now I'm at the point that I need to specify and to deliver responsive images to different devices. How do you solve this problem for yourself?
Is there a possibility for the website-author to upload in the backend a picture in different sizes (like small, medium, large) to use with srcset (maybe with django-cascade) Or are there automated solutions for django and django-cms like the php-project adaptive images.
I found django-daguerre but I'm not shure how it can be implemented with django-cms. There is also the django-responsive-images 1.0.2 package.
So I want to ask you how you solve this problem for your projects.
Here's what I do for responsive (and retina) images in djangocms.
I use the THUMBNAIL_HIGH_RESOLUTION = True setting of easy_thumbnails
I use cmsplugin_filer_image for my images. I overwrite its template default.html by adding srcset and Twitter bootstrap's img-responsive class to the img tags in the template.
You could of course also use foundation's interchange, retina.js or your own css/js solution to grab the desired pictures for the respective resolutions.

Django - raw_id_fields title not refreshing

I am currently having an issue when using the raw_id_field within admin.py in my Django project.
My site's admin area has a number of image upload fields for various different model pages which are all ForeignKey fields to an Image model where all images for the site are stored.
As the site will eventually be dealing with a large quantity of images (100s, maybe 1000s) the default select box would be unusable.
I created various admin.ModelAdmin classes e.g
class InfoSlideAdmin(admin.ModelAdmin):
raw_id_fields=('image',)
These change the image selector within my Edit pages from a Select Box to a Raw ID Field.
However when I select a different image using this control although the ID of the new image is shown the title from the previous image still displays.
Any ideas?
The title is refreshed via Javascript when you close the pop-up window. It's possible that you have some sort of cross-domain issue which is preventing the JS from running - this does sometimes occur when you're running via the development server on eg port 8080.
Have a look at what the console in Firebug is showing you (you are using Firebug to debug Javascript problems, aren't you?).
I do use firebug to debug issues such as this yes. However I normally use the "Net" tab and track which files are being called by the page as it loads. However you can only use the Net tab after a page refresh and this does not occur when using the raw_id control.