Best way to integrate a PHP forum into a Django site?

Suppose you are using a Django site and have an outdated PHP forum to support and integrate into your site, because the current Django forum solutions are not mature enough.

What is the best way to do this?

I currently have a simple view that displays a very simple template that extends the basic site template, and in the content area there is only <IFRAME> that contains the forum as src . The small jQuery function is used to maximize the height of <IFRAME> (after loading is complete) to contain 100% of the contents of the forum.

But it all sounds pretty uncomfortable. How would you do that?

+4
source share
2 answers

There are several options. None of them are perfect (but mixing the two platforms will never happen!)

  • Use an iframe as you suggested (bad, since the address in the address bar is always the address of the django page, and if someone manages the link from the forum, it will be a PHP forum, not the owner of django)

  • Use iframes, but instead of using the same src all the time, parse the url and add the relative bit to the src iframe. those. if django sees /forum/this-url , set src to http://forum-address/this-url and make sure all your links are parent . This has the advantage of always displaying the correct link in the address bar (and not always it / forum /). To do this, you need to hack your forum.

  • Proxy the content and enter it correctly on the page. You will need to pass cookies, and this can become very dirty, but in most cases it is a great way to integrate things because your links will always be correct. You will need to stretch your forum topic to cut everything outside and including <body> tags.

  • Your forum topic is the same as the Django site. This will give better performance, but you may have problems if you use dynamic material in your django template. The ability to get around this is that the django cache cache is used in memcache and uses php-memcache to pull them into your forum template.

In the past, I did both 3 and 4. I used 3 for a very simple form (so you did not have to deal with cookies and sessions, as you do). I used 4 to integrate the FluxBB forum into Wordpress. Both are PHP, but it will be an uber bloat to load FluxBB inside Wordpress. I cached dynamic template objects in memcache and pulled them in a forum template.

For this, I probably suggest moving from No. 4. This is a pain in the ass that should support two topics, but it is by far the fastest solution.

+5
source

When I read the summary of the question, I immediately thought that you would need some kind of script that could be connected to the signal through Dispatcher in Django in order to synchronize the user database from your Django site in the forum. This will keep the authentication of things in check, but you still need to do one of the things that Olya suggested so that they look the same.

The topic is likely to be the least free from the route, but this does not mean that it will be easy!

+1
source

All Articles