On Dec 11, 10:40 am, Kashif Azeem <
kashi.az...@gmail.com> wrote:
> Thank you Shawn for the reply now i have another problem i.e. on executing
> some commands like 'vgs' or 'lvs' it didnt executed and the warning
> generated as "Running as a non-root user. Functionality may be unavailable".
> Any idea how to solve this user issue please?
Any subprocess started from django will run as the user of the
webserving process.
mod_wsgi lets you run in daemon mode as a specified user but you would
never run a web process as root.
"Daemon processes may if required also be run as a distinct user
ensuring that WSGI applications cannot interfere with each other or
access information they shouldn't be able to."
If you need to run a set number of commands, you'll have to edit your
sudoers file to allow those commands (out of this list's scope)
Depending on your project, you may want to run django behind a
cherrypy wsgi server that you can run as a user created for the
project.
-Preston
>
> --
> Kashif
>
>
>
>
>
> On Fri, Dec 11, 2009 at 10:07 PM, Shawn Milochik <
sh...@milochik.com> wrote:
> > The proper way to do that is to use the subprocess module.
>
> >
http://docs.python.org/library/subprocess.html
>
> > If you don't want to do much reading, you'll just want to look at section
> > 18.1.3.1, which gives the way to call a simple shell command the way you'd
> > do with backticks in Perl.
>
> > However, since you mentioned fdisk, maybe you're actually wanting to
> > interact with the shell command. That's more complicated, but can be done
> > with the "communicate" method of a subprocess.
>
> > Shawn
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to
django...@googlegroups.com.
> > To unsubscribe from this group, send email to
> >
django-users...@googlegroups.com<django-users%2Bunsubscribe@google
groups.com>
> > .