Django two files upload for difference

500 Views Asked by At

I have already posted in https://stackoverflow.com/questions/26776003/how-to-use-htmldiff-in-django-to-show-difference-of-two-uploaded-files

However, I want to know if there is an easy way to upload a couple of files and submit which shows the differences between those two files in the next page. I made it work in the link above, but it won't work for large files like 4/ 5 MB.

I desperately need to solve this. Thank you.

2

There are 2 best solutions below

0
On

Have you tried running a different diff tool on the server and just dumping the HTML output? diff2html comes to mind, maybe see this answer for some more details?

1
On

it won't work for large files like 4/5 MB

The problem you might be having is the client_max_body_size or equivalent parameter in your web server's config. For example for nginx you'll find this in /etc/nginx/sites-available/yoursite.

server {
        listen 443;
        server_name yoursite.example;

        client_max_body_size 2M;