I can't seem to figure out what part of my setup is breaking. Hopefully someone here can point me in the right direction. my file structure:
my index.py:
my http.conf:
and when I run apache and load the page I get a 500 error with the log:
can someone please tell me why this isn't working asked 19 Jul '12, 19:37 DanielN |
I may have been having a similar problem. Just don't use "application" folder. Put every file in /htdocs For some reason subdirectories cause issues. So your "app" stuff, app.route etc., should be in htdocs. You can use blueprints for the rest and have those in subfolders, but the main site should be in /htdocs, as YourApp.py (alongside index.py) answered 20 Nov '12, 21:07 execute |
In Python, everything (including functions, methods, modules, classes etc.) is an object , and methods are just attributes like every others. So,there's no separate namespaces for methods. So when you set an instance attribute, it shadows the class attribute by the same name. The obvious solution is to give attributes different names . This error statement TypeError: 'module' object is not callable is raised as you are being confused about the Class name and Module name. The problem is in the import line . You are importing a module, not a class. This happend because the module name and class name have the same name . If you have a class "MyClass" in a file called "MyClass.py" , then you should import :
In Python , a script is a module, whose name is determined by the filename . So when you start out your file MyClass.py with import MyClass you are creating a loop in the module structure. answered 04 Feb '19, 06:34 cronywalls |
Per the support ticket you opened, I believe this error is related to one of the Python modules you're using. I'll leave the answer open for anyone who has a better idea.