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 AppLogListAPIView(CommonFilteringListView): | |
| ... | |
| def get(self, request, *args, **kwargs): | |
| """ | |
| --- | |
| serializer: sa_logs.serializers.AppLogListSerializer | |
| parameters_strategy: merge | |
| omit_parameters: | |
| - path | |
| parameters: |
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 AppLogListAPIView(CommonFilteringListView): | |
| """ | |
| API call to get list of App logs (including filtering). | |
| """ | |
| ... | |
| @add_response_errors((400, 401, 403, 405, 408)) | |
| @add_input_query_parameters(InputAppLogSerializer, add_pagination=True) | |
| def get(self, request, *args, **kwargs): | |
| """ | |
| --- |
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
| API_ERRORS = dict( | |
| [ | |
| (400, 'Wrong input data'), | |
| (401, 'Not authenticated / Invalid signature(token)'), | |
| (403, 'User has one-time password'), | |
| (404, 'Object not found'), | |
| (405, 'Method not allowed'), | |
| (408, 'Request timeout'), | |
| ] | |
| ) |
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
| import collections | |
| from django.conf import settings | |
| from rest_framework import fields | |
| from rest_framework.settings import api_settings | |
| field_to_yaml_type = collections.defaultdict( | |
| lambda: 'string', |
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
| ... | |
| if __name__ == '__main__': | |
| ... | |
| if len(sys.argv) > 1: | |
| # Django management commands | |
| if sys.argv[1] == 'manage': | |
| os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") | |
| from django.core.management import execute_from_command_line | |
| args = ['./manage.py'] + sys.argv[2:] |
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
| import inspect | |
| import os | |
| import sys | |
| import django.core.management | |
| import django.utils.autoreload | |
| PROJECT_PATH = os.path.realpath(os.path.dirname(inspect.getfile(inspect.currentframe()))) | |
| sys.path.append(os.path.join(PROJECT_PATH, 'apps'),) |
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
| #!/bin/sh | |
| REPO_ROOT=`git rev-parse --show-toplevel` | |
| AUTHORS_FILE="AUTHORS.txt" | |
| if grep -xq "${GIT_AUTHOR_NAME} <${GIT_AUTHOR_EMAIL}>" "${REPO_ROOT}/${AUTHORS_FILE}" | |
| then | |
| exit 0; | |
| else | |
| echo "********************************************************************************" |
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
| ALLOWED_HOSTS = ['example.com'] | |
| DEBUG = False | |
| DATABASES = { | |
| 'default': { | |
| 'ENGINE': 'django.db.backends.postgresql', | |
| 'NAME': 'production_db', | |
| 'USER': 'user', | |
| 'PASSWORD': 'password', | |
| 'HOST': 'db.example.com', | |
| 'PORT': '5432', |
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
| ALLOWED_HOSTS = ['localhost'] | |
| DEBUG = True | |
| DATABASES = { | |
| 'default': { | |
| 'ENGINE': 'django.db.backends.postgresql', | |
| 'NAME': 'local_db', | |
| 'HOST': '127.0.0.1', | |
| 'PORT': '5432', | |
| } | |
| } |
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
| from .base import * | |
| ALLOWED_HOSTS = ['localhost'] | |
| DEBUG = True | |
| DATABASES = { | |
| 'default': { | |
| 'ENGINE': 'django.db.backends.postgresql', | |
| 'NAME': 'local_db', | |
| 'HOST': '127.0.0.1', |
OlderNewer