Hello,

DATABASES['...']['PORT'] is the port to which the database server is listening
(your django app is a client of the database, and it connects to that port in
order to access the database); it has nothing to do with what you want.

AFAIK specifying the port number in "runserver" is the only way to do what you
want in development.

Production is a whole another story.

Regards,

Antonis

Antonis Christofides
http://djangodeployment.com


On 2018-01-16 06:31, cherngyo...@gmail.com wrote:
> As what the title said, is it possible to run 2 django project at the same 
> time ?
>
> 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.
>
> DATABASES = {
>     'default': {
>         'ENGINE': 'django.db.backends.postgresql',
>         'NAME': 'Project',
>         'USER': 'admin',
>         'PASSWORD': 'pass1234',
>         'HOST': 'localhost',
>         'PORT': '',
>     }
> }
>
> Do i change the port number here ? As default is http://127.0.0.1:8000/
>
> So i change the 'PORT': '8001', but got this error instead:
> could not connect to server: Connection refused (0x0000274D/10061)
>         Is the server running on host "localhost" (127.0.0.1) and accepting
>         TCP/IP connections on port 8001?
>
> Is there a way to set it up so i can run 2 different django project with
> different port number ?
> -- 
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com
> <mailto:django-users+unsubscr...@googlegroups.com>.
> To post to this group, send email to django-users@googlegroups.com
> <mailto:django-users@googlegroups.com>.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/ae611f43-645f-42a9-a78b-a9ef6fd22eb7%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/ae611f43-645f-42a9-a78b-a9ef6fd22eb7%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/718e9b54-4f60-ea89-1490-2a36d225ce9e%40djangodeployment.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to