在Linux / Ubuntu机器上从Python / Django设置网络设置 [英] Setting Network settings from Python/Django on a Linux/Ubuntu machine
问题描述
基本上,我需要从Django应用程序更改以下系统设置。
- IP地址
- 子网
- 默认网关
- DNS服务器1& 2
我意识到我可以覆盖linux中的配置文件,但我想知道是否有更多的Python方式。
看看Github上的pynetlinux:
https://github.com/rlisagor/pynetlinux
这是一个很好的起点,您可以很容易地添加剩余的功能,我想象。
I'm working on a simple web interface for an embedded computer. The computer will ship with a static default ip that will then need to be updated by the install tech who may not be tech/linux savvy.
Basicly I need to change the following system settings from a Django app.
- IP Addres
- Subnet
- Default Gateway
- DNS Servers 1&2
I realize that I can could just overwrite the config files in linux but I was wondering if there is a more "Python" way of doing it.
Have a look at pynetlinux on Github:
https://github.com/rlisagor/pynetlinux
It is a good starting point and you can add the remaining functionality yourself quite easily I would imagine.
这篇关于在Linux / Ubuntu机器上从Python / Django设置网络设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!