added more information to the readme
This commit is contained in:
parent
8449230620
commit
62a1ab2b92
|
@ -1,3 +1,12 @@
|
||||||
# Contributing
|
# 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 .
|
||||||
|
|
19
README.md
19
README.md
|
@ -7,4 +7,21 @@ Feel free to fork and play with it.
|
||||||
|
|
||||||
# Setup development environment
|
# 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`
|
||||||
|
|
|
@ -2,4 +2,4 @@ from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
class CallbacksConfig(AppConfig):
|
class CallbacksConfig(AppConfig):
|
||||||
name = 'callbacks'
|
name = "callbacks"
|
||||||
|
|
|
@ -2,6 +2,4 @@ from django.conf.urls import url
|
||||||
|
|
||||||
from .consumers import WebhookConsumer
|
from .consumers import WebhookConsumer
|
||||||
|
|
||||||
websocket_urlpatterns = [
|
websocket_urlpatterns = [url(r"^ws/callback/(?P<uuid>[^/]+)/$", WebhookConsumer)]
|
||||||
url(r'^ws/callback/(?P<uuid>[^/]+)/$', WebhookConsumer),
|
|
||||||
]
|
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == "__main__":
|
||||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'webhook_logger.settings')
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webhook_logger.settings")
|
||||||
try:
|
try:
|
||||||
from django.core.management import execute_from_command_line
|
from django.core.management import execute_from_command_line
|
||||||
except ImportError as exc:
|
except ImportError as exc:
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
from channels.routing import ProtocolTypeRouter, URLRouter
|
from channels.routing import ProtocolTypeRouter, URLRouter
|
||||||
from callbacks.routing import websocket_urlpatterns
|
from callbacks.routing import websocket_urlpatterns
|
||||||
|
|
||||||
application = ProtocolTypeRouter({
|
application = ProtocolTypeRouter({"websocket": URLRouter(websocket_urlpatterns)})
|
||||||
"websocket": URLRouter(websocket_urlpatterns)
|
|
||||||
})
|
|
||||||
|
|
|
@ -11,6 +11,6 @@ import os
|
||||||
|
|
||||||
from django.core.wsgi import get_wsgi_application
|
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()
|
application = get_wsgi_application()
|
||||||
|
|
Loading…
Reference in New Issue