Django: Detect database backend

OK, so there’s two ways of doing it, as @Ricola3D said there’s the option of checking settings.DATABASES[‘default’][‘ENGINE’]: >>> from django.conf import settings >>> settings.DATABASES[‘default’][‘ENGINE’] ‘django.db.backends.sqlite3’ or ‘django.db.backends.postgresql_psycopg2′ But there’s also an (undocumented) vendor property on a connection: >>> from django.db import connection >>> connection.vendor ‘postgresql’ or ‘sqlite’ Either way works. I personally prefer connection.vendor as … Read more

Group by multiple columns in Laravel

Did you try: $routes = DB::table(‘route’) ->groupBy(‘rte_origin’, ‘rte_destination’) ->get(); Can’t test here right now, but the API says groupBy() accepts an array. For reference, please visit: Laravel 5.0: https://github.com/laravel/framework/blob/5.0/src/Illuminate/Database/Query/Builder.php#L1037 Laravel 4.2: https://github.com/laravel/framework/blob/4.2/src/Illuminate/Database/Query/Builder.php#L1017

Spring Security:password encoding in DB and in applicationContext

If you are choosing a hashing system yourself, rather than building an app using an existing database which already contains hashed passwords, then you should make sure your hashing algorithm also uses a salt. Don’t just use a plain digest. A good choice is bcrypt, which we now support directly in Spring Security 3.1 via … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)