Forums

Error running WSGI applicationModuleNotFoundError: No module named 'dal'

I got this error when i want to use the web when i runserver on my local computer without activating virtualenv i get this message too but in pythonanywhere server i have activated the virtalenv maybe there is something wrong with activating it or any other mistake ? please give me a clue

the error :

 2018-09-15 17:21:48,785: Error running WSGI application
 2018-09-15 17:21:48,791: ModuleNotFoundError: No module named 'dal'
 2018-09-15 17:21:48,791:   File "/var/www/zg500_pythonanywhere_com_wsgi.py", line 15, in <module>
 2018-09-15 17:21:48,791:     application = get_wsgi_application() 
 2018-09-15 17:21:48,791: 
 2018-09-15 17:21:48,792:   File "/usr/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in       get_wsgi_application
2018-09-15 17:21:48,792:     django.setup(set_prefix=False)
2018-09-15 17:21:48,793: 
2018-09-15 17:21:48,793:   File "/usr/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
2018-09-15 17:21:48,793:     apps.populate(settings.INSTALLED_APPS)
2018-09-15 17:21:48,793: 
 2018-09-15 17:21:48,794:   File "/usr/lib/python3.6/site-packages/django/apps/registry.py", line 89, in populate
2018-09-15 17:21:48,794:     app_config = AppConfig.create(entry)
2018-09-15 17:21:48,794: 
2018-09-15 17:21:48,794:   File "/usr/lib/python3.6/site-packages/django/apps/config.py", line 90, in create
2018-09-15 17:21:48,794:     module = import_module(entry)
2018-09-15 17:21:48,794: ***************************************************
2018-09-15 17:21:48,794: If you're seeing an import error and don't know why,
2018-09-15 17:21:48,794: we have a dedicated help page to help you debug: 
2018-09-15 17:21:48,794: https://help.pythonanywhere.com/pages/DebuggingImportError/
2018-09-15 17:21:48,794: ***************************************************
2018-09-15 17:21:50,892: Error running WSGI application
2018-09-15 17:21:50,892: ModuleNotFoundError: No module named 'dal'
2018-09-15 17:21:50,892:   File "/var/www/zg500_pythonanywhere_com_wsgi.py", line 15, in <module>
2018-09-15 17:21:50,893:     application = get_wsgi_application()
2018-09-15 17:21:50,893: 
2018-09-15 17:21:50,893:   File "/usr/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
2018-09-15 17:21:50,893:     django.setup(set_prefix=False)
2018-09-15 17:21:50,893: 
2018-09-15 17:21:50,893:   File "/usr/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
2018-09-15 17:21:50,893:     apps.populate(settings.INSTALLED_APPS)
2018-09-15 17:21:50,893: 
2018-09-15 17:21:50,893:   File "/usr/lib/python3.6/site-packages/django/apps/registry.py", line 89, in populate
2018-09-15 17:21:50,894:     app_config = AppConfig.create(entry)
2018-09-15 17:21:50,894: 
2018-09-15 17:21:50,894:   File "/usr/lib/python3.6/site-packages/django/apps/config.py", line 90, in create
2018-09-15 17:21:50,894:     module = import_module(entry)
2018-09-15 17:21:50,894: ***************************************************
2018-09-15 17:21:50,894: If you're seeing an import error and don't know why,
2018-09-15 17:21:50,894: we have a dedicated help page to help you debug: 
2018-09-15 17:21:50,894: https://help.pythonanywhere.com/pages/DebuggingImportError/
2018-09-15 17:21:50,894: ***************************************************
2018-09-15 17:21:51,101: Error running WSGI application
2018-09-15 17:21:51,102: ModuleNotFoundError: No module named 'dal'
2018-09-15 17:21:51,102:   File "/var/www/zg500_pythonanywhere_com_wsgi.py", line 15, in <module>
2018-09-15 17:21:51,102:     application = get_wsgi_application()
2018-09-15 17:21:51,102: 
2018-09-15 17:21:51,102:   File "/usr/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
2018-09-15 17:21:51,102:     django.setup(set_prefix=False)
2018-09-15 17:21:51,103: 
2018-09-15 17:21:51,103:   File "/usr/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
2018-09-15 17:21:51,103:     apps.populate(settings.INSTALLED_APPS)
2018-09-15 17:21:51,103: 
2018-09-15 17:21:51,103:   File "/usr/lib/python3.6/site-packages/django/apps/registry.py", line 89, in populate
2018-09-15 17:21:51,103:     app_config = AppConfig.create(entry)
2018-09-15 17:21:51,104: 
2018-09-15 17:21:51,104:   File "/usr/lib/python3.6/site-packages/django/apps/config.py", line 90, in create
2018-09-15 17:21:51,104:     module = import_module(entry)
2018-09-15 17:21:51,104: ***************************************************
2018-09-15 17:21:51,104: If you're seeing an import error and don't know why,
2018-09-15 17:21:51,104: we have a dedicated help page to help you debug: 
2018-09-15 17:21:51,104: https://help.pythonanywhere.com/pages/DebuggingImportError/
2018-09-15 17:21:51,104: ***************************************************
2018-09-15 17:24:22,945: Error running WSGI application
2018-09-15 17:24:22,945: ModuleNotFoundError: No module named 'dal'
2018-09-15 17:24:22,946:   File "/var/www/zg500_pythonanywhere_com_wsgi.py", line 15, in <module>
2018-09-15 17:24:22,946:     application = get_wsgi_application()
2018-09-15 17:24:22,946: 
 2018-09-15 17:24:22,946:   File "/usr/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
 2018-09-15 17:24:22,946:     django.setup(set_prefix=False)
 2018-09-15 17:24:22,946: 
 2018-09-15 17:24:22,946:   File "/usr/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
 2018-09-15 17:24:22,946:     apps.populate(settings.INSTALLED_APPS)
 2018-09-15 17:24:22,946: 
 2018-09-15 17:24:22,946:   File "/usr/lib/python3.6/site-packages/django/apps/registry.py", line 89, in populate
 2018-09-15 17:24:22,947:     app_config = AppConfig.create(entry)
 2018-09-15 17:24:22,947: 
 2018-09-15 17:24:22,947:   File "/usr/lib/python3.6/site-packages/django/apps/config.py", line 90, in create
 2018-09-15 17:24:22,947:     module = import_module(entry)
 2018-09-15 17:24:22,947: ***************************************************
 2018-09-15 17:24:22,947: If you're seeing an import error and don't know why,
 2018-09-15 17:24:22,947: we have a dedicated help page to help you debug: 
