added more information to the readme

This commit is contained in:
Gonçalo Valério 2019-01-13 17:41:34 +00:00
parent 8449230620
commit 62a1ab2b92
7 changed files with 34 additions and 12 deletions

View File

@ -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 .

View File

@ -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`

View File

@ -2,4 +2,4 @@ from django.apps import AppConfig
class CallbacksConfig(AppConfig):
name = 'callbacks'
name = "callbacks"

View File

@ -2,6 +2,4 @@ from django.conf.urls import url
from .consumers import WebhookConsumer
websocket_urlpatterns = [
url(r'^ws/callback/(?P<uuid>[^/]+)/$', WebhookConsumer),
]
websocket_urlpatterns = [url(r"^ws/callback/(?P<uuid>[^/]+)/$", WebhookConsumer)]

View File

@ -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:

View File

@ -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)})

View File

@ -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()