opening a client file

30 views
Skip to first unread message

John Richardson

unread,
Aug 12, 2018, 8:48:33 AM8/12/18
to Django users
I have a django application running on my LAN prior to deployment.
The web and database servers run on ip 192.168.1.196
The client run on a pc at IP 192.168.1.249.
The application allows client users to store
file-paths to selected documents in the server's database.

What I'd like to be able to do is to allow the client users
to OPEN their documents via their webbrowers for editing.

E.g with a filepath of /Users/jR/desktop/FAKE POEM.txt

The client's webbrowser/django/python should open the
default LOCAL text processing software on IP 192.168.1.249
N.B. the file could be .docx, .odt, .rtf, .pdf or .txt

I have tried using this python:

webbrowser.open_new('file://192.168.1.249/Users/jR/desktop/FAKE POEM.txt')

but nothing happens. Can you tell me:

a) if this is possible?

and

b) if it is - how to do it

Should I be considering using an RPC or what?

Thanks
jR.

Mikhailo Keda

unread,
Aug 13, 2018, 12:35:14 PM8/13/18
to Django users
a) It's posible, at last for txt file if you have read/white access to the file (via ftp, ssh, ...)
b) implement get method to display file content in textarea and post method to save user changes


P.S. For ODF check https://webodf.org , for rtf - https://quilljs.com , for docx and pdf there no ready to use solution.
Reply all
Reply to author
Forward
0 new messages