title: TypeError: can only concatenate str (not "DeferredAttribute") to str
body: <p>I am wondering anyone can help me in one of the thing I cannot get my around it and really bothering as I spent last two on it but couldnt make it. </p>
  
  <p>Basically, I am building an App (Django Python) to restore the information regarding all the network device e.g hostname, IP Address, S/N, Rack info etc. but I also to enable few options like Add, Edit, Delete and Connect next to device entery. I was able to create all the options except Connect option where I am completely stuck, I am trying to query database to get the IP address information and then using Popen module to open a putty window with the ssh to that IP Address device related, I tried everything I could but nothing worked, thereofrore, asking your help if you have any idea about this ? or any other alternative method for a user when he click on connect the putty or similar app will open and he just put the login credentials and get into the device. </p>
  
  <p>I am sharing my code here, let me know if I am doing something wrong. </p>
  
  <p>on the show all device page, i have this code, show.html</p>
  
  <pre><code>&lt;td&gt;&lt;a href="/connect/{{ i.ip_address }}"&gt;Connect&lt;/a&gt;&lt;/td&gt;
  &lt;!--&lt;td&gt;&lt;a href="/connect/{{ i.id }}"&gt;Connect&lt;/a&gt;&lt;/td&gt;--&gt;
  </code></pre>
  
  <p>I tried both ways, with id and ip address entry in the database </p>
  
  <p>on view.py </p>
  
  <pre><code>def connect(request, ip_address):
  hostlist_ip = HostList.ip_address
  print(hostlist_ip)
  Popen("putty.exe" + hostlist_ip)
  return redirect('/show')
  </code></pre>
  
  <p>and in the url.py</p>
  
  <pre><code>path('connect/&lt;str:ip_address&gt;', views.connect),
  or 
  path('connect/&lt;str:ip_address&gt;', views.connect),
  </code></pre>
  
  <p>Since I am also printing the the output on the terminal I notice that it is not returning the actually IP address but return this; </p>
  
  <pre><code>&lt;django.db.models.query_utils.DeferredAttribute object at 0x04B77C50&gt;
  </code></pre>
  
  <p>and on the web I receiving this error </p>
  
  <pre><code>TypeError at /connect/10.10.32.10
  can only concatenate str (not "DeferredAttribute") to str
  Request Method: GET
  Request URL: http://localhost:8000/connect/10.10.32.10
  Django Version: 2.2.3
  Exception Type: TypeError
  Exception Value:
  can only concatenate str (not "DeferredAttribute") to str
  </code></pre>
  
  <p>let me know if you can help. </p>
  
  <p>Just a F.Y.I I already tested the Popen via python but since we not getting the actual IP address from the database I am seeing this and I am a complete newbie with html/css and Djano, however I have some basic knowledge of python, so please ignore my any stupid comments in the post. </p>
  
  <h2>Many thanks</h2>