@vijin.palazhi
Thanks for spotting the error at my end .
I started all labs from start and reached the same point with right port 8000 this time .
All task till now are completed as expected and results were green ( all checks PASS )
This time I am getting error message " ModuleNotFoundError: No module named ‘wordcountbasic’ "
At the same time I am unable to see anything on the tab “project-mercury” on port 8000
I also logged into devdb01 to check whether the postgresql.service is running and it is " active " there .
I have attached those outputs as well.
Sorry I am not from linux / application background hence not able to understand how to fix these myself but eager to learn.
Great! Everything should now be in order to restart the application.
On the devapp01
start the webserver again by running the command:
- Navigate to the directory
/opt/caleston-code/mercuryProject
- Next, run the command
python3 manage.py runserver 0.0.0.0:8000
This should have been successful now.
To access the application, click on the Project Mercury
tab!
Check
-
Tasks not completed!
-
Task completed?
Command ‘docker exec -w /questions test_infra pytest test_django.py’ returned non-zero exit status 1.
Something is wrong! Is the application running?
logs
===============================================================
Output from the terminal
bob@devapp01:/opt/caleston-code$
bob@devapp01:/opt/caleston-code$ sudo python3 manage.py runserver 0.0.0.0:8000
Traceback (most recent call last): File “/usr/local/lib/python3.6/dist-packages/django/core/management/base.py”, line 323, in run_from_argv
self.execute(*args, **cmd_options) File “/usr/local/lib/python3.6/dist-packages/django/core/management/commands/runserver.py”, line 60, in execute
super().execute(*args, **options) File “/usr/local/lib/python3.6/dist-packages/django/core/management/base.py”, line 364, in execute
output = self.handle(*args, **options) File “/usr/local/lib/python3.6/dist-packages/django/core/management/commands/runserver.py”, line 67, in handle
if not settings.DEBUG and not settings.ALLOWED_HOSTS:
File “/usr/local/lib/python3.6/dist-packages/django/conf/init.py”, line 79, in getattr
self._setup(name)
File “/usr/local/lib/python3.6/dist-packages/django/conf/init.py”, line 66, in _setup
self._wrapped = Settings(settings_module)
File “/usr/local/lib/python3.6/dist-packages/django/conf/init.py”, line 157, in init
mod = importlib.import_module(self.SETTINGS_MODULE)
File “/usr/lib/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 994, in _gcd_import
File “”, line 971, in _find_and_load
File “”, line 941, in _find_and_load_unlocked
File “”, line 219, in _call_with_frames_removed
File “”, line 994, in _gcd_import
File “”, line 971, in _find_and_load
File “”, line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘wordcountbasic’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “manage.py”, line 21, in
main()
File “manage.py”, line 17, in main
execute_from_command_line(sys.argv)
File “/usr/local/lib/python3.6/dist-packages/django/core/management/init.py”, line381, in execute_from_command_line
utility.execute()
File “/usr/local/lib/python3.6/dist-packages/django/core/management/init.py”, line375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “/usr/local/lib/python3.6/dist-packages/django/core/management/base.py”, line 336, in run_from_argv
connections.close_all()
File “/usr/local/lib/python3.6/dist-packages/django/db/utils.py”, line 219, in close_all
for alias in self:
File “/usr/local/lib/python3.6/dist-packages/django/db/utils.py”, line 213, in iter
return iter(self.databases)
File “/usr/local/lib/python3.6/dist-packages/django/utils/functional.py”, line 80, in get
res = instance.dict[self.name] = self.func(instance)
File “/usr/local/lib/python3.6/dist-packages/django/db/utils.py”, line 147, in databases
self._databases = settings.DATABASES
File “/usr/local/lib/python3.6/dist-packages/django/conf/init.py”, line 79, in getattr
self._setup(name)
File “/usr/local/lib/python3.6/dist-packages/django/conf/init.py”, line 66, in _setup
self._wrapped = Settings(settings_module)
File “/usr/local/lib/python3.6/dist-packages/django/conf/init.py”, line 157, in init
mod = importlib.import_module(self.SETTINGS_MODULE)
File “/usr/lib/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 994, in _gcd_import
File “”, line 971, in _find_and_load
File “”, line 941, in _find_and_load_unlocked
File “”, line 219, in _call_with_frames_removed
File “”, line 994, in _gcd_import
File “”, line 971, in _find_and_load
File “”, line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘wordcountbasic’
bob@devapp01:/opt/caleston-code$
bob@devapp01:/opt/caleston-code$
bob@devapp01:/opt/caleston-code$ pwd
/opt/caleston-code
bob@devapp01:/opt/caleston-code$
bob@devapp01:/opt/caleston-code$ whoami
bob
bob@devapp01:/opt/caleston-code$ ls -al
total 40
drwxr-xr-x 7 mercury bob 4096 Apr 15 05:22 .
drwxr-xr-x 1 root root 4096 Jun 11 07:58 …
drwxr-xr-x 8 mercury bob 4096 Apr 15 05:22 .git
-rw-r–r-- 1 mercury bob 1998 Apr 15 05:22 .gitignore
drwxr-xr-x 3 mercury bob 4096 Apr 15 05:22 .idea
-rw-r–r-- 1 mercury bob 7 Apr 15 05:22 README.md
-rw-r–r-- 1 mercury bob 0 Apr 15 05:22 db.sqlite3
-rw-r–r-- 1 mercury bob 634 Apr 15 05:22 manage.py
drwxr-xr-x 7 mercury bob 4096 Apr 15 05:22 mercuryProject
drwxr-xr-x 2 mercury bob 4096 Apr 15 05:22 templates
drwxr-xr-x 3 mercury bob 4096 Apr 15 05:22 venv
bob@devapp01:/opt/caleston-code$
bob@devapp01:/opt/caleston-code$ date
Thu Jun 11 08:48:19 UTC 2020
bob@devapp01:/opt/caleston-code$
bob@devapp01:/opt/caleston-code$ ps -a
PID TTY TIME CMD
433 pts/0 00:00:00 ps
bob@devapp01:/opt/caleston-code$
Jun 11 07:52:57 devapp01 kernel: vda: vda1
bob@devapp01:/opt/caleston-code$
bob@devapp01:/opt/caleston-code$
bob@devapp01:/opt/caleston-code$ ssh devdb01
bob@devdb01’s password:
Permission denied, please try again.
bob@devdb01’s password:
Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-101-generic x86_64)
This system has been minimized by removing packages and content that are
not required on a system that users do not log into.
To restore this content, you can run the ‘unminimize’ command.
The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
( ____ ( ___ )( \ ( ____ ( ____ \__ /( ___ )( ( /|
| ( /| ( ) || ( | ( /| ( / ) ( | ( ) || \ ( |
| | | () || | | (_ | (_____ | | | | | || \ | |
| | | ___ || | | ) (___ ) | | | | | || (\ ) |
| | | ( ) || | | ( ) | | | | | | || | \ |
| (/| ) ( || (/| (//_) | | | | () || ) \ |
(/|/ |(/(/_) )( (______)|/ ))
The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
Last login: Thu Jun 11 08:32:59 2020 from 172.16.239.2
bob@devdb01:~$
bob@devdb01:~$
bob@devdb01:~$
bob@devdb01:~$ sudo systemctl status postgresql.service
[sudo] password for bob:
● postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enable
Active: active (exited) since Thu 2020-06-11 08:10:22 UTC; 44min ago
Process: 321 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 321 (code=exited, status=0/SUCCESS)
Jun 11 08:10:22 devdb01 systemd[1]: Starting PostgreSQL RDBMS…
Jun 11 08:10:22 devdb01 systemd[1]: Started PostgreSQL RDBMS.
lines 1-8/8 (END)
Jun 11 07:52:57 devapp01 kernel: [TTM] Initializing DMA pool allocator