0

I need something simple to edit files on my server from the admin interface. I found this application https://github.com/synw/django-dirtyedit and followed all the stes to install it and it seemed fine at first sight

enter image description here but when I try to add any file I get this error:

enter image description here

What could I do to make it work? Or maybe there is something better? Thanks.

alexanderk409
  • 138
  • 1
  • 12

1 Answers1

1

Django Dirtyedit author here. From your screenshot it seems that you did not start your filepath with /. It is required and represents the root of your Django project. For example doing /templates/base.html is ok.

Note that you can not edit files outside of the Django project. This would be too dangerous.

I should make it more clear on the docs for the slash and have better error messages: I'll check that and try to handle it better, maybe by auto adding the slash if forgotten

synw
  • 237
  • 3
  • 5
  • I'm sorry, my screenshot was not very informative. I think it's not the only reason. I tried with "/mysite/static/baseppc.css" but it didn't work https://i.imgur.com/611umb3.png This file is valid https://i.imgur.com/O3wM8Hn.png – alexanderk409 Mar 03 '18 at 14:28
  • Try `/static/baseppc.css` : if mysite is the name of your project it is not needed in the path as it is the root – synw Mar 03 '18 at 14:33
  • It didn't work either. https://i.imgur.com/eCjcOUw.png My guess it could be because I didn't add something to urls.py or perhaps it's because of nginx settings. – alexanderk409 Mar 03 '18 at 14:36
  • Are you sure this is not an Nginx config issue? Does it work locally in the dev server? Its strange because dirtyedit has nothing to do with Nginx: it opens the file and save it, thats all – synw Mar 03 '18 at 14:41
  • Yes, you are right. I have a subdirectory /main on my dev server. Now I got this error https://i.imgur.com/BW2lk5z.png – alexanderk409 Mar 03 '18 at 14:48
  • Your screenshot shows an url with a domain. What about local dev server? Does it work on it? I will do a failure cases debug check soon, to be sure about all possible error cases (that are supposed to already be managed) – synw Mar 03 '18 at 15:07
  • Thank you. I finally could make it work. Very useful app. – alexanderk409 Mar 03 '18 at 19:37