0

My site is hosted at centos 7, lamp stack, whm/cpanel.

I created a virtual environment mp_env and installed python3.7 and Django in mp_env.

This mp_env is created in the same folder where we have public_html folder for main site. In this mp_env folder we have bin and lib. Python3.7 is installed this lib folder and Django was installed in site-packages of this lib. No. I did not do that intentionally. I just installed python and Django in mp-env. They automatically found places.

Then I created a project myproject. I could test it with ./manage.py runserver 0.0.0.0:8000.

I could change the database to mysql, create users and login to admin from web browser. It was working fine.The project folder is outsite the mp_env.

Then I created an app hello_word inside the project directory myproject using this example at https://realpython.com/get-started-with-django-1/

I have followed the steps mentioned there and used everything word by word. Now when I try ./manage.py runserver 0.0.0.0:8000, it gives error - module 'hello_world' could not be found.

NKSM
  • 5,422
  • 4
  • 25
  • 38
Sam
  • 21
  • 5
  • Share also your settings.py. Have you included `hello_world` in your `INSTALLED_APPS`? – NKSM Feb 10 '21 at 13:02
  • Yes. INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'hello_world', ] – Sam Feb 10 '21 at 14:06

1 Answers1

0

I deleted the project and created a new project inside the virtual environment folder. Then I created the app outside project folder in the virtual environment. It is working now.

Sam
  • 21
  • 5