import urllib.request def main(): urllib.request.urlretrieve('https://www.gitignore.io/api/django', '.gitignore') if __name__ == "__main__": main()