Postgres Authentication Fails When Starting Dajngo












0















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.










share|improve this question



























    0















    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.










    share|improve this question

























      0












      0








      0








      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.










      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 27 '18 at 7:46









      RLBChrisBriantRLBChrisBriant

      44




      44






















          2 Answers
          2






          active

          oldest

          votes


















          0














          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.






          share|improve this answer
























          • 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



















          0














          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?






          share|improve this answer























            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
            });


            }
            });














            draft saved

            draft discarded


















            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









            0














            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.






            share|improve this answer
























            • 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
















            0














            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.






            share|improve this answer
























            • 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














            0












            0








            0







            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.






            share|improve this answer













            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.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            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



















            • 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













            0














            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?






            share|improve this answer




























              0














              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?






              share|improve this answer


























                0












                0








                0







                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?






                share|improve this answer













                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?







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 27 '18 at 12:29









                RLBChrisBriantRLBChrisBriant

                44




                44






























                    draft saved

                    draft discarded




















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    Список кардиналов, возведённых папой римским Каликстом III

                    Deduzione

                    Mysql.sock missing - “Can't connect to local MySQL server through socket”