Search code examples
djangoazureuuid

Why is my Django App failing on Azure with UUID invalid syntax


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.


Solution

  • Rebuilding virtual environment from scratch, regenerating the requirements.txt file and then redeploying resolved the issue.