views:

139

answers:

3

I have looked and I could not find this question before, and it surprises me.

I am reasonably proficient in Python, and I used Dreamhost for a number of years. Now I would like to learn Django. They are finally supporting it using Passenger. Which I do not know what is.

Following the instructions on Dreamhost I installed Django. Then I started following the tutorial 01. This went well, except that I could not start the server (this in the tutorial) since the code was live on dreamhost. At the time this did not seem to make any difference. Then when I went on the second part of the tutorial I had to access the admin site. And it worked well going to myurl/admin/ , as it should. But here the problems started. According to the tutorial (here) I have to add a file in the poll application and then restart the server. But I never started the server in the first place, my code is running live on the web... but when I add a file the website the admin acts as if it does not see it.

Probably dreamhost has started its own server, and I don't know how to restart it. But I assume this is going to be a common problem when you run django on dreamhost. Every time you add a file you will have to tell the server to consider it.

So what should I do to let the server know about it?

Thanks, Pietro

A: 

For the tutorial, you should be working on a local machine, not a web server.

stevejalim
There's no problem with doing it on a server, as long as you know how to deal with Passenger itself.
b. e. hollenbeck
Even if I were to do the tutorial on my machine, I would still have the same problem when I move the code on Dreamhost. Somehow we need to find a way to restart Passenger
Pietro Speroni
+1  A: 

Here's the relevant section of the Passenger user's guide for restarting Passenger:

http://www.modrails.com/documentation/Users%20guide.html#_redeploying_restarting_the_ruby_on_rails_application

b. e. hollenbeck
Thank you. Nearly there, I found that the same info on DH wiki page."If you modified your application and your changes do not seem to be reflected, you may need to notify Passenger about your change by creating or modifying ~/example.com/tmp/restart.txt:touch /home/user/example.com/tmp/restart.txt"But it does not work. I created the /home/[myusername]/[mywebsite]/tmp directory and the restart.txt file in it. That did not made Passenger restart. I also tried to Touch it:touch /home/[username]/[website]/tmp/restart.txtwith no effect. What could it be?
Pietro Speroni
ok, the solution is to pkill python. I explained it in a separate answer. Thanks.
Pietro Speroni
+1  A: 

Eventually I got the answer from the DH support service. They told me to

pkill python

I did it. I also checked with

ps -aux

what process I was running. And indeed I could see the python process starting when I went to the page, and being killed when I pkilled it.

Thanks for all that helped.

Pietro Speroni