My Django App runs fine locally on macOS Catalina with Python 3.8.2 and Django 3.0.5. I am deploying it to Azure as WebApp from Github selecting Python 3.8. I have provisioned the Postgres DB, the Storage Account and the WebApp. The build process is successful. The WebApp fails at startup with:
File "/antenv/lib/python3.8/site-packages/django/db/models/fields/__init__.py", line 6, in <module>
import uuid
File "/antenv/lib/python3.8/site-packages/uuid.py", line 138
if not 0 <= time_low < 1<<32L:
^
SyntaxError: invalid syntax
I have verified that the uuid package is not within my requirements.txt file. DB environment variables are set up. Collectstatic successfully replicated my static data. The WebApp is running with Docker.
Any help on this greatly appreciated.
EDIT
Rebuilt virtual environment and regenerated requirements.txt file and redeployed. This solved the issue.
Don't leave uuid == 1.30 or any version in your requirements.txt. If you want to use uuid library, simply a import uuid is enough cuz it is built in python3 already. This solution works for me. I am using Python 3.9.7. Here is my Azure error log with uuid == 1.30 included in requirements.txt. Hope this helps. Azure log
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With