2018-09-15 17:24:22,947: https://help.pythonanywhere.com/pages/DebuggingImportError/
2018-09-15 17:24:22,947: ***************************************************
2018-09-15 17:24:43,228: Error running WSGI application
2018-09-15 17:24:43,239: ModuleNotFoundError: No module named 'dal'
2018-09-15 17:24:43,239:   File "/var/www/zg500_pythonanywhere_com_wsgi.py", line 15, in <module>
2018-09-15 17:24:43,239:     application = get_wsgi_application()
2018-09-15 17:24:43,240: 
2018-09-15 17:24:43,240:   File "/home/zg500/.virtualenvs/zg500.pythonanywhere.com/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
2018-09-15 17:24:43,240:     django.setup(set_prefix=False)
2018-09-15 17:24:43,240: 
2018-09-15 17:24:43,240:   File "/home/zg500/.virtualenvs/zg500.pythonanywhere.com/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
2018-09-15 17:24:43,240:     apps.populate(settings.INSTALLED_APPS)
2018-09-15 17:24:43,240: 
2018-09-15 17:24:43,240:   File "/home/zg500/.virtualenvs/zg500.pythonanywhere.com/lib/python3.6/site-packages/django/apps/registry.py", line 89, in populate
2018-09-15 17:24:43,240:     app_config = AppConfig.create(entry)
2018-09-15 17:24:43,241: 
2018-09-15 17:24:43,241:   File "/home/zg500/.virtualenvs/zg500.pythonanywhere.com/lib/python3.6/site-packages/django/apps/config.py", line 90, in create
2018-09-15 17:24:43,241:     module = import_module(entry)
2018-09-15 17:24:43,241: ***************************************************
2018-09-15 17:24:43,241: If you're seeing an import error and don't know why,
2018-09-15 17:24:43,241: we have a dedicated help page to help you debug: 
2018-09-15 17:24:43,241: https://help.pythonanywhere.com/pages/DebuggingImportError/
2018-09-15 17:24:43,241: ***************************************************
2018-09-15 17:24:45,380: Error running WSGI application
2018-09-15 17:24:45,381: ModuleNotFoundError: No module named 'dal'
2018-09-15 17:24:45,381:   File "/var/www/zg500_pythonanywhere_com_wsgi.py", line 15, in <module>
2018-09-15 17:24:45,381:     application = get_wsgi_application()
2018-09-15 17:24:45,381: 
2018-09-15 17:24:45,381:   File "/home/zg500/.virtualenvs/zg500.pythonanywhere.com/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
 2018-09-15 17:24:45,382:     django.setup(set_prefix=False)
