# Aurora DSQL adapter for Django
This is the adapter for enabling development of Django applications using Aurora DSQL.
## Requirements
### Boto3
Aurora DSQL Django adapter needs boto3 to work. Follow the Boto3 [installation guide](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/quickstart.html) to install Boto3
### Required Python versions
aurora_dsql_django requires Python 3.8 or later.
Please see the link below for more detail to install Python:
* [Python Installation](https://www.python.org/downloads/)
### AWS credentials
Aurora DSQL Django adapter generates the IAM db auth token for every connection.
DB auth token is generated using AWS credentials. You must have configured valid
AWS credentials to be able to use the adapter. If not the connection to the
cluster will not succeed.
## Getting Started
First, install the adapter using pip:
```pip install aurora_dsql_django```
### Define Aurora DSQL as the Engine for the Django App
Change the ``DATABASES`` variable in ``settings.py`` of your Django app. An example
is show below
```python
DATABASES = {
'default': {
'HOST': '<your_cluster_id>.dsql.<region>.on.aws',
'USER': 'admin', # or another user you have defined
'NAME': 'postgres',
'ENGINE': 'aurora_dsql_django',
'OPTIONS': {
'sslmode': 'require',
'region': 'us-east-2',
# (optional) Defaults to 'default' profile if nothing is set
'aws_profile': 'user aws custom profile name'
# (optional) Default is 900 seconds i.e., 15 mins
'expires_in': <token expiry time time in seconds>
# (optional) If sslmode is 'verify-full' then use sslrootcert
# variable to set the path to server root certificate
# If no path is provided, the adapter looks into system certs
# NOTE: Do not use it with 'sslmode': 'require'
'sslrootcert': '<root certificate path>'
}
}
}
```
For more info follow the [Aurora DSQL with Django example](examples/pet-clinic-app/README.md)
## Development
### Setup
Assuming that you have Python installed, set up your environment and installed the dependencies
like this instead of the `pip install aurora-dsql-django` defined above:
```
$ git clone https://github.com/awslabs/aurora-dsql-django
$ cd aurora-dsql-django
$ python -m venv venv
...
$ source venv/bin/activate
$ pip install -r requirements.txt
$ pip install -e .
```
### Running Tests
You can run the unit tests with this command:
```
$ pytest --cov=aurora_dsql_django aurora_dsql_django/tests/unit/ --cov-report=xml
```
You can run the integration tests with this command:
```
$ export CLUSTER_ENDPOINT=<your cluster endpoint>
$ export DJANGO_SETTINGS_MODULE=aurora_dsql_django.tests.test_settings
$ pytest -v aurora_dsql_django/tests/integration/
```
### Documentation
Sphinx is used for documentation. You can generate HTML locally with the following:
```
$ pip install -r requirements-docs.txt
$ pip install -e .
$ cd docs
$ make html
```
## Getting Help
Please use these community resources for getting help.
* Open a support ticket with [AWS Support](http://docs.aws.amazon.com/awssupport/latest/user/getting-started.html).
* If you think you may have found a bug, please open an [issue](https://github.com/awslabs/aurora-dsql-django/issues/new).
## Opening Issues
If you encounter a bug with the Aurora DSQL Django adapter, we would like to hear about it. Please search the [existing issues](https://github.com/awslabs/aurora-dsql-django/issues) and see if others are also experiencing the issue before opening a new issue. When opening a new issue please follow the template.
The GitHub issues are intended for bug reports and feature requests. For help and questions with using Aurora DSQL Django adapter, please make use of the resources listed in the [Getting Help](https://github.com/awslabs/aurora-dsql-django#getting-help) section. Keeping the list of open issues lean will help us respond in a timely manner.
## License
This library is licensed under the Apache 2.0 License.
Raw data
{
"_id": null,
"home_page": null,
"name": "aurora-dsql-django",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Amazon Web Services",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/16/db/ae87fb6ee44ce0068f91269da86bce409642a337e873db643100a1c221c4/aurora_dsql_django-0.1.0.tar.gz",
"platform": null,
"description": "# Aurora DSQL adapter for Django\n\nThis is the adapter for enabling development of Django applications using Aurora DSQL.\n\n## Requirements\n\n### Boto3\n\nAurora DSQL Django adapter needs boto3 to work. Follow the Boto3 [installation guide](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/quickstart.html) to install Boto3\n\n### Required Python versions\n\naurora_dsql_django requires Python 3.8 or later. \n\nPlease see the link below for more detail to install Python:\n\n* [Python Installation](https://www.python.org/downloads/)\n\n### AWS credentials\n\nAurora DSQL Django adapter generates the IAM db auth token for every connection.\nDB auth token is generated using AWS credentials. You must have configured valid\nAWS credentials to be able to use the adapter. If not the connection to the \ncluster will not succeed.\n\n## Getting Started\n\nFirst, install the adapter using pip:\n\n```pip install aurora_dsql_django```\n\n### Define Aurora DSQL as the Engine for the Django App\n\nChange the ``DATABASES`` variable in ``settings.py`` of your Django app. An example\nis show below\n\n```python\n DATABASES = {\n 'default': {\n 'HOST': '<your_cluster_id>.dsql.<region>.on.aws',\n 'USER': 'admin', # or another user you have defined\n 'NAME': 'postgres',\n 'ENGINE': 'aurora_dsql_django',\n 'OPTIONS': {\n 'sslmode': 'require',\n 'region': 'us-east-2',\n # (optional) Defaults to 'default' profile if nothing is set\n 'aws_profile': 'user aws custom profile name' \n # (optional) Default is 900 seconds i.e., 15 mins \n 'expires_in': <token expiry time time in seconds> \n # (optional) If sslmode is 'verify-full' then use sslrootcert\n # variable to set the path to server root certificate\n # If no path is provided, the adapter looks into system certs\n # NOTE: Do not use it with 'sslmode': 'require'\n 'sslrootcert': '<root certificate path>'\n }\n }\n }\n```\n\nFor more info follow the [Aurora DSQL with Django example](examples/pet-clinic-app/README.md)\n\n## Development\n\n### Setup\n\nAssuming that you have Python installed, set up your environment and installed the dependencies\nlike this instead of the `pip install aurora-dsql-django` defined above:\n\n```\n$ git clone https://github.com/awslabs/aurora-dsql-django\n$ cd aurora-dsql-django\n$ python -m venv venv\n...\n$ source venv/bin/activate\n$ pip install -r requirements.txt\n$ pip install -e .\n```\n\n### Running Tests\n\nYou can run the unit tests with this command:\n\n```\n$ pytest --cov=aurora_dsql_django aurora_dsql_django/tests/unit/ --cov-report=xml\n```\n\nYou can run the integration tests with this command:\n```\n$ export CLUSTER_ENDPOINT=<your cluster endpoint>\n$ export DJANGO_SETTINGS_MODULE=aurora_dsql_django.tests.test_settings\n$ pytest -v aurora_dsql_django/tests/integration/\n```\n\n### Documentation \n\nSphinx is used for documentation. You can generate HTML locally with the following:\n\n```\n$ pip install -r requirements-docs.txt\n$ pip install -e .\n$ cd docs\n$ make html\n```\n\n## Getting Help\n\nPlease use these community resources for getting help.\n* Open a support ticket with [AWS Support](http://docs.aws.amazon.com/awssupport/latest/user/getting-started.html).\n* If you think you may have found a bug, please open an [issue](https://github.com/awslabs/aurora-dsql-django/issues/new).\n\n## Opening Issues\n\nIf you encounter a bug with the Aurora DSQL Django adapter, we would like to hear about it. Please search the [existing issues](https://github.com/awslabs/aurora-dsql-django/issues) and see if others are also experiencing the issue before opening a new issue. When opening a new issue please follow the template.\n\nThe GitHub issues are intended for bug reports and feature requests. For help and questions with using Aurora DSQL Django adapter, please make use of the resources listed in the [Getting Help](https://github.com/awslabs/aurora-dsql-django#getting-help) section. Keeping the list of open issues lean will help us respond in a timely manner.\n\n## License\n\nThis library is licensed under the Apache 2.0 License.\n",
"bugtrack_url": null,
"license": "Apache License 2.0",
"summary": "Django adapter for Aurora DSQL",
"version": "0.1.0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b4f3bb562b4501b5c095afd0ae0743db7152fe28828dc9c2091d9ead16467556",
"md5": "7658f3af0108bd705598b387c0a5681e",
"sha256": "b70811985a40f41edd92eaadd5a328446e77c2b2486f059615ed66c930ee8a2e"
},
"downloads": -1,
"filename": "aurora_dsql_django-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7658f3af0108bd705598b387c0a5681e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 21171,
"upload_time": "2024-12-04T21:16:05",
"upload_time_iso_8601": "2024-12-04T21:16:05.841306Z",
"url": "https://files.pythonhosted.org/packages/b4/f3/bb562b4501b5c095afd0ae0743db7152fe28828dc9c2091d9ead16467556/aurora_dsql_django-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "16dbae87fb6ee44ce0068f91269da86bce409642a337e873db643100a1c221c4",
"md5": "665e78dc559d0c7add6efdd19d8e912e",
"sha256": "343beaa0f4dbdfacaf9b23b81ab641eb7a032419411fe19450f5e8e7265439fa"
},
"downloads": -1,
"filename": "aurora_dsql_django-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "665e78dc559d0c7add6efdd19d8e912e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 16817,
"upload_time": "2024-12-04T21:16:06",
"upload_time_iso_8601": "2024-12-04T21:16:06.770812Z",
"url": "https://files.pythonhosted.org/packages/16/db/ae87fb6ee44ce0068f91269da86bce409642a337e873db643100a1c221c4/aurora_dsql_django-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-04 21:16:06",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "aurora-dsql-django"
}