Apache server is not loading while importing libraries in a class

9 views
Skip to first unread message

surya

unread,
Jul 9, 2012, 3:05:08 PM7/9/12
to django...@googlegroups.com
This is a bit strange issue (at least for me)
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 to all classes that it inherit.


wservice.py

import feedparser
from bs4 import BeautifulSoup

class WidgetService(FParser):
   
def post_content_summary(self, post_number):  
        content_soup = BeautifulSoup( self.content() ) # self.content comes from FParser.

        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 usingBeautifulSoup, 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)

I really don't understand why this is happening!!.. 

I tried to debug the WidgetService() class and found that the statement content_soup = BeautifulSoup( self.content() ) is not running.
Reply all
Reply to author
Forward
0 new messages