2018-09-15 17:24:45,382: 
2018-09-15 17:24:45,382:   File "/home/zg500/.virtualenvs/zg500.pythonanywhere.com/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
2018-09-15 17:24:45,382:     apps.populate(settings.INSTALLED_APPS)
2018-09-15 17:24:45,382: 
2018-09-15 17:24:45,382:   File "/home/zg500/.virtualenvs/zg500.pythonanywhere.com/lib/python3.6/site-packages/django/apps/registry.py", line 89, in populate
2018-09-15 17:24:45,382:     app_config = AppConfig.create(entry)
2018-09-15 17:24:45,382: 
2018-09-15 17:24:45,382:   File "/home/zg500/.virtualenvs/zg500.pythonanywhere.com/lib/python3.6/site-packages/django/apps/config.py", line 90, in create
 2018-09-15 17:24:45,383:     module = import_module(entry)
 2018-09-15 17:24:45,383: ***************************************************
2018-09-15 17:24:45,383: If you're seeing an import error and don't know why,
2018-09-15 17:24:45,383: we have a dedicated help page to help you debug: 
2018-09-15 17:24:45,383: ***************************************************
2018-09-15 18:08:36,001: Error running WSGI application
  2018-09-15 18:08:36,019: ModuleNotFoundError: No module named 'dal'
2018-09-15 18:08:36,019:   File "/var/www/zg500_pythonanywhere_com_wsgi.py", line 15, in <module>
 2018-09-15 18:08:36,019:     application = get_wsgi_application()
 2018-09-15 18:08:36,019: 
 2018-09-15 18:08:36,020:   File "/home/zg500/.virtualenvs/zg500.pythonanywhere.com/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
 2018-09-15 18:08:36,020: 
2018-09-15 18:08:36,020:   File "/home/zg500/.virtualenvs/zg500.pythonanywhere.com/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
 2018-09-15 18:08:36,020: 
 2018-09-15 18:08:36,020:   File "/home/zg500/.virtualenvs/zg500.pythonanywhere.com/lib/python3.6/site-packages/django/apps/registry.py", line 89, in populate
 2018-09-15 18:08:36,020: 
 2018-09-15 18:08:36,020:   File "/home/zg500/.virtualenvs/zg500.pythonanywhere.com/lib/python3.6/site-packages/django/apps/config.py", line 90, in create
2018-09-15 18:08:36,020: ***************************************************
 2018-09-15 18:08:36,020: If you're seeing an import error and don't know why,
 2018-09-15 18:08:36,020: we have a dedicated help page to help you debug: 
