Ramin,

I'm sorry but your question is not very clear. How about you capture the output of "ipconfig /all" with something like:

IPconfig = subprocess.check_output(["ipconfig", "/all"], stderr=devnull)

then add Config to your template context in a view something like:

    def get_context_data(self, *args, **kwargs):
        context = super().get_context_data(*args, **kwargs)
        context['IPconfig'] = IPconfig
        return context

Though it depends on whether you're using class based generic views or standard views for example, but just look on-line for how to add data to a templates context.

Good luck. But if you want better help, try and be more clear about what you want and how you envisage achieving it I guess, share a description or sample of your template and view etc.

Regards

Bernd.

Ramin Farajpour Cami 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



please see image attached,


--
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+unsubscr...@googlegroups.com <mailto:django-users+unsubscr...@googlegroups.com>. To post to this group, send email to django-users@googlegroups.com <mailto: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/0a2a15a4-6be1-4cde-bbac-a1274330c5da%40googlegroups.com <https://groups.google.com/d/msgid/django-users/0a2a15a4-6be1-4cde-bbac-a1274330c5da%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.


--
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+unsubscr...@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/06d5a2a8-d9fc-873c-0be1-d0d22417a0bb%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to