Skip to content
Snippets Groups Projects
Commit fdc64a25 authored by Nico Vermaas's avatar Nico Vermaas
Browse files

some specific dev settings to get celery working on windows.

parent 291a64e4
No related branches found
No related tags found
No related merge requests found
No preview for this file type
...@@ -11,3 +11,4 @@ django-oidc-provider==0.7.0 ...@@ -11,3 +11,4 @@ django-oidc-provider==0.7.0
django-rest-knox==4.1.0 django-rest-knox==4.1.0
mozilla-django-oidc==1.2.3 mozilla-django-oidc==1.2.3
celery==4.4.6 celery==4.4.6
eventlet==0.24.1
\ No newline at end of file
-r base.txt -r base.txt
pypiwin32==223
\ No newline at end of file
SET OIDC_RP_CLIENT_ID="fancy"
SET OIDC_RP_CLIENT_SECRET="dude"
rem https://www.distributedpython.com/2018/08/21/celery-4-windows/#:~:text=Celery%20no%20longer%20officially%20supports,Celery%20version%20across%20your%20infrastructure.
rem celery worker -A esap.settings.dev --pool=eventlet --loglevel=INFO
celery worker -A esap.settings.dev --pool=solo --loglevel=INFO
SET OIDC_RP_CLIENT_ID="fancy"
SET OIDC_RP_CLIENT_SECRET="dude"
celery beat -A esap.settings.dev --loglevel=INFO
...@@ -15,6 +15,7 @@ urlpatterns += [ ...@@ -15,6 +15,7 @@ urlpatterns += [
# path('admin', admin.site.urls, name='admin-view'), # path('admin', admin.site.urls, name='admin-view'),
path('', views.IndexView.as_view(), name='index-view'), path('', views.IndexView.as_view(), name='index-view'),
path('my_staging', views.StagingListViewAPI.as_view(), name='staging-view'), path('my_staging', views.StagingListViewAPI.as_view(), name='staging-view'),
path('staging/test', views.test_function_call, name='test') path('staging/test', views.test_function_call, name='test'),
path('poll', views.poll_view, name='poll')
] ]
from django.views.generic import ListView from django.views.generic import ListView
from django_filters import rest_framework as filters from django_filters import rest_framework as filters
from django.http import JsonResponse
from rest_framework import viewsets, permissions, decorators, request, response, status from rest_framework import viewsets, permissions, decorators, request, response, status
from staging.tasks import create_request from staging.tasks import create_request, poll_status
from staging.models import Staging, StagingRequest from staging.models import Staging, StagingRequest
...@@ -61,3 +63,11 @@ def test_function_call(request: request.HttpRequest): ...@@ -61,3 +63,11 @@ def test_function_call(request: request.HttpRequest):
return response.Response(status=status.HTTP_201_CREATED, data={'request_id': request_id}) return response.Response(status=status.HTTP_201_CREATED, data={'request_id': request_id})
except KeyError: except KeyError:
return response.Response(status=status.HTTP_400_BAD_REQUEST, data='missing parameter surl') return response.Response(status=status.HTTP_400_BAD_REQUEST, data='missing parameter surl')
def poll_view(request):
poll_status()
#return response.Response(status=status.HTTP_200_OK)
return JsonResponse({'poll': "OK"})
#return response.JsonResponse({'poll': "OK"})
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment