1

This is my django project hierarchy

project/
       apache/ django.wsgi
       project/ __init__.py, settings.py, urls.py ..
       pages/
             __init__.py
             widgets.py
             website_views.py
       services/
               __init__.py
               apis/
                    __init__.py
                    fparser.py
                    googleData.py
                    wp.py
                    ...
               wservice.py
       ...

So, the wservice.py is wrap-up like class which lies over all classes of apis module. It even provides some common functionality all classes that it inherit.

wservice.py

import feedparser
from bs4 import BeautifulSoup

class WidgetService(FParser):
    def post_content_summary(self, post_number):   
        ....
        content_text = content_soup.get_text()

        ...

    def get_random_image(self, post_number):
        ...
        content_soup = BeautifulSoup(html_content)

        ...

FParser class is located at fparser.py

The methods in fparser.py use the above class in this way.

from services.wservice import WidgetService
def method1():
    obj = WidgetService()
    m1 = obj.foo1() # described in FParser class
    m2 = obj.foo2() # described in WidgetService class

I am using this WidgetService() in pages/widgets.py. So, what I found is, when ever I start using BeautifulSoup, the apache server is not loading.. Its not even showing any syntax error.

I don't even see any error in log file.

What might have possibly went wrong??? The interesting part is, I haven't faced this kind of error in development server, heroku (gunicorn)

Surya
  • 4,824
  • 6
  • 38
  • 63

1 Answers1

2

This may be the interaction between Cython and mod_wsgi described here, and explored in a Beautiful Soup context here. Here's an earlier question similar to yours.

Community
  • 1
  • 1
Leonard Richardson
  • 3,994
  • 2
  • 17
  • 10