Load pickle file into Django views

Hi there, I am working to develop on the website an application that built a picke file containing an object of a class defined on that project with specific data. I did not create that application and have no much knowledge of how pickle works.
Now I want to move this app to a web version and I decided to go with django. To do not repeat the proces of creating those models I thought of directly load the pickle file in views.py and use the object already to make some operations. However, I am not sure how to make this load process as directly making the query:

def load_regional_model():
    try:
        with open(r"C:\Users\...\picklefile.pkl", 'rb') as f:
            model = pickle.load(f)
            print("Model loaded successfully")
            return model
    except Exception as e:
        print(f"An error occurred: {e}")
        print(f"Error type: {type(e).__name__}")
        return None

throws error:

An error occurred: No module named 'model'
Error type: ModuleNotFoundError

I started my django project from zero so I did not add any of the code from the app which creates the pickle. Should I? What am I missing?

You would at least need to add the class of which the pickle is an instance, in addition to having definitions of any referenced classes.

Thanks @KenWhitesell. I added the classes related with the pickle object into my models.py file but I still get the same error. Should I build the django project on the directory where the original code that built the pickle is?

Those classes don’t necessary belong in the models file, they need to be defined in modules of the same name from which they were originally created.

Thanks again for the guidance @KenWhitesell. I copied the folder ‘model’ with its content -contained the files where those classes where defined- in the django project root folder as it was on the root folder of the project where the pickle was built, and now it works.