Closed Hugz59 closed 1 year ago
Hi there!
It looks like you put the raw data directly into your html data and the whitespaces in the data were trimmed. You could put the raw data in special tags such as pre
and textarea
that treat whitespaces differently.
You can also try replacing '\n'
with '<br>'
in the raw data.
But if you want the specific information you mentioned in the second image, You could do
something like the code below. (You should actually put it directly in your html template
so that you don't have to use |safe
)
def foo(request):
...
whois = whois21.WHOIS(domain_name)
whois_data = f"""
Domain Name: {whois_data.domain}<br>
Registrar: {', '.join(whois_data.registrar_name)}<br>
Creation Date: {whois_data.creation_date}<br>
Expiration Date: {whois_data.expires_date}<br>
Name Servers: {', '.join(whois_data.name_servers)}<br>
Status: {whois_data.status}<br>
Emails: {', '.join(whois_data.emails)}<br>
Updated Date: {whois_data.updated_date}<br>
"""
return render(request, 'toolbox/whois.html', { 'whois' : whois_data })
Additional Note: Make sure you're using the latest version:
$ python -m pip install -U whois21
Hey !
Oh thanks you save my life !
I didn't think to use the
tag.I wanted to return all datas of the whois. It's working now.
Thank you very much !
Hey,
I would like to use your package for my tool but i don't know who to have a good display of the result.
In my tool, when i call your function, i have this :
I would like each result to have its own line so that it is clearer but impossible to do.
I want a result like this :
This is my code :
I'm using Django for my tool.
Any idea ?
Thx !