Mohamed Abdillah
Mohamed Abdillah

Reputation: 395

The main application of my website is not viewed when running it

enter image description hereI am not able to launch my website. It is showing the bellow error when running it iPlanetHoster.

ModuleNotFoundError at /home/massvnrc/myproject/myproject/myapp/templates/index.html
No module named '/myapp'
Request Method: GET
Request URL:    ***/home/massvnrc/myproject/myproject/myapp/templates/index.html
Django Version: 1.9.13
Exception Type: ModuleNotFoundError
Exception Value:    
No module named '/myapp'
Exception Location: /home/massvnrc/virtualenv/myproject/3.7/lib64/python3.7/importlib/__init__.py in import_module, line 127
Python Executable:  /home/massvnrc/virtualenv/myproject/3.7/bin/python3.7_bin
Python Version: 3.7.3
Python Path:    
['/home/massvnrc/myproject',
 '/opt/passenger-5.3.7-9.el7.cloudlinux/src/helper-scripts',
 '/home/massvnrc/virtualenv/myproject/3.7/lib64/python37.zip',
 '/home/massvnrc/virtualenv/myproject/3.7/lib64/python3.7',
 '/home/massvnrc/virtualenv/myproject/3.7/lib64/python3.7/lib-dynload',
 '/opt/alt/python37/lib64/python3.7',
 '/opt/alt/python37/lib/python3.7',
 '/home/massvnrc/virtualenv/myproject/3.7/lib/python3.7/site-packages']
Server time:    Thu, 23 Jan 2020 18:03:11 +0000

Here are some pictures that are showing where my files are located.

enter image description here

Can somebody tell me why I am getting this erro

enter image description here enter image description here enter image description here

Upvotes: 1

Views: 131

Answers (1)

Charnel
Charnel

Reputation: 4432

You deployed the website with debug mode turned on - never do this, at least without restricting access. Anyway, because of this I was able to see your urls.py:

from django.contrib import admin
from django.conf.urls import url, include
# from .import views
from django.contrib.auth import views as auth_views
urlpatterns = [
    url('admin/', admin.site.urls),
    url('', include('/myapp.urls')), ...
]

And installed apps from settings:

INSTALLED_APPS  
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles']

I do not see myapp registered in settings. You need to add it. Next is that include('/myapp.urls') should be changes to include('myapp.urls')

Upvotes: 2

Related Questions