1

Is there any options to use powerful backend framework with frontend framework on the same server?

Let me be more specific.

For example, in my projects I use Django framework, really like it and want to use it in future projects. But for me it is a best way to use frontend framework to build web-application style portals. For this reason I use ReactJS, because for me it's a really fast! But I don't like NodeJS and don't want to use it in my projects.

But I have problem. For example, in one of our projects we use real time chat. For that we built a ligament NodeJS+SocketIO+Redis. Besides that on backend we have Django+uWSGI+PostgreSQL. And in the base part: Django REST Framework + React.

Is there any way to use frontend JS framework with Django without creating so complicated system?

In my opinion: I need fast scalable solution for frontend, which can connect with Django fast.

NONAMA
  • 503
  • 1
  • 9
  • 21
  • Sure you could use django as `Model` so it would handle all ajax requests from `ReactJS` and perform `CRUD` operations with data. Provide some specific complicated requirements, do you need to use [`SocketIO` with `Django`](http://stackoverflow.com/questions/4190186/can-i-use-socket-io-with-django) ? – Andriy Ivaneyko Jan 09 '16 at 12:23
  • Yes, we need to provide a real-time functions. At this time SocketIO is a best solution. I found SwampDragon for Django, but didn't have a time to check it. – NONAMA Jan 09 '16 at 12:26

2 Answers2

1

In case if you need to provide real time - functions that's possible and you have to use Django, Gevent and SockeIO to implement this, because Django itself aren't asyncronous.

Also you could take a look at WAMP Protocol. Checkout how to add support for WAMP in django with Crossbar.io server in Adding Real-Time to Django Applications article.

Andriy Ivaneyko
  • 20,639
  • 6
  • 60
  • 82
  • Thanks, man! I almost forgot about gevent! Now I'll try to figure out, which structure exactly I need for backend. – NONAMA Jan 09 '16 at 12:44
0

Following up Andriy's answer, Django is now becoming async-enabled as we speak. Check out Django 3.1 release notes for more details.

Cmaiek
  • 1
  • 3