# Django can't make first get post function

**URL:** <https://forum.scylladb.com/t/django-cant-make-first-get-post-function/3013>\
**Category:** Database Community\
**Tags:** troubleshooting, django\
**Created:** [October 7, 2024, 12:59am UTC](https://forum.scylladb.com/t/django-cant-make-first-get-post-function/3013 "2024-10-07T00:59:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Khaled\_Abdelbar](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.scylladb.com/khaled_abdelbar/32/969_2.png) [@Khaled\_Abdelbar](https://forum.scylladb.com/u/Khaled_Abdelbar)\
**Post date:** [October 7, 2024, 12:59am UTC](https://forum.scylladb.com/t/django-cant-make-first-get-post-function/3013/1 "2024-10-07T00:59:52Z")

</div>

i can’t make first get post function

---

<div class="post-metadata">

**Author:** ![felipemendes](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.scylladb.com/felipemendes/32/11_2.png) [@felipemendes](https://forum.scylladb.com/u/felipemendes)\
**Post date:** [October 7, 2024, 1:50pm UTC](https://forum.scylladb.com/t/django-cant-make-first-get-post-function/3013/2 "2024-10-07T13:50:26Z")

</div>

Hard to assist with so few details. Please state exactly what you are trying to do, which steps you’ve taken, what is going wrong, and any other relevant info as needed.

If you are using the `django-scylla` Pypi, you may also want to check out their own docs and ask in their discord server. See [django-scylla · PyPI](https://pypi.org/project/django-scylla/)

---

<div class="post-metadata">

**Author:** ![Khaled\_Abdelbar](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.scylladb.com/khaled_abdelbar/32/969_2.png) [@Khaled\_Abdelbar](https://forum.scylladb.com/u/Khaled_Abdelbar)\
**Post date:** [October 8, 2024, 2:18am UTC](https://forum.scylladb.com/t/django-cant-make-first-get-post-function/3013/3 "2024-10-08T02:18:52Z")

</div>

thanks for replaying to me

from rest\_framework import serializers  
from .models import \*  
class BlogPostSerializer(serializers.ModelSerializer):  
class Meta:  
model = BlogPost  
fields = ‘ **all** ’  
def create(self):  
return BlogPost.title

from django.shortcuts import render  
from django.http import JsonResponse  
from rest\_framework import status, generics,request  
from rest\_framework.decorators import api\_view  
from rest\_framework.response import Response  
from .models import BlogPost  
from .serializers import \*

# Create your views here.

class BlogPostListCreate(generics.ListCreateAPIView):  
serializer\_class = BlogPostSerializer

```
def get_queryset(self):
    # Fetch all blog posts using Cassandra's querying system
    # Cassandra may not support .all() in the same way as Django ORM.
    return BlogPost.objects.all()

def get(self, request, *args, **kwargs):
    queryset = self.get_queryset()
    serializer = self.get_serializer(queryset, many=True)
    return Response(serializer.data)

def post(self, request, *args, **kwargs):
    return self.create(request, *args, **kwargs)

```

import uuid  
from datetime import datetime  
from django.db import models  
from cassandra.cqlengine import columns  
from django\_cassandra\_engine.models import DjangoCassandraModel

class BlogPost(DjangoCassandraModel):  
id = columns.UUID(primary\_key=True, default=uuid.uuid4)  
title = columns.Text(required=True)  
content = columns.Text()  
created\_at = columns.DateTime(default=datetime.now)  
class Meta:  
app\_label = ‘galo’  
DATABASES = {  
‘default’: {  
‘ENGINE’: ‘django\_cassandra\_engine’,  
‘NAME’: ‘my\_keyspace’, # Keyspace in ScyllaDB  
‘HOST’: ‘127.0.0.1’, # ScyllaDB instance  
‘PORT’: ‘9042’,  
‘USER’: ‘’, # Leave empty if no authentication  
‘PASSWORD’: ‘’,  
‘OPTIONS’: {  
‘replication’: {  
‘strategy\_class’: ‘SimpleStrategy’,  
‘replication\_factor’: 1  
}  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![felipemendes](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.scylladb.com/felipemendes/32/11_2.png) [@felipemendes](https://forum.scylladb.com/u/felipemendes)\
**Post date:** [October 8, 2024, 10:56pm UTC](https://forum.scylladb.com/t/django-cant-make-first-get-post-function/3013/4 "2024-10-08T22:56:29Z")

</div>

There’s no error, so we still can’t crystal ball this 🙂

---

<div class="post-metadata">

**Author:** ![Khaled\_Abdelbar](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.scylladb.com/khaled_abdelbar/32/969_2.png) [@Khaled\_Abdelbar](https://forum.scylladb.com/u/Khaled_Abdelbar)\
**Post date:** [October 9, 2024, 1:08pm UTC](https://forum.scylladb.com/t/django-cant-make-first-get-post-function/3013/5 "2024-10-09T13:08:09Z")

</div>

gives me keysapce problem

---

<div class="post-metadata">

**Author:** ![Khaled\_Abdelbar](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.scylladb.com/khaled_abdelbar/32/969_2.png) [@Khaled\_Abdelbar](https://forum.scylladb.com/u/Khaled_Abdelbar)\
**Post date:** [November 10, 2024, 11:13pm UTC](https://forum.scylladb.com/t/django-cant-make-first-get-post-function/3013/6 "2024-11-10T23:13:24Z")

</div>

i forget to tell i solved it for a while
