2

I'm developing some Python project with Django. When we render the Python/Django application, we need to open the command prompt and type in python manage.py runserver. That's ok on for the development server. But for production, it looks funny. Is there anyway to run the Python/Django project without opening the command prompt?

Bleeding Fingers
7,1608 gold badges49 silver badges80 bronze badges
asked Dec 3, 2013 at 11:08
1
  • 2
    You wouldn't do that for production - you'd have it running on some kind of cron/supervisor restart and behind a proper server. Have you looked at deployment? djangobook.com/en/2.0/chapter12.html or various other resources for instance? Commented Dec 3, 2013 at 11:10

3 Answers 3

7

The deployment section of the documentation details steps to configure servers to run django in production.

runserver is to be used strictly for development and should never be used in production.

answered Dec 3, 2013 at 11:17
Sign up to request clarification or add additional context in comments.

1 Comment

why should never be used ...? may you explain that?
3

You run the runserver command only when you develop. After you deploy, the client does not need to run python manage.py runserver command. Calling the url will execute the required view. So it need not be a concern

answered Dec 3, 2013 at 11:11

Comments

2

If you are using Linux I wrote a pretty, pretty basic script, which I am always using when I don't want to call this command.

Note: You really just should use the "runserver" for developing :)

#!/bin/bash
#Of course change "IP-Address" to your current IP-Address and the "Port" to your port.
#ifconfig to get your IP-Address
python manage.py runserver IP-Address:Port

just name it runserver.sh and execute it like this in your terminal:

./runserver.sh
answered Dec 3, 2013 at 12:29

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.