carltongibson / rest-framework-tutorial

62 stars 65 forks source link

Azure function deploy: Couldn't import Django #11

Open Jerome-Celle opened 4 years ago

Jerome-Celle commented 4 years ago

Hi,

I try to deploy your example to azure function. The goals it's to test this service for a Django project on azure function.

But I got this error when I execute the deploy command:

func azure functionapp publish testAppTimeManager

Done in 118 sec(s).
Done running pip install.

Content in source directory is a Django app
Running collectstatic ...
Traceback (most recent call last):
  File "manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "manage.py", line 14, in <module>
    import django
ModuleNotFoundError: No module named 'django'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "manage.py", line 17, in <module>
    "Couldn't import Django. Are you sure it's installed and "
ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
'collectstatic' exited with exit code 1.
Done in 0 sec(s).

I see in previous log that the pip install is ok, event Django is installed (I can provide the all log) But the error says: ModuleNotFoundError: No module named 'django'

Do you have an idea? I guess I just miss a small thing

Jerome