forked from AwareShell/djongo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
119 lines (89 loc) · 2.68 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
from distutils.core import setup
from setuptools import find_packages
import os
import codecs
import re
import sys
LONG_DESCRIPTION = """
Use Mongodb as a backend database for your django project, without changing a
single django model!
Usage
-----
1. Install djongo::
pip install djongo
2. Into settings.py file of your project, add::
DATABASES = {
'default': {
'ENGINE': 'djongo',
'NAME': 'your-db-name',
}
}
3. Run (ONLY the first time to create collections in mongoDB)::
manage.py makemigrations
manage.py migrate
YOUR ARE SET! HAVE FUN!
Requirements
------------
1. Djongo requires python 3.6 or above.
How it works
------------
Djongo is a SQL to mongodb query transpiler. It translates a SQL query string
into a mongoDB query document. As a result, all Django features, models etc
work as is.
Django contrib modules::
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.sessions',
and others... fully supported.
Important links
---------------
* `Full Documentation <https://nesdis.github.io/djongo/>`_
* `Source code <https://github.com/nesdis/djongo>`_
"""
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
packages = find_packages()
def read(*parts):
with codecs.open(os.path.join(BASE_DIR, *parts), 'r') as fp:
return fp.read()
def find_version(*file_paths):
version_file = read(*file_paths)
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
install_requires = [
'sqlparse==0.2.4',
'pymongo>=3.2.0',
'django>=2.0,<=3.1.3'
]
if sys.version_info.major == 3 and sys.version_info.minor < 7:
install_requires.append("dataclasses")
setup(
name='djongo',
version=find_version("djongo", "__init__.py"),
include_package_data=True,
packages=packages,
url='https://nesdis.github.io/djongo/',
license='AGPL',
author='nesdis',
author_email='[email protected]',
description=(
'Driver for allowing Django to use MongoDB as the database backend.'),
install_requires=install_requires,
extras_require=dict(
json=[
'jsonfield>=2.0.2',
'django-jsoneditor>=0.0.12',
],
),
long_description=LONG_DESCRIPTION,
python_requires='>=3.6',
keywords='Django MongoDB driver connector',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3.6',
]
)