2018-09-15 18:08:36,020: https://help.pythonanywhere.com/pages/DebuggingImportError/
2018-09-15 18:08:36,021: ***************************************************
2018-09-15 13:55:40,265: Error running WSGI application
2018-09-15 13:55:40,267: ModuleNotFoundError: No module named 'django'
 2018-09-15 13:55:40,267:   File "/var/www/zg500_pythonanywhere_com_wsgi.py", line 14, in <module>
 2018-09-15 13:55:40,267:     from django.core.wsgi import get_wsgi_application
 2018-09-15 13:55:40,267: ***************************************************
 2018-09-15 13:55:40,267: If you're seeing an import error and don't know why,
 2018-09-15 13:55:40,267: we have a dedicated help page to help you debug: 
 2018-09-15 13:55:40,267: https://help.pythonanywhere.com/pages/DebuggingImportError/
 2018-09-15 13:55:40,268: ***************************************************
 2018-09-15 13:55:41,585: Error running WSGI application
 2018-09-15 13:55:41,585: ModuleNotFoundError: No module named 'django'
 2018-09-15 13:55:41,585:   File "/var/www/zg500_pythonanywhere_com_wsgi.py", line 14, in <module>
 2018-09-15 13:55:41,585:     from django.core.wsgi import get_wsgi_application
 2018-09-15 13:55:41,585: ***************************************************
 2018-09-15 13:55:41,586: If you're seeing an import error and don't know why,
 2018-09-15 13:55:41,586: we have a dedicated help page to help you debug: 
 2018-09-15 13:55:41,586: https://help.pythonanywhere.com/pages/DebuggingImportError/
 2018-09-15 13:55:41,586: ***************************************************
2018-09-15 14:37:13,721: Error running WSGI application
2018-09-15 14:37:13,727: ModuleNotFoundError: No module named 'django'
2018-09-15 14:37:13,728:   File "/var/www/zg500_pythonanywhere_com_wsgi.py", line 14, in <module>
2018-09-15 14:37:13,728:     from django.core.wsgi import get_wsgi_application
2018-09-15 14:37:13,728: ***************************************************
2018-09-15 14:37:13,728: If you're seeing an import error and don't know why,
2018-09-15 14:37:13,728: we have a dedicated help page to help you debug: 
2018-09-15 14:37:13,728: https://help.pythonanywhere.com/pages/DebuggingImportError/
2018-09-15 14:37:13,728: ***************************************************
2018-09-15 14:37:18,095: Error running WSGI application
2018-09-15 14:37:18,096: ModuleNotFoundError: No module named 'django'
2018-09-15 14:37:18,096:   File "/var/www/zg500_pythonanywhere_com_wsgi.py", line 14, in <module>
2018-09-15 14:37:18,096:     from django.core.wsgi import get_wsgi_application
2018-09-15 14:37:18,096: ***************************************************
2018-09-15 14:37:18,096: If you're seeing an import error and don't know why,
2018-09-15 14:37:18,096: we have a dedicated help page to help you debug: 
2018-09-15 14:37:18,096: https://help.pythonanywhere.com/pages/DebuggingImportError/
2018-09-15 14:37:18,096: ***************************************************
 2018-09-15 14:54:41,967: Error running WSGI application
 2018-09-15 14:54:41,970: ModuleNotFoundError: No module named 'django'
2018-09-15 14:54:41,970:   File "/var/www/zg500_pythonanywhere_com_wsgi.py", line 14, in <module>
2018-09-15 14:54:41,970:     from django.core.wsgi import get_wsgi_application
2018-09-15 14:54:41,970: ***************************************************
2018-09-15 14:54:41,970: If you're seeing an import error and don't know why,
2018-09-15 14:54:41,971: we have a dedicated help page to help you debug: 
2018-09-15 14:54:41,971: https://help.pythonanywhere.com/pages/DebuggingImportError/
2018-09-15 14:54:41,971: ***************************************************
2018-09-15 14:57:24,389: Error running WSGI application
2018-09-15 14:57:24,391: ModuleNotFoundError: No module named 'django'
2018-09-15 14:57:24,391:   File "/var/www/zg500_pythonanywhere_com_wsgi.py", line 14, in <module>
2018-09-15 14:57:24,391:     from django.core.wsgi import get_wsgi_application
2018-09-15 14:57:24,391: ***************************************************
2018-09-15 14:57:24,391: If you're seeing an import error and don't know why,
2018-09-15 14:57:24,391: we have a dedicated help page to help you debug: 
2018-09-15 14:57:24,392: https://help.pythonanywhere.com/pages/DebuggingImportError/
2018-09-15 14:57:24,392: ***************************************************
2018-09-15 14:57:38,407: Error running WSGI application
2018-09-15 14:57:38,407: ModuleNotFoundError: No module named 'django'
2018-09-15 14:57:38,407:   File "/var/www/zg500_pythonanywhere_com_wsgi.py", line 14, in <module>
2018-09-15 14:57:38,408:     from django.core.wsgi import get_wsgi_application
2018-09-15 14:57:38,408: ***************************************************
2018-09-15 14:57:38,408: If you're seeing an import error and don't know why,
2018-09-15 14:57:38,408: we have a dedicated help page to help you debug: 
2018-09-15 14:57:38,408: https://help.pythonanywhere.com/pages/DebuggingImportError/
2018-09-15 14:57:38,408: ***************************************************
2018-09-15 15:02:55,524: Error running WSGI application
2018-09-15 15:02:55,527: ModuleNotFoundError: No module named 'django'
2018-09-15 15:02:55,527:   File "/var/www/zg500_pythonanywhere_com_wsgi.py", line 14, in <module>
2018-09-15 15:02:55,528:     from django.core.wsgi import get_wsgi_application
2018-09-15 15:02:55,528: ***************************************************
2018-09-15 15:02:55,528: If you're seeing an import error and don't know why,
2018-09-15 15:02:55,528: we have a dedicated help page to help you debug: 
2018-09-15 15:02:55,528: https://help.pythonanywhere.com/pages/DebuggingImportError/
2018-09-15 15:02:55,528: ***************************************************

