You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a [Jazzband](https://jazzband.co/) project.
4
+
By contributing you agree to abide by the [Contributor Code of Conduct](https://jazzband.co/about/conduct) and follow the [guidelines](https://jazzband.co/about/guidelines).
5
+
6
+
## Contributing to Django Fernet Encrypted Fields
7
+
8
+
We welcome contributions from the community to improve and maintain Django Fernet Encrypted Fields.
9
+
Please follow these guidelines to ensure your contributions are accepted:
10
+
11
+
1.**Fork the Repository**: Start by forking the repository to a personal/organization GitHub account.
12
+
2.**Clone the Repository**: Clone the forked repository to your local machine.
13
+
3.**Set Up the Environment**: Set up a virtual environment and install the necessary
14
+
dependencies for development and testing.
15
+
```shell
16
+
$ python -m venv .venv
17
+
$ source .venv/bin/activate
18
+
$ pip install -r requirements.txt
19
+
```
20
+
4.**Install the pre-commit hooks**: We use [pre-commit](https://pre-commit.com/) to ensure code quality.
21
+
Install the pre-commit hooks by running:
22
+
```shell
23
+
$ pre-commit install
24
+
```
25
+
5.**Create a Branch**: Create a new branch for the feature or bug fix.
26
+
6.**Make Changes**: Make the changes and ensure they are well-documented.
27
+
7.**Run Tests**: Ensure all tests pass before submitting a pull request.
28
+
```shell
29
+
$ pip install coverage pytest
30
+
$ coverage3 run --source='./encrypted_fields' manage.py test
31
+
```
32
+
8.**Submit Pull Request**: Submit a pull request with a clear title, description of the changes,
Copy file name to clipboardExpand all lines: README.md
+19-5Lines changed: 19 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,15 @@ SALT_KEY = [
39
39
]
40
40
```
41
41
42
+
To generate a new `SECRET_KEY`, you can use Django's `get_random_secret_key` function.
43
+
44
+
```python
45
+
from django.core.management.utils import get_random_secret_key
46
+
47
+
new_secret_key = get_random_secret_key()
48
+
print(new_secret_key)
49
+
```
50
+
42
51
#### Rotating SECRET_KEY
43
52
44
53
When you would want to rotate your `SECRET_KEY`, set the new value and put your old secret key value to `SECRET_KEY_FALLBACKS` list. That way the existing encrypted fields will still work, but when you re-save the field or create new record, it will be encrypted with the new secret key. (supported in Django >=4.1)
@@ -57,7 +66,8 @@ for obj in MyModel.objects.all():
57
66
58
67
#### Available Fields
59
68
60
-
Currently build in and unit-tested fields. They have the same APIs as their non-encrypted counterparts.
69
+
Currently built-in and unit-tested fields include the following.
70
+
They have the same APIs as their non-encrypted counterparts.
61
71
62
72
-`EncryptedCharField`
63
73
-`EncryptedTextField`
@@ -72,11 +82,15 @@ Currently build in and unit-tested fields. They have the same APIs as their non-
72
82
73
83
| Compatible Django Version | Specifically tested | Python Version Required |
0 commit comments