0
I created a simple App using Flask, but I have a problem when importing the "Resources" that I created into another file.
This is the main file:
from flask_restful import Api
from flask import Flask
from flaskServer.resources.getSpidersNamesResource import SpidersNameResource
from flaskServer.resources.runSpiderResource import RunAllSpidersResource
app = Flask(__name__)
api = Api(app)
api.add_resource(RunAllSpidersResource, '/cnpjchecker/runAllSpiders')
api.add_resource(SpidersNameResource, '/cnpjchecker/getSpidersNames')
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)
Error when rotating it:
Traceback (most recent call last):
File "cnpjCheckerAPI.py", line 12, in <module>
from flaskServer.resources.getSpidersNamesResource import SpidersNameResource
ModuleNotFoundError: No module named 'flaskServer'
It is important to also make clear that the folder 'flaskServer' presents a file init.empty py.