Postgres Authentication Fails When Starting Dajngo
I am in the process of restoring my Django development server to another virtual machine. I have set up Django, Postgres, installed the GIS extensions and restored the database.
When I run the server, I get the error below:
password authentication failed for user "myuser"
With "myuser" I can connect to the Postgres database as that user with the same password specified in "mysettings.py" and create and drop tables so I don't understand why it is not connecting.
My settings.py looks like this:
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'travel',
'USER': 'myuser',
'PASSWORD': 'Passw0rd',
'HOST': 'localhost',
'PORT': '',
}
}
Can someone help? It doesn't make sense to me if I can log on as that user and create / drop tables.
postgresql django python3 postgis
add a comment |
I am in the process of restoring my Django development server to another virtual machine. I have set up Django, Postgres, installed the GIS extensions and restored the database.
When I run the server, I get the error below:
password authentication failed for user "myuser"
With "myuser" I can connect to the Postgres database as that user with the same password specified in "mysettings.py" and create and drop tables so I don't understand why it is not connecting.
My settings.py looks like this:
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'travel',
'USER': 'myuser',
'PASSWORD': 'Passw0rd',
'HOST': 'localhost',
'PORT': '',
}
}
Can someone help? It doesn't make sense to me if I can log on as that user and create / drop tables.
postgresql django python3 postgis
add a comment |
I am in the process of restoring my Django development server to another virtual machine. I have set up Django, Postgres, installed the GIS extensions and restored the database.
When I run the server, I get the error below:
password authentication failed for user "myuser"
With "myuser" I can connect to the Postgres database as that user with the same password specified in "mysettings.py" and create and drop tables so I don't understand why it is not connecting.
My settings.py looks like this:
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'travel',
'USER': 'myuser',
'PASSWORD': 'Passw0rd',
'HOST': 'localhost',
'PORT': '',
}
}
Can someone help? It doesn't make sense to me if I can log on as that user and create / drop tables.
postgresql django python3 postgis
I am in the process of restoring my Django development server to another virtual machine. I have set up Django, Postgres, installed the GIS extensions and restored the database.
When I run the server, I get the error below:
password authentication failed for user "myuser"
With "myuser" I can connect to the Postgres database as that user with the same password specified in "mysettings.py" and create and drop tables so I don't understand why it is not connecting.
My settings.py looks like this:
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'travel',
'USER': 'myuser',
'PASSWORD': 'Passw0rd',
'HOST': 'localhost',
'PORT': '',
}
}
Can someone help? It doesn't make sense to me if I can log on as that user and create / drop tables.
postgresql django python3 postgis
postgresql django python3 postgis
asked Dec 27 '18 at 7:46
RLBChrisBriantRLBChrisBriant
44
44
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
It's hard to tell without a bit more information, but ''
isn't a valid port number. You should probably use PostgreSQL's default port, 5432.
I've tried that just and get the same error.
– RLBChrisBriant
Dec 27 '18 at 12:13
On other servers I haven't specified a port no. and it's been fine.
– RLBChrisBriant
Dec 27 '18 at 12:13
add a comment |
I managed to solve this by creating a new user in postgres and using their credentials in settings.py. I needed to make that user a super user.
The previous user was a local user on the server which was linked to the postgres account so I don't understand why it didn't work in that case. Can anyone advise?
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1388042%2fpostgres-authentication-fails-when-starting-dajngo%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
It's hard to tell without a bit more information, but ''
isn't a valid port number. You should probably use PostgreSQL's default port, 5432.
I've tried that just and get the same error.
– RLBChrisBriant
Dec 27 '18 at 12:13
On other servers I haven't specified a port no. and it's been fine.
– RLBChrisBriant
Dec 27 '18 at 12:13
add a comment |
It's hard to tell without a bit more information, but ''
isn't a valid port number. You should probably use PostgreSQL's default port, 5432.
I've tried that just and get the same error.
– RLBChrisBriant
Dec 27 '18 at 12:13
On other servers I haven't specified a port no. and it's been fine.
– RLBChrisBriant
Dec 27 '18 at 12:13
add a comment |
It's hard to tell without a bit more information, but ''
isn't a valid port number. You should probably use PostgreSQL's default port, 5432.
It's hard to tell without a bit more information, but ''
isn't a valid port number. You should probably use PostgreSQL's default port, 5432.
answered Dec 27 '18 at 7:54
MureinikMureinik
2,54561625
2,54561625
I've tried that just and get the same error.
– RLBChrisBriant
Dec 27 '18 at 12:13
On other servers I haven't specified a port no. and it's been fine.
– RLBChrisBriant
Dec 27 '18 at 12:13
add a comment |
I've tried that just and get the same error.
– RLBChrisBriant
Dec 27 '18 at 12:13
On other servers I haven't specified a port no. and it's been fine.
– RLBChrisBriant
Dec 27 '18 at 12:13
I've tried that just and get the same error.
– RLBChrisBriant
Dec 27 '18 at 12:13
I've tried that just and get the same error.
– RLBChrisBriant
Dec 27 '18 at 12:13
On other servers I haven't specified a port no. and it's been fine.
– RLBChrisBriant
Dec 27 '18 at 12:13
On other servers I haven't specified a port no. and it's been fine.
– RLBChrisBriant
Dec 27 '18 at 12:13
add a comment |
I managed to solve this by creating a new user in postgres and using their credentials in settings.py. I needed to make that user a super user.
The previous user was a local user on the server which was linked to the postgres account so I don't understand why it didn't work in that case. Can anyone advise?
add a comment |
I managed to solve this by creating a new user in postgres and using their credentials in settings.py. I needed to make that user a super user.
The previous user was a local user on the server which was linked to the postgres account so I don't understand why it didn't work in that case. Can anyone advise?
add a comment |
I managed to solve this by creating a new user in postgres and using their credentials in settings.py. I needed to make that user a super user.
The previous user was a local user on the server which was linked to the postgres account so I don't understand why it didn't work in that case. Can anyone advise?
I managed to solve this by creating a new user in postgres and using their credentials in settings.py. I needed to make that user a super user.
The previous user was a local user on the server which was linked to the postgres account so I don't understand why it didn't work in that case. Can anyone advise?
answered Dec 27 '18 at 12:29
RLBChrisBriantRLBChrisBriant
44
44
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1388042%2fpostgres-authentication-fails-when-starting-dajngo%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown