writing django custom backend

653 views Asked by At

I want to write django custom backend for search functionality of my site (using mysql match against query / fulltext search), so where should I write it? Should I write it in model of a new separate app. ? Or should I write it in some existing app. or should write it in some existing apps' model?

I am not much experienced in django and have never write any backend before. I know it can be done anyway, but I want to know what is recommended way.I assume it will be usable in other projects or apps also.

thanks

2

There are 2 answers

6
ScotchAndSoda On BEST ANSWER

Just put it in your app that requires your middleware. Or create a django app that holds all your middlewares.

1
Burhan Khalid On

Your backend is normal Python code, and just like other Python modules the files can live anywhere. As long as you are able to import it using the Python shell, django can use it.

In other words as long as it is in PYTHONPATH, then your applications can use it.

It does not need to be part of an app or a project.