diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1df1192..75b2b8d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,12 @@ # Contributing -Add later +All contributions that try to improve the project in any way are welcome. + +The only prerequisites are: + +- Be respectful + +- When describing an issue or a new feature, try to provide as much information as possible + +- All your python code contributions, should be formatted by `black`. An easy way to do it, is to run the following command after completing your changes: + > \$ black . diff --git a/README.md b/README.md index 2adc97f..e00b008 100644 --- a/README.md +++ b/README.md @@ -7,4 +7,21 @@ Feel free to fork and play with it. # Setup development environment -Instructions will be added soon +To run the project locally you just need to have a machine with `python` and `pipenv` installed then: + +1. Install redis-server + +2. Copy the sample file with the environment variables: + + > \$ cp .env.sample .env + +3. Replace the configuration variables + +4. Install the dependencies + + > \$ pipenv install --dev + +5. Run the server + > \$ pipenv run python manage.py runserver + +Then the project should be available on: `http://localhost:8000` diff --git a/callbacks/apps.py b/callbacks/apps.py index 1d69586..3de7790 100644 --- a/callbacks/apps.py +++ b/callbacks/apps.py @@ -2,4 +2,4 @@ from django.apps import AppConfig class CallbacksConfig(AppConfig): - name = 'callbacks' + name = "callbacks" diff --git a/callbacks/routing.py b/callbacks/routing.py index 6e17bbe..f566c83 100644 --- a/callbacks/routing.py +++ b/callbacks/routing.py @@ -2,6 +2,4 @@ from django.conf.urls import url from .consumers import WebhookConsumer -websocket_urlpatterns = [ - url(r'^ws/callback/(?P[^/]+)/$', WebhookConsumer), -] +websocket_urlpatterns = [url(r"^ws/callback/(?P[^/]+)/$", WebhookConsumer)] diff --git a/manage.py b/manage.py index 72d097d..5464b5e 100755 --- a/manage.py +++ b/manage.py @@ -2,8 +2,8 @@ import os import sys -if __name__ == '__main__': - os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'webhook_logger.settings') +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webhook_logger.settings") try: from django.core.management import execute_from_command_line except ImportError as exc: diff --git a/webhook_logger/routing.py b/webhook_logger/routing.py index cca1c69..d7fbbd2 100644 --- a/webhook_logger/routing.py +++ b/webhook_logger/routing.py @@ -1,6 +1,4 @@ from channels.routing import ProtocolTypeRouter, URLRouter from callbacks.routing import websocket_urlpatterns -application = ProtocolTypeRouter({ - "websocket": URLRouter(websocket_urlpatterns) -}) +application = ProtocolTypeRouter({"websocket": URLRouter(websocket_urlpatterns)}) diff --git a/webhook_logger/wsgi.py b/webhook_logger/wsgi.py index d62ca63..0b2d137 100644 --- a/webhook_logger/wsgi.py +++ b/webhook_logger/wsgi.py @@ -11,6 +11,6 @@ import os from django.core.wsgi import get_wsgi_application -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'webhook_logger.settings') +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webhook_logger.settings") application = get_wsgi_application()