Task #15 Troubleshooting the Development Environment

I hit a roadblock when running the python3 command.
If I run the command I receive the following error

How do I activate the virtual environment and is this covered somewhere in the course? If I try to enter source venv/bin/activate I receive the following error
-bash: venv/bin/activate: no such file or directory

Thanks for your help

Hello @jevanspublic,
Run this command python3 manage.py migrate Then python3 manage.py runserver 0.0.0.0:8000 and finally try to access the Project Mercury portal.

Thanks,
KodeKloud Support

Thank you. That was the right way to get to the next step. I finished the project and completed the course. Unfortunately I did not see the images on the Project Mercury Sample Site. I saw the following image on the site, but was still able to complete the lab.

Hello @jevanspublic,
Thanks for reporting. the website design has been changed and this make it not matched the diagram under the task, but as long as you can open the portal without the need to run the python3 manage.py runserver 0.0.0.0:8000 so your steps are correct.

Thanks,
KodeKloud Support

ok. Thanks for confirming Ayman.

Welcome and happy learning!

For the lab, they mentioned to create virtual environment (venv) before running the below steps

python3 manage.py migrate
python3 manage.py runserver 0.0.0.0:8000

while running “python3 manage.py migrate” step I am getting below error even though django is avilable on the system.

(caleston-env) bob@devapp01:/opt/caleston-code$ python3 manage.py migrate
Traceback (most recent call last):
File “manage.py”, line 10, in main
from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named ‘django’

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “manage.py”, line 21, in
main()
File “manage.py”, line 16, in main
) from exc
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?

Could some one try to give an explanation how to resolve this issue

@Ayman please update the task description to make it clear to just run python3 migrate command (and remove ref to venv). As you can see too many queries on the same question due to the documentation ambiguity. There is no way anyone would be able to compelte the task without searching for the solution here. Cheers!

1 Like