some basic best practices django, apache, mod_wsgi questions
I think I have this virtual named server stuff down, when I want to serve my static web urls it's pretty easy, I edit my whatever.com url in sites-available and point to my dir that is hosting these .coms I have up right now. my path is something like /blahblah/whatever.com/publichtml/ and I just stick my index files etc into publichtml. I've read that when creating django apps it's a bad idea to put your .py files in public_html since that makes them downloadable (obviously not a good idea). I know stuff has to be split up, but I'm not completely clear with how.
so let's say that I have a whatever.com domain that I want to use to host a django app, how should I split up my files? my guess would be to have templates and static files directly in /blahblah/www/whatever.com/publichtml and have my django .py files hosted elsewhere, say /django/projects/whatever-project I know that I then need to go into my whatever.com file in /etc/apache2/sites-available and edit it to point apache to my .wsgi file and static files. What I'm not clear on is where I should put my .wsgi file. Does it need to hang out with /django/projects/whatever-project or does it need to be in /blahblah/www/whatever.com/ or /blahblah/www/whatever.com/publichtml ?
The thing is, I can get these django projects working just fine with my local runserver, but I'm not terribly clear what the best way to implement them in my linode server is.
Any insights would be greatly appreciated. Thanks in advance!
2 Replies
For development I have a second www-dev apache group and separate directory in my user home directory, only localhost can see the django output from there (not externally visible) and I use virtualbox or nomachine for development. I can kill all www-dev owned processes and the main django site is untouched.
James
I got the basics set up and serving, up next: learn about ssl.