Cannot load Apache server when loading external modules into class

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 ... 

Thus, wservice.py is the final class that lies in all classes of the apis module. It even provides some common functionality to all classes that it inherits.

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) ... 
Class

FParser is located in fparser.py

The methods in fparser.py use the above class 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 use this WidgetService () in pages/widgets.py . So, I found that when I start using BeautifulSoup , the Apache server does not load. It doesn't even show a syntax error.

I don’t even see errors in the log file.

What could possibly have gone wrong? The interesting part: I did not encounter such an error in the development server, heroic (gunicorn)

+1
source share
1 answer

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

+2
source

Source: https://habr.com/ru/post/1436568/


All Articles