Forums

Key error, while using pa_autoconfig

I am trying to deploy my web app, that uses python 3.9.

I used this command in bash: pa_autoconfigure_django.py --python==3.9 https://github.com/DimitryRukhadze/django_leasure_map

All went well, until the step "Creating web app via API". I recieved tracebask, which is on the screenshot. I assume, that it has something to do either with the python version or with something, that I've missed in the initial command.keyerror

Could anyone guide me a bit further on this one?

There is no screenshot visible in your post.

I am facing the same issue when trying to run the following command

pa_autoconfigure_django.py https://github.com/Hafiz-Saifullah/Django-Blog-Website.git --branch=new --domain=hafizsaifullah.pythonanywhere.com --python=3.9.5 --nuke

I got this error

    < Creating web app via API >
   \
    ~<:>>>>>>>>>
Traceback (most recent call last):
  File "/home/hafizsaifullah/.local/bin/pa_autoconfigure_django.py", line 49, in <module>
    main(
  File "/home/hafizsaifullah/.local/bin/pa_autoconfigure_django.py", line 34, in main
    project.create_webapp(nuke=nuke)
  File "/home/hafizsaifullah/.local/lib/python3.9/site-packages/pythonanywhere/project.py", line 44, in create_webapp
    self.webapp.create(self.python_version, self.virtualenv.path, self.project_path, nuke=nuke)
  File "/home/hafizsaifullah/.local/lib/python3.9/site-packages/pythonanywhere/api/webapp.py", line 54, in create
    post_url, "post", data={"domain_name": self.domain, "python_version": PYTHON_VERSIONS[python_version]}
KeyError: '3.9.5'

[edit by admin: formatting]

You're specifying Python 3.9.5 on the command line, and the command doesn't support such specific version specifications. You should just use 3.9 there and it will use the appropriate supported version of 3.9.