Websites
- class website.Website[source]
Interface for PythonAnywhere websites API.
Uses
pythonanywhere_core.basefunctionget_api_endpointto create url, which is stored in a class variableWebsite.api_endpoint, then callscall_apiwith appropriate arguments to execute websites action.- Methods:
Website.create(): Create a new website.Website.get(): Retrieve information about a specific website.Website.list(): Get a list of all websites.Website.reload(): Reload the website.Website.auto_ssl(): Create and apply a Let’s Encrypt SSL certificate.Website.get_ssl_info(): Get SSL certificate information.Website.delete(): Delete a website.
- auto_ssl(domain_name: str) dict[source]
Creates and applies a Let’s Encrypt certificate for
domain_name. :param domain_name: domain name for website to apply the certificate to :return: dictionary with response
- create(domain_name: str, command: str) dict[source]
Creates new website with
domain_nameandcommand.- Parameters:
domain_name – domain name for new website
command – command for new website
- Returns:
dictionary with created website info
- delete(domain_name: str) dict[source]
Deletes website with
domain_name. :param domain_name: domain name for website to delete :return: empty dictionary
- get(domain_name: str) dict[source]
Returns dictionary with website info for
domain_name. :param domain_name: :return: dictionary with website info
- get_ssl_info(domain_name) dict[source]
Get SSL certificate info :param domain_name: domain name for website to get SSL info :return: dictionary with SSL certificate info