Question: In my store locator page, google map appears for a few minutes and disappears , 
in console I get the error:

> 
> Google Maps JavaScript API error: RefererNotAllowedMapError
>  <https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error>
>  Your site URL to be authorized: <https://preprod.site.com/magasins>
> 
> 
> 

How could i resolve this issue?

Answer: 
make sure to flush before running just to make sure that there doesn't exist a list / stream with the same name. :

```
redis-cli flushall

```

```py
if __name__ == '__main__':
    r = redis.Redis(host='localhost', port=6379, db=0)
    encoder = JSONEncoder()
    sample = {"hello": encoder.encode([1234,125, 1235, 1235])} # converts list to string
    stream_name = 'mystream'

    for i in range(10):
        r.xadd(stream_name, sample)

    # "$" doesn't seem to work in python
    read_samples = r.xread({stream_name:b"0-0"})

```
Based on redis-py [documentation](https://redis-py.readthedocs.io/en/latest/_modules/redis/client.html#Redis.xread):

Redis intitalization:

```
redis = redis.Redis(host='localhost')

```

To add a key-value pair (key-value should be a dictionary):

```
redis.xadd(stream_name, {key: value})

```

Block to read:

```
redis.xread({stream_name: '$'}, None, 0)

```

1. stream\_name and ID should be a dictionary.
2. $ means the most new message.

> 
> Moreover, instead of passing a normal ID for the stream mystream I
>  passed the special ID $. This special ID means that XREAD should use
>  as last ID the maximum ID already stored in the stream mystream, so
>  that we will receive only new messages, starting from the time we
>  started listening.[from here](https://redis.io/topics/streams-intro)
> 
> 
> 

3. COUNT should be NONE if you want to receive the newest, not just any number of messages.
4. 0 for BLOCK option means Block with a timeout of 0 milliseconds (that means to never timeout)