# What is the problem with my wsgi.py file?

**URL:** <https://forum.djangoproject.com/t/what-is-the-problem-with-my-wsgi-py-file/26437>\
**Category:** Deployment\
**Created:** [December 26, 2023, 7:57pm UTC](https://forum.djangoproject.com/t/what-is-the-problem-with-my-wsgi-py-file/26437 "2023-12-26T19:57:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jarredAwesome](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/jarredawesome/32/17985_2.png) [@jarredAwesome](https://forum.djangoproject.com/u/jarredAwesome)\
**Post date:** [December 26, 2023, 7:57pm UTC](https://forum.djangoproject.com/t/what-is-the-problem-with-my-wsgi-py-file/26437/1 "2023-12-26T19:57:05Z")

</div>

Howdy,

I’m trying to get mezzanine to run on my shared server. I’m using the ‘Python App’ feature on cpanel.

I’m getting the following error when I try and run it:

```auto
modulenotfounderror: No Module Named 'petfood.settings’
```

The project is named ‘petfood’

I’m assuming the wsgi.py is the problem.

```auto

import os

from django.core.wsgi import get_wsgi_application

from mezzanine.utils.conf import real_project_name

os.environ.setdefault(
    "DJANGO_SETTINGS_MODULE", "%s.settings" % real_project_name("petfood")
)

application = get_wsgi_application()
```

Any ideas?

---

<div class="post-metadata">

**Author:** ![addwebsolution](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/addwebsolution/32/23762_2.png) [@addwebsolution](https://forum.djangoproject.com/u/addwebsolution)\
**Post date:** [December 27, 2023, 4:59am UTC](https://forum.djangoproject.com/t/what-is-the-problem-with-my-wsgi-py-file/26437/2 "2023-12-27T04:59:34Z")

</div>

Can you share the folder structure of your project

---

<div class="post-metadata">

**Author:** ![Gulshan212](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/gulshan212/32/10749_2.png) [@Gulshan212](https://forum.djangoproject.com/u/Gulshan212)\
**Post date:** [December 27, 2023, 4:26pm UTC](https://forum.djangoproject.com/t/what-is-the-problem-with-my-wsgi-py-file/26437/3 "2023-12-27T16:26:26Z")

</div>

> [@jarredAwesome](#):
>
> I’m trying to get mezzanine to run on my shared server. I’m using the ‘Python App’ feature on cpanel.
> 
> I’m getting the following error when I try and run it:
> 
> ```auto
> modulenotfounderror: No Module Named 'petfood.settings’
> 
> ```
> 
> The project is named ‘petfood’
> 
> I’m assuming the wsgi.py is the problem.
> 
> ```auto
> import os
> 
> from django.core.wsgi import get_wsgi_application
> 
> from mezzanine.utils.conf import real_project_name
> 
> os.environ.setdefault(
> "DJANGO_SETTINGS_MODULE", "%s.settings" % real_project_name("petfood")
> )
> 
> application = get_wsgi_application()
> 
> ```
> 
> Any ideas?

Well, you need to check the Python path, permissions, and a virtual environment and then try again. If still not work then contact to support team.  
Thanks

---

<div class="post-metadata">

**Author:** ![jarredAwesome](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/jarredawesome/32/17985_2.png) [@jarredAwesome](https://forum.djangoproject.com/u/jarredAwesome)\
**Post date:** [December 27, 2023, 9:18pm UTC](https://forum.djangoproject.com/t/what-is-the-problem-with-my-wsgi-py-file/26437/4 "2023-12-27T21:18:06Z")

</div>

Yeah!

I’ve since deleted the app and reinstalled it, it’s still giving me the same issue.

Here is the file structure

```auto

/home
  /user
     /Mezzanine
          - __init__.py
          -passenger_wsgi.py
          /petfood
               - __init__.py
               -manage.py
               /petfood
                    - __init__.py
                    -wsgi.py
                    -settings.py

```

Here is the contents of the passenger\_wsgi.py

```auto
from petfood.petfood.wsgi.py import application

```

Here is the contents of the wsgi.py

```auto
import os

from django.core.wsgi import get_wsgi_application

from mezzanine.utils.conf import real_project_name

os.environ.setdefault(
    "DJANGO_SETTINGS_MODULE", "%s.settings" % real_project_name("petfood")
)

application = get_wsgi_application()

```

Here is a screen shot of Cpanel Python App settings

 ![Screenshot 2023-12-27 at 3.47.24 PM](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/3X/1/8/18f2c05cc5ff3ac0e1e17a20a40803a9c9c2a089.png)

---

<div class="post-metadata">

**Author:** ![addwebsolution](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/addwebsolution/32/23762_2.png) [@addwebsolution](https://forum.djangoproject.com/u/addwebsolution)\
**Post date:** [December 28, 2023, 7:09am UTC](https://forum.djangoproject.com/t/what-is-the-problem-with-my-wsgi-py-file/26437/5 "2023-12-28T07:09:53Z")

</div>

In `wsgi.py` Try petfood.petfood.settings

```auto
os.environ.setdefault(
    "DJANGO_SETTINGS_MODULE", "petfood.petfood.settings" )
)

```
