After the second time deploying the Django app to Pythonanywhere, (I re-edited and overwritten in VS code and did git push) I got the following error.
JavaScript
x
16
16
1
WARNING: Package(s) not found: django
2
Traceback (most recent call last):
3
File "/home/hogehohe/.local/bin/pa_autoconfigure_django.py", line 47, in <module>
4
main(arguments['<git-repo-url>'], arguments['--domain'], arguments['--python'], nuke=arguments.get('--nuke'))
5
File "/home/hogehohe/.local/bin/pa_autoconfigure_django.py", line 36, in main
6
project.update_settings_file()
7
File "/home/hogehohe/.local/lib/python3.6/site-packages/pythonanywhere/django_project.py", line 74, in update_settings_file
8
new_django = version.parse(self.virtualenv.get_version("django")) >= version.parse("3.1")
9
File "/home/hogehohe/.local/lib/python3.6/site-packages/pythonanywhere/virtualenvs.py", line 32, in get_version
10
output = subprocess.check_output(commands).decode()
11
File "/usr/lib/python3.6/subprocess.py", line 356, in check_output
12
**kwargs).stdout
13
File "/usr/lib/python3.6/subprocess.py", line 438, in run
14
output=stdout, stderr=stderr)
15
subprocess.CalledProcessError: Command '['/home/hogehohe/.virtualenvs/hogehohe.pythonanywhere.com/bin/pip', 'show', 'django']' returned non-zero exit status 1.
16
The command is
JavaScript
1
2
1
$ pa_autoconfigure_django.py https://github.com/[user_name]/[project_name].git --nuke
2
The first deployment succeeded but the second one is not. I don’t know the cause and how to overwrite it…
Advertisement
Answer
You need to have a requirements.txt file in your project that specifies the packages that you need for your app. I’m guessing that your first project had one that included django and that your second one does not.