Forums

Error running WSGI application

Hi, I am getting the error, Error running WSGI application Django.core.exceptions.ImproperlyConfigured: Application labels aren't unique, duplicates: pages File "/var/www/sadata_pythonanywhere_com_wsgi.py", line 22, in <module> when I try to enter my webpage. Is there any fix to this?

2021-10-09 14:40:09,077: If you're seeing an import error and don't know why,
2021-10-09 14:40:09,077: we have a dedicated help page to help you debug: 
2021-10-09 14:40:09,077: https://help.pythonanywhere.com/pages/DebuggingImportError/
2021-10-09 14:40:09,077: ***************************************************
2021-10-09 14:47:18,505: Error running WSGI application
2021-10-09 14:47:18,512: django.core.exceptions.ImproperlyConfigured: Application labels aren't unique, duplicates: pages
2021-10-09 14:47:18,513:   File "/var/www/sadata_pythonanywhere_com_wsgi.py", line 22, in <module>
2021-10-09 14:47:18,513:     application = get_wsgi_application()
2021-10-09 14:47:18,513: 
2021-10-09 14:47:18,513:   File "/home/sadata/.virtualenvs/project-virtualenv/lib/python3.8/site-packages/django/core/wsgi.py", line 11, in get_wsgi_application
2021-10-09 14:47:18,513:     django.setup(set_prefix=False)
2021-10-09 14:47:18,513: 
2021-10-09 14:47:18,513:   File "/home/sadata/.virtualenvs/project-virtualenv/lib/python3.8/site-packages/django/__init__.py", line 24, in setup
2021-10-09 14:47:18,513:     apps.populate(settings.INSTALLED_APPS)
2021-10-09 14:47:18,513: 
2021-10-09 14:47:18,513:   File "/home/sadata/.virtualenvs/project-virtualenv/lib/python3.8/site-packages/django/apps/registry.py", line 93, in populate
2021-10-09 14:47:18,513:     raise ImproperlyConfigured(
2021-10-09 14:47:18,514: ***************************************************
2021-10-09 14:47:18,514: If you're seeing an import error and don't know why,
2021-10-09 14:47:18,514: we have a dedicated help page to help you debug: 
2021-10-09 14:47:18,514: https://help.pythonanywhere.com/pages/DebuggingImportError/
2021-10-09 14:47:18,514: ***************************************************

this is sadata_pythonanywhere_com_wsgi.py

import os
import sys

# add your project directory to the sys.path
project_home = '/home/sadata/sadidata'
if project_home not in sys.path:
    sys.path.insert(0, project_home)

# set environment variable to tell django where your settings.py is
os.environ['DJANGO_SETTINGS_MODULE'] = 'project.settings'

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings')

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

Is there any fix to this?

this is the message I get when I enter webpage enter image description here

It sounds like you have two apps in your Django INSTALLED_APPS setting that are both called "pages" -- check that to see where the duplication is, and then remove one of them.