如何使用python使我的网站不可访问

2024-05-05 19:12:47 发布

您现在位置:Python中文网/ 问答频道 /正文

因此,我使用html和python代码创建了一个网站,如果您的密码和用户名正确(blank是私有信息的替代品),则会重定向到该网站:

import time
import webbrowser
print("To access the website Enter your username and password bellow")
x=input("Username:")
y=input("Password:")
if x=="dsafro9156" and y=="D24$m?!tdy":
    print("Access granted rederecting you to the website")
    time.sleep(1)
    webbrowser.open('nasa.gov')
else:
    while x!="dsafro9156" and y!="D24$m?!tdy":
        print("Access denied. Please try again")
        print("                ")
        print("-------------------------------------------------------")
        print("                       ")
        x=input("Username:")
        y=input("Password:")
        if x=="dsafro9156" and y=="D24$m?!tdy":
            print("Access granted rederecting you to the website")
            time.sleep(1)
            webbrowser.open('nasa.gov')

    

有没有办法让网站无法访问?我不是在找黑客防护的东西,只是为了确保你不能只是把标签放在书签里,而是必须登录


Tags: andtheimportinputaccesstime网站username