PHP site with RESTful API using Django. Possible? A good idea?

I have an existing site written in PHP. I would like to add a REST API. I love how the simple RESTful API creation used Django. Is there any CONS for using Django for the sole purpose of creating an API on a website with PHP? Thanks in advance.

+4
source share
2 answers

There are several disadvantages:

  • Your code base will be larger
  • each change in the data model on the one hand must be done on the other hand, and
  • this will require more resources from your server.
  • You have 2 systems to support

But for the rest, I can understand why it would be easier to do this with Django than with a simple PHP API. I have doubts that there are no PHP libraries available to do something like this.

+3
source

I love Django, but I'm not sure if it will benefit you. Maybe I don’t quite understand how you are going to use it, but it seems that if you already have access to the data and the logic is done in PHP, then you will have to re-code in Python to use Django.

If what you really want to clear is URLs and simple URL mapping, then you could use CodeIgniter or CakePHP . Thus, you do not need to rewrite existing Python code or have the same code in two different languages.

0
source

All Articles