This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SECURE_HSTS_SECONDS = 86400 # 1 day | |
| SECURE_HSTS_INCLUDE_SUBDOMAINS = True | |
| SECURE_HSTS_PRELOAD = True | |
| SECURE_BROWSER_XSS_FILTER = True | |
| SECURE_CONTENT_TYPE_NOSNIFF = True | |
| X_FRAME_OPTIONS = 'DENY' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <iframe frameborder="0" scrolling="no" marginheight="0" | |
| marginwidth="0" width="100%" height="100%" | |
| src="https://dashboard.hypertrack.io/widget/users/<YOUR_USER_ID>/timeline;action_id=<YOUR_ACTION_ID>?key=SECRET_KEY"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Swift and Java | |
| HyperTrack.setUserId("249d26da-c31c-4a70-bab8-53ef164411f0"); | |
| HyperTrack.startTracking(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| HyperTrack.setUserId("249d26da-c31c-4a70-bab8-53ef164411f0") | |
| HyperTrack.startTracking() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| input { | |
| syslog { | |
| port => "1514" | |
| tags => ["input_core_api_syslog"] | |
| } | |
| syslog { | |
| port => "1515" | |
| tags => ["input_mqtt_broker_syslog"] | |
| } | |
| syslog { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @shared_task(bind=True, max_retries=settings.EVENT_MAX_RETRIES) | |
| def push_event(self, event_id): | |
| event = Event.objects.get(id=event_id) | |
| # code to push webhook |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| with transaction.atomic(): | |
| # update task | |
| # update driver | |
| event = Event.objects.create(...) | |
| push_event.delay(event.id) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @shared_task(base=TransactionAwareTask, bind=True, max_retries=settings.EVENT_MAX_RETRIES) | |
| def push_event(self, event_id): | |
| event = Event.objects.get(id=event_id) | |
| # code to push webhook |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class TransactionAwareTask(Task): | |
| ''' | |
| Task class which is aware of django db transactions and only executes tasks | |
| after transaction has been committed | |
| ''' | |
| abstract = True | |
| def apply_async(self, *args, **kwargs): | |
| ''' | |
| Unlike the default task in celery, this task does not return an async |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class TransactionAwareTask(Task): | |
| ''' | |
| Task class which is aware of django db transactions and only executes tasks | |
| after transaction has been committed | |
| ''' | |
| abstract = True | |
| def apply_async(self, *args, **kwargs): | |
| ''' | |
| Unlike the default task in celery, this task does not return an async |
NewerOlder