kandi background

dj-database-url | Use Database URLs in your Django Application. | Database library

Download this library from

kandi X-RAY | dj-database-url Summary

dj-database-url is a Python library typically used in Database applications. dj-database-url has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has medium support. You can download it from GitHub.
Use Database URLs in your Django Application.

kandi-support Support

  • dj-database-url has a medium active ecosystem.
  • It has 1184 star(s) with 172 fork(s). There are 38 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 19 open issues and 48 have been closed. On average issues are closed in 215 days. There are 6 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of dj-database-url is current.

quality kandi Quality

  • dj-database-url has 0 bugs and 0 code smells.

securitySecurity

  • dj-database-url has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • dj-database-url code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.

license License

  • dj-database-url is licensed under the BSD-2-Clause License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.

buildReuse

  • dj-database-url releases are not available. You will need to build from source code and install.
  • Build file is available. You can build the component from source.
  • dj-database-url saves you 166 person hours of effort in developing the same functionality from scratch.
  • It has 413 lines of code, 28 functions and 3 files.
  • It has high code complexity. Code complexity directly impacts maintainability of the code.
Top functions reviewed by kandi - BETA

kandi has reviewed dj-database-url and discovered the below as its top functions. This is intended to give you an instant insight into dj-database-url implemented functionality, and help decide if they suit your requirements.

  • Parse a database URL .
  • Gets the config from the env .

dj-database-url Key Features

Use Database URLs in your Django Application.

dj-database-url Examples and Code Snippets

  • pymongo [SSL: CERTIFICATE_VERIFY_FAILED]: certificate has expired on Mongo Atlas
  • from Google import Create_Service ModuleNotFoundError: No module named 'Google'
  • Why do I get NameError: name '_' is not defined when setting custom templates for djangocms-video?
  • OperationalError, Error 111 connecting to 127.0.0.1:6379. Connection refused. After deploying in heroku
  • Unable to Deploy Django App to Heroku because of PyWin32
  • I am trying to deploy django application using heroku but getting error?
  • column id does not exist Heroku
  • How to create a requirements.txt file in Django project?
  • Django Heroku Collectstatic error only on deploy
  • Successfully deployed Django to Heroku but received application error

pymongo [SSL: CERTIFICATE_VERIFY_FAILED]: certificate has expired on Mongo Atlas

pip install dnspython pymongo certifi
from pymongo import MongoClient
import certifi
s = MongoClient("mongodb+srv://m220student:m220password@cluster0.maiqr.mongodb.net", tlsCAFile=certifi.where())
-----------------------
pip install dnspython pymongo certifi
from pymongo import MongoClient
import certifi
s = MongoClient("mongodb+srv://m220student:m220password@cluster0.maiqr.mongodb.net", tlsCAFile=certifi.where())

Community Discussions

Trending Discussions on dj-database-url
  • pymongo [SSL: CERTIFICATE_VERIFY_FAILED]: certificate has expired on Mongo Atlas
  • Django with GDAL throwing error when deploying on Heroku
  • from Google import Create_Service ModuleNotFoundError: No module named 'Google'
  • Why do I get NameError: name '_' is not defined when setting custom templates for djangocms-video?
  • OperationalError, Error 111 connecting to 127.0.0.1:6379. Connection refused. After deploying in heroku
  • Unable to Deploy Django App to Heroku because of PyWin32
  • How to fix ModuleNotFoundError: No module named 'rest_framework' in Ubuntu
  • Azure Blob Storage error in Django - Failed to establish a new connection: [Errno 111]
  • I am trying to deploy django application using heroku but getting error?
  • Getting Error => ModuleNotFoundError: No module named 'django' When I attempt to deploy my django app to heroku
Trending Discussions on dj-database-url

QUESTION

pymongo [SSL: CERTIFICATE_VERIFY_FAILED]: certificate has expired on Mongo Atlas

Asked 2022-Jan-29 at 22:03

I am using MongoDB(Mongo Atlas) in my Django app. All was working fine till yesterday. But today, when I ran the server, it is showing me the following error on console

