Python Forum
Trouble deploying Django (project folder, wsgi.py and libapache2-mod-wsgi)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trouble deploying Django (project folder, wsgi.py and libapache2-mod-wsgi)
#6
I think
Quote:[Fri Mar 16 20:41:29.024538 2018] [:error] [pid 2426] [remote 174.95.101.30:54727] ImportError: No module named 'TheGreatWork'
is saying that its looking for the module 'TheGreatWork' but its not in the sys path

I seem to recal solving this problem once by adjusting my sys.path.append to include the project directory. I dont have a current install to directly reference but you can try changing

""" this """
sys.path.append('/home/<user>/TheGreatWork/TheGreatWork')
""" To this """
sys.path.append('/home/<user>/TheGreatWork')
Whats probably causing this is the interpreter hitting

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "TheGreatWork.settings")
So It says ok I need "TheGreatWork.settings" and then it looks on the sys path for it.
os.environ deals with a string that represents your environment variables.
Reply


Messages In This Thread
RE: Trouble deploying Django (project folder, wsgi.py and libapache2-mod-wsgi) - by knackwurstbagel - Mar-17-2018, 02:20 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  deploying python script on a server rickyrt 0 1,516 Aug-31-2021, 04:03 PM
Last Post: rickyrt
  Django project deployed to Heroku: Postgres security Drone4four 0 1,963 Mar-26-2021, 10:17 AM
Last Post: Drone4four
  creating an exe file for a python django project Sanjish 0 2,661 Dec-27-2020, 07:33 AM
Last Post: Sanjish
  category and subcategory into django project dhirendra007 0 2,040 Dec-26-2020, 10:33 AM
Last Post: dhirendra007
  cant access root environment folder from django folder using __init__.py Sanjish 0 1,949 Dec-25-2020, 05:56 AM
Last Post: Sanjish
  WSGI Multi processing. simbha 1 2,875 May-05-2020, 10:34 AM
Last Post: pyzyx3qwerty
  wsgi server ports chrisdb 3 3,370 Feb-26-2020, 04:24 PM
Last Post: snippsat
  Django project with a setup.py script. That do you think? axju 0 1,664 Oct-22-2019, 10:06 PM
Last Post: axju
  Django: How to automatically substitute a variable in the admin page at Django 1.11? m0ntecr1st0 3 3,413 Jun-30-2019, 12:21 AM
Last Post: scidam
  WSGI server vs Web Server chrisdb 24 10,753 May-29-2019, 02:21 AM
Last Post: heiner55

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020