You need to install Django into the virtualenv that you're using for your web app.

I installed django but the error still exists which says :

ModuleNotFoundError: No module named 'dal'

If it's the same one as the stacktrace above, then it looks like you're trying to use a Django app that you do not have in your Django installation. Either you're trying to load an app that should be in your project directory and isn't or you're trying to use a module that you have not installed.

I have already installed the module that is related to 'dal'

Bash :

(zg500.pythonanywhere.com) 13:46 ~/zg500.pythonanywhere.com (master)$ pip install django-autocomplete-light
Looking in links: /usr/share/pip-wheels
Requirement already satisfied: django-autocomplete-light in /home/zg500/.virtualenvs/zg500.pythonanywhere.com/lib/python3.6/site-packages (3.3.1)

i dont know why all the modules are installed in my virtualenvironment as i showed in my privious post but the error said they are not installed ! django , dal and all other modules aswel do i install them in wrong path or any other mistake ?

my steps are like bellow in bash :

20:22 ~ $ mkvirtualenv --python=/usr/bin/python2.7 myproject

then :

(myproject) 20:23 ~ $ pip install Django==1.8.6

then installing all other modules

Are you sure you're looking at the right error message? When I look at the logs for your site, the most recent error (the one right at the bottom of the file) is related to not being able to find your settings module. See this help page on how to debug that specific kind of problem.

Yes , you are right . I was looking at the previouse error messages . that problem is solved now but i dont know why the appearence of my site is ruined ? all my bootstrap and styles and css codes are gone ? here is my base codes which are not loaded :

{% load static %}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" >
<link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap-rtl.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'css/style.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'css/jquery-ui.css' %}">

and in my settings :

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
STATIC_ROOT = os.path.join(BASE_DIR, 'static')

the static folder which contains font and css and.. is in this path:

home/zg500/zg500.pythonanywhere.com/BallbearingSite/static

You'll need to set up a static file mapping for your site in order to get that to work; here's the help page.

Thank you, my website is good now but why the admin section is still disordered ?

There is a guide to fix css admin on web :

The "proper" way to do it is to make sure you've got django.contrib.admin loaded in your INSTALLED_APPS, and then run collectstatic. There's a full guide to django static files here

i have alredy done all what it said but still there is no css in admin page

Could you give an example of a URL showing the problem? When I visit the login page for the admin for your site, I can see CSS.

In the guidence it showed two ways to solve the problem :

 There are two ways to fix this.

The ugly/hacky way is to add a specific static files mapping pointing at the django admin css folder:

url: /static/admin
path: /usr/local/lib/python3.4/dist-packages/django/contrib/admin/static/admin/ (or the path to the same    folder inside your virtualenv, if you're using one)

But that's an ugly hack, and you'll soon run into problems with the rest of your CSS not loading.

The "proper" way to do it is to make sure you've got django.contrib.admin loaded in your INSTALLED_APPS, and    then run collectstatic. There's a full guide to django static files here

I was trying the proper way which it said, and it was not successfull , then i tried the ugly/hacky way and it is ok now thank you again

OK -- glad you got it working eventually!