0

I have a Django project with 1 app that is working locally and I am trying to make it work on the server but I imagine I am still missing something...

The steps I have followed are:

1) create a virtualnev

2) Install django and the libraries I need

3) copy my local project to the server, keeping the same directory structure

4) create the file passenger_wsgi.py (python passenger_wsgi.py did not return any error)

After this do I need to do anything like python manage.py runserver? Or with this I should be already able to see the site through mydomain/my project/ my app (when I do ot just get an error 404)?

I have read the django book and followed the tutorial, but this part is not well described anywhere...

Thanks in advance for any help!

user2950162
  • 941
  • 4
  • 13
  • 29

2 Answers2

1

Deployment is explained in the documentation.

You need to actually serve your application with some kind of HTTP server and something to run your python code. Some of the possible combinations are:

Your hosting service may or may not give you the choice or even the possibilty to do this.

There is a list of Django friendly hosters in the Django wiki.

  • Thanks! I wanted to do it with apache mod_wsgi, I have already found some tutorials and prepare the file passenger_wsgi.py. My doubt is if after that I would need to do something else for mod_wsgi to start it or it would be already ready... thanks for the help! – user2950162 May 18 '14 at 09:32
  • @user2950162 Next time, mention stuff like this in the initial question, please. –  May 18 '14 at 19:10
0

Well firstly you might want to go through the previously asked questions.

When you are deploying using passenger you do not need to run manage.py runserver , etc. The passenger_wsgi file should take care of it.

You might want to check this link out, in the first answer also contains link to Dreamhost which details quite extensively on how to achieve the same.

Visit Deploying Django app using passenger

From my personal experience I found Nginx and uwsgi setup to be much more easier to handle and work and debug in the logs, but this is subjective to your needs and platform you may have.

Community
  • 1
  • 1
harshadbhatia
  • 214
  • 2
  • 12