0

This might be a very dumb question, so please bear with me (there's also no code included either). Recently, I switched from PHP to Python and fell in love with Django. Locally, everything works well.
However, how are these files accessed when on a real server?
Is the manage.py runserver supposed to be used in a server environment?
Do I need to use mod_python ?
Coming from PHP, one would simply use Apache or Nginx but how does the deployment work with Python/Django?

This is all very confusing to me, admittedly. Any help is more than welcome.

1
  • Many people choose nginx and gunicorn for live serving. It uses the same wsgi.py file that was created with your project. There is a section on the django site discussing deployment: docs.djangoproject.com/en/1.9/howto/deployment Commented Mar 12, 2016 at 20:17

1 Answer 1

1

manage.py runserver is only used to speed your development process, it shouldn't be run on your server. It's similar to the newly introduced php's built-in server php -S host:port.

Since you're coming from PHP you can use apache with mod_wsgi in order to serve your django application, there are a lot of tutorials online on how to configure it properly. You might want to read what wsgi is and why it's important.

Sign up to request clarification or add additional context in comments.

3 Comments

You say mod_wsgi and @joel says nginx - what is better now?
as a start go with mod_wsgi. nginx would require you to learn yet another service in order to serve your application and I don't recommend that unless you really want to. request->mod_wsgi->app vs request->nginx->gunicorn/uwsgi/other->app.
Thanks for your help!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.