Exception in thread django-main-thread:
Traceback (most recent call last):
  File "c:\users\admin\appdata\local\programs\python\python39\lib\threading.py", line 973, in _bootstrap_inner
    self.run()
  File "c:\users\admin\appdata\local\programs\python\python39\lib\threading.py", line 910, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\Lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\Lib\site-packages\django\core\management\commands\runserver.py", line 121, in inner_run
    self.check_migrations()
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\Lib\site-packages\django\core\management\base.py", line 486, in check_migrations
    executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\Lib\site-packages\django\db\migrations\executor.py", line 18, in __init__
    self.loader = MigrationLoader(self.connection)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\Lib\site-packages\django\db\migrations\loader.py", line 53, in __init__
    self.build_graph()
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\Lib\site-packages\django\db\migrations\loader.py", line 220, in build_graph
    self.applied_migrations = recorder.applied_migrations()
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\Lib\site-packages\django\db\migrations\recorder.py", line 77, in applied_migrations
    if self.has_table():
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\Lib\site-packages\django\db\migrations\recorder.py", line 56, in has_table
    tables = self.connection.introspection.table_names(cursor)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\Lib\site-packages\django\db\backends\base\introspection.py", line 52, in table_names
    return get_names(cursor)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\Lib\site-packages\django\db\backends\base\introspection.py", line 47, in get_names
    return sorted(ti.name for ti in self.get_table_list(cursor)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\Lib\site-packages\djongo\introspection.py", line 47, in get_table_list
    for c in cursor.db_conn.list_collection_names()
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\Lib\site-packages\pymongo\database.py", line 880, in list_collection_names
    for result in self.list_collections(session=session, **kwargs)]
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\Lib\site-packages\pymongo\database.py", line 842, in list_collections
    return self.__client._retryable_read(
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\Lib\site-packages\pymongo\mongo_client.py", line 1514, in _retryable_read
    server = self._select_server(
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\Lib\site-packages\pymongo\mongo_client.py", line 1346, in _select_server
    server = topology.select_server(server_selector)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\Lib\site-packages\pymongo\topology.py", line 244, in select_server
    return random.choice(self.select_servers(selector,
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\Lib\site-packages\pymongo\topology.py", line 202, in select_servers
    server_descriptions = self._select_servers_loop(
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\Lib\site-packages\pymongo\topology.py", line 218, in _select_servers_loop
    raise ServerSelectionTimeoutError(
pymongo.errors.ServerSelectionTimeoutError: cluster0-shard-00-02.mny7y.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1129),cluster0-shard-00-01.mny7y.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1129),cluster0-shard-00-00.mny7y.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1129), Timeout: 30s, Topology Description: <TopologyDescription id: 6155f0c9148b07ff5851a1b3, topology_type: ReplicaSetNoPrimary, servers: [<ServerDescription ('cluster0-shard-00-00.mny7y.mongodb.net', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('cluster0-shard-00-00.mny7y.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1129)')>, <ServerDescription ('cluster0-shard-00-01.mny7y.mongodb.net', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('cluster0-shard-00-01.mny7y.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1129)')>, <ServerDescription ('cluster0-shard-00-02.mny7y.mongodb.net', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('cluster0-shard-00-02.mny7y.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1129)')>]>

I am using djongo as the database engine

DATABASES = {
    'default': {
            'ENGINE': 'djongo',
            'NAME': 'DbName',
            'ENFORCE_SCHEMA': False,
            'CLIENT': {
                'host': 'mongodb+srv://username:password@cluster0.mny7y.mongodb.net/DbName?retryWrites=true&w=majority'
            }  
    }
}

And following dependencies are being used in the app

dj-database-url==0.5.0
Django==3.2.5
djangorestframework==3.12.4
django-cors-headers==3.7.0
gunicorn==20.1.0
psycopg2==2.9.1
pytz==2021.1
whitenoise==5.3.0
djongo==1.3.6
dnspython==2.1.0

What should be done in order to resolve this error?

ANSWER

Answered 2021-Oct-03 at 05:57

This is because of a root CA Let’s Encrypt uses (and Mongo Atals uses Let's Encrypt) has expired on 2020-09-30 - namely the "IdentTrust DST Root CA X3" one.

The fix is to manually install in the Windows certificate store the "ISRG Root X1" and "ISRG Root X2" root certificates, and the "Let’s Encrypt R3" intermediate one - link to their official site - https://letsencrypt.org/certificates/

Copy from the comments: download the .der field from the 1st category, download, double click and follow the wizard to install it.

Source https://stackoverflow.com/questions/69397039

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install dj-database-url

You can download it from GitHub.
You can use dj-database-url like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

Support

For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

Explore Related Topics

Build your Application

Share this kandi XRay Report