django test app error - Got an error creating the test database: permission denied to create database

后端 未结 9 947
甜味超标
甜味超标 2020-12-22 16:53

When I try to test any app with command (I noticed it when I tried to deploy myproject using fabric, which uses this command):

python manage.py test appname
         


        
9条回答
  •  半阙折子戏
    2020-12-22 17:32

    In the case of Postgres, the user must have createdb permission.

    ALTER ROLE miriam CREATEDB;
    

    See this documentation: https://docs.djangoproject.com/en/2.0/topics/testing/overview/#the-test-database

提交回复
热议问题