Thursday, September 7, 2017

Re: How to display ipconfig /all in template html django



On Sep 7, 2017 12:10 AM, "Ramin Farajpour Cami" <ramin.blackhat@gmail.com> wrote:
Hi,

Hi,

I going to show output command "ipconfig /all" in html django template but i have string uncomfortable,

for example :

i going to show this in html :


Windows IP Configuration


PPP adapter VPN:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::50a6:e568:7895:590d%24
   IPv4 Address. . . . . . . . . . . : 172.32.87.176
   Subnet Mask . . . . . . . . . . . : 255.255.255.255
   Default Gateway . . . . . . . . . : 0.0.0.0

In your view, you would need code to execute that command, capture the output, and then provide that output to a variable in your template context. Your template would then access the variable and display the result.

Something like this library may do the heavy lifting of running the command and parsing the results for you. 


A quick Google brought that up. There may be other libraries that interact directly with the Windows internals to pull that information in a bit more of a sane manner, but I haven't looked 

-James

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2Be%2BciVgoxQQ%2BH820s%2BLdPsehGgLMAeG_7R6xBeuMie6ingw2w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment