Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 1048  / 1 Year ago, thu, february 9, 2023, 11:34:47

I'm tired of typing manage.py startserver 10.211.55.4:4000, so decided to make an alias for that. Only thing is: the port sometime changes. So I did this in bash profile:



function runserver() {
python manage.py runserver 10.211.55.4:$1
}


But then when I call it: runserver 3000, it starts it, but immediately stops saying:



"Error: That IP address can't be assigned-to". However if I type the same thing right into command line it works with no complains.


More From » bash

 Answers
7

Along the lines of your original attempt, you could adjust that function to the following:



function runserver() {
python manage.py runserver 10.211.55.4:$PORT
}


and then call it like so:



PORT=3000 runserver

[#24822] Friday, February 10, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ntlesslving

Total Points: 123
Total Questions: 109
Total Answers: 113

Location: South Korea
Member since Fri, Sep 11, 2020
4 Years ago
;