Skip to content

Commit

Permalink
update community
Browse files Browse the repository at this point in the history
  • Loading branch information
Taseen18 committed Apr 1, 2024
1 parent 6ef4825 commit 3096327
Show file tree
Hide file tree
Showing 20 changed files with 12 additions and 4 deletions.
Binary file modified backend/backend/__pycache__/settings.cpython-311.pyc
Binary file not shown.
Binary file modified backend/backend/__pycache__/urls.cpython-311.pyc
Binary file not shown.
1 change: 1 addition & 0 deletions backend/backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

INSTALLED_APPS = [
'to_do_list',
'community',
'rest_framework',
'corsheaders',
'django.contrib.admin',
Expand Down
3 changes: 2 additions & 1 deletion backend/backend/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@

urlpatterns = [
path('admin/', admin.site.urls),
path('to_do_list/', include('to_do_list.urls'))
path('to_do_list/', include('to_do_list.urls')),
path('community/', include('community.urls'))
]
Binary file not shown.
Binary file added backend/community/__pycache__/admin.cpython-311.pyc
Binary file not shown.
Binary file added backend/community/__pycache__/apps.cpython-311.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added backend/community/__pycache__/urls.cpython-311.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
6 changes: 6 additions & 0 deletions backend/community/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.urls import path
from .views import PostListCreate

urlpatterns = [
path('postList/', PostListCreate.as_view(), name='post-list-create'),
]
2 changes: 1 addition & 1 deletion backend/community/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# all_posts = Posts.objects.all
# return render(request, '../../web/src/components/post.js')

class TaskListCreate(APIView):
class PostListCreate(APIView):
permission_classes = [IsAuthenticated]

def get(self, request):
Expand Down
Binary file modified backend/to_do_list/__pycache__/authentication.cpython-311.pyc
Binary file not shown.
Binary file modified backend/to_do_list/__pycache__/db_service.cpython-311.pyc
Binary file not shown.
Binary file modified backend/to_do_list/__pycache__/urls.cpython-311.pyc
Binary file not shown.
Binary file modified backend/to_do_list/__pycache__/views.cpython-311.pyc
Binary file not shown.
1 change: 0 additions & 1 deletion backend/to_do_list/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# urls.py in your Django app

from django.urls import path
from .views import TaskListCreate, TaskUpdate
Expand Down
3 changes: 2 additions & 1 deletion web/src/components/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ function Post() {
const response = await fetch('/community/postList', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Content-Type': 'application/json',
//'Authorization': `Bearer ${token.session.access_token}`,
},
});
const data = await response.json();
Expand Down

0 comments on commit 3096327

Please sign in to comment.