My company will be rolling out a new website to accompany our product launch and would like to switch over to WordPress as our content management system. We will be utilizing a WordPress theme that will allow users to create their own virtual events without having to log into the WordPress dashboard (back-end). This event information will be displayed on the website for other users to view and register – this is all built into the theme we have purchased.
These virtual events will be held on our software platform, which is built on Django. We would like to utilize WordPress to manage the login and event creation process, but would also like to have event information displayed on the WordPress site AND imported to the Django database as well.
For example: Users will need to submit three items on the front-end WordPress site to create an event: Title, Host Name, and Start Time. When that information is submitted can it be automatically duplicated to the Django database in addition to it being sent to the WP database?
I have already done some research on this matter, but what I have found thus far might not work for our needs. I found this presentation by Collin Anderson – it is similar to what we want to achieve, but I believe the application is a little different: http://www.confreaks.com/videos/4493-DjangoCon2014-integrating-django-and-wordpress-can-be-simple.
I have a lot of experience with WordPress, but very limited experience with Django. This question is more for research purposes than a “how-to”. We want to know if we can continue to plan on heading toward the WordPress direction or if we should seek alternative methods for our site. I appreciate you taking moment to answer my question.
Leave a Reply
You must be logged in to post a comment.
I’m working on something similar at the moment and found a good starting point was this:
http://agiliq.com/blog/2010/01/wordpress-and-django-best-buddies/
That way, as dan-klasson suggests, you can use the same database for both the wp side and the django side.
In short, first things first take a back up of the wp database in case anything goes wrong.
Create a new django project and set your settings.py to use the wp database.
In this new django project you can use
./manage.py inspectdb > models.py
to autogenerate a models.py file of the wp database. Be careful here as there are differences between wp and django conventions. You will need to manually alter some of the auto generated models.py. Django supplies db_table and db_column arguments to allow you to rename tables and columns for the django part if you’d like to.You can then create a new django app in your django project and place the models.py you’ve created in there. This new app will be using the same data as your wordpress site. I’m not sure exactly what you want to do but I would be very, very careful about having wordpress and django access the same data simultaneously. You may want to set the django side as read only.
You can then add other apps to extend the django side of things as you wish.
I should point out that I haven’t completed my work on this yet but so far so good. I’ll update as I find sticking points etc.