0

I am using Django 1.5.4 to design a web page in which i want to use GPIO, but i got following error:

"Noᅠaccessᅠtoᅠ/dev/mem. Tryᅠrunningᅠasᅠroot! "

in browser. Since web browser itself is an application, how can i assign "root" privileges to it when it tried to render a web page ? If it can be done without any need to install anything that would be better as other frameworks/applications who are able to use GPIO in web page must have made some tweaks.I tried searching for similar questions for this area but couldn't find this specific case ( django + gpio access).

Any help would be greatly appreciated.

Thanks

1
  • 1
    No.... not the browser. The web server. It needs to be running as root (make sure you understand what django is - it's server-side.) Commented Oct 31, 2013 at 9:01

1 Answer 1

2

You don't have to run the webbrowser as root but your django app (the webserver).

Of course running a web application as root is an incredibly bad idea (even on a pi), so you might want to use a separate worker process (e.g. using celery) that runs as root and accesses the GPIOs.

Sign up to request clarification or add additional context in comments.

4 Comments

nice thinking ! i have run django webserver with sudo. still i got the same error :(
i ran all django webserver, idle (to edit the server web page) & dillo (web browser) with root. still getting the same error !!
Did you verify it's running as root or did you just assume it to be the case?
ya..i did that verification. Django server is running as root! The problem when i tried to use GPIO.input(), i got this error. Isn't there separate way to achieve the same without using this method ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.