Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 540 Vote(s) - 3.49 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Django postgres database not connecting with Lumen

#1
I am trying to connect `django.db.backends.postgresql` with my lumen application. But when I run the query then following error occured

> could not find driver

Even I change the driver type from mysql to pgsql

My database connection

'ml_db' => [
'driver' => 'django.db.backends.postgresql',
'host' => env('ML_DB_HOST'),
'port' => env('ML_DB_PORT'),
'database' => env('ML_DB_NAME'),
'username' => env('ML_DB_USER'),
'password' => env('ML_DB_PASS'),
'charset' => env('DB_CHARSET', 'utf8mb4'),
'collation' => env('DB_COLLATION', 'utf8mb4_general_ci'),
'prefix' => '',
'timezone' => env('DB_TIMEZONE', '+00:00'),
'strict' => false,
],

Is there any way to connect this database with my lumen application because I am using multiple databases in application.
Reply

#2
The obvious answer here is, that you haven't installed the corresponding driver for your used dbms. So just install it.
Reply

#3
Lumen .env file:

DB_CONNECTION=pgsql
DB_HOST=your host
DB_PORT=5432
DB_DATABASE=database
DB_USERNAME=username
DB_PASSWORD=password

[The link][1]


[1]:

[To see links please register here]

Reply

#4
from your configuration posted in the question, I assume that it's your lumen configuration. There is no `'django.db.backends.postgresql'` driver in lumen. What we have is `pgsql` driver unless you create such a custom driver yourself,(which I assume is not the case).

so change the driver parameter to the following?

'driver' => 'pgsql',
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through