Skip to content

Commit

Permalink
added support for local dynamo server
Browse files Browse the repository at this point in the history
  • Loading branch information
mwaaas committed Nov 4, 2017
1 parent 434031a commit a07f3e2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dynamodb_sessions/backends/dynamodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
settings, 'DYNAMODB_SESSIONS_TABLE_HASH_ATTRIB_NAME', 'session_key')
ALWAYS_CONSISTENT = getattr(
settings, 'DYNAMODB_SESSIONS_ALWAYS_CONSISTENT', True)
LOCAL_DYNAMODB_SERVER = getattr(
settings, 'LOCAL_DYNAMODB_SERVER', None)

_BOTO_SESSION = getattr(
settings, 'DYNAMODB_SESSIONS_BOTO_SESSION', False)
Expand Down Expand Up @@ -61,7 +63,8 @@ def dynamodb_connection_factory():
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
region_name=AWS_REGION_NAME)
_DYNAMODB_CONN = _BOTO_SESSION.resource('dynamodb')
_DYNAMODB_CONN = _BOTO_SESSION.resource('dynamodb',
endpoint_url=LOCAL_DYNAMODB_SERVER)
return _DYNAMODB_CONN


Expand Down

0 comments on commit a07f3e2

Please sign in to comment.