Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

uuid

django

azure

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.

like image 750
Martin Prater Avatar asked Dec 21 '25 18:12

Martin Prater


1 Answers

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

like image 131
StuffedChicken Avatar answered Dec 24 '25 11:12

StuffedChicken



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!