As what the title said, is it possible to run 2 django project at the same time ? Since by default, all django run by http://127.0.0.1:8000/. Is there anyway i can change the port number for both the django project ?
My task is this: Integration of django 1 api and django 2 api, to setup two django app, on same server / PC, with different port
As far from what i know, i can change the port number in the settings.py database section. I also cant seems to find much information about this.
The only solution i found which is running this command:
manage.py runserver 8005
will allow the django project to run in 8005 port.
But is it possible to do it without writing the command and just do it in the settings.py or other file ? As i know this is just for development phrase. If its on production, it cannot use in this way.
Inside the commands folder open up the runserver.py script with a text editor. Find the DEFAULT_PORT field. it is equal to 8000 by default. Change it to whatever you like DEFAULT_PORT = "8080"
If you start your Django development server it runs on port 8000 by default.
I found an answer from this post: django change default runserver port
This is achieve by modifying the manage.py file by adding this line
# Override default port for `runserver` command
from django.core.management.commands.runserver import Command as runserver
runserver.default_port = "Port Number"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With