views:

58

answers:

2

I have a project coming up for client who is basically happy with how he manages his website. It's lots of HTML files (around 300 of them) that he insists on keeping flat HTML files so can easily edit and manage them using Dreamweaver. His site has a lot of traffic and so I'm looking into options of keeping things simple for him. He does insist on this method for the time being, I hope to win him around eventually. I'm slowly moving him off his expensive shared hosting package (he maxes it out constantly due to traffic) and getting him on a VPS so I have more control over what I can install and the resources are more flexible etc.

My issue is, there is some parts of the site that are in PHP. The small admin area he uses to do his newsletters for example sits separately away and he still requires this function. I'm thinking that since I'd have him on a server I can install what I like on, I want to start incorporating Django into the site. I'd much more prefer to do Django development for any admin type situation then trying to hack or make something with PHP. I know about the PHP frameworks out there, but they just don't appeal in this particular situation.

Due to this massive set of HTML files, is it possible to basically allow Django to carry on serving these up as they are... He can edit and upload them with Dreamweaver as he always has... But Django is 'there' for the admin side of it which he can do his newsletter? Eventually he is wanting translations for the pages and login for visitors (again which I'd like to do with Django) but for the time being I'm in this transitional period and wanting to do things step by step.

Aside note, he has a forum that is in PHP, which he also wants to keep... So I'm thinking a carefully setup combination of Nginx, FastCGI and Gunicorn so static, PHP and Django respectively can co-exist on the same server. Is this just foolish, or totally possible?

Any thoughts, guidance, tips or experience would be greatly appreciated so I take the best step forward.

+2  A: 

I see no problem with such setup, using lightweight frontend is recommended for django (or any other wsgi app) anyway. Although you should serve static html with nginx itself, not django.

Daniel Kluev
+1: "serve static html with nginx itself" Never Django.
S.Lott
@daniel-kluev Can I ask how I may go about doing this? So say I have two folders on my server, one called 'httpdocs' and one called 'djangodocs', I would put the static HTML in the 'httpdocs' along with all the other static media being served up? ...but with that, how would Django know when to let it just be HTML (nginx) or when it's time for it to do it's thing (admin etc.) ?
littlejim84
>how would Django know when to let it just be HTML -- you should not pass it to django at all. Requests arrive at nginx, then, based on URI are either served by nginx or forwarded to django/php. In nginx config, you can specify several locations, depending on different matching rules. So you would have something like location /admin/ { ... pass to django ... } location /phpadmin/ { ... pass to php ... } location / {root /path/to/static/files;}
Daniel Kluev
+1  A: 

I recommend using Cherokee for ease of administration. (It's very fast too) It makes complex configuration very easy, it's all done by via a really nice web interface.

Tim McNamara
This is a possibility (one I haven't thought about before). Thank you, I will look into Cherokee.
littlejim84
What you need to do is create a virtual server for each URL that you need with a different system. Your Django system could run for `/blog` and your php system could run for all files with `.php`
Tim McNamara