Novend
Novend
DV
How to use filter method by user input to fetch data from database in django.
If there's 2 fields and either of the field only needed to fetch those datas
Dirn
DV
Віталій
Hello everyone, who can help? I record data in the database and have the ability to edit it, I need to somehow indicate that the data has been edited, how can it be done
Maxim
Віталій
just add edited field
bool or datetime (nullable)
I have users who fill out forms and there is a moderator who checks all the data, users have the option to edit the form data, I need to show the moderator that the data has been edited, who knows how to do it
Abu r
Hi
I am getting the error
MySQLdb.ProgrammingError: (1146, "Table 'DB.products_app_mainproduct' doesn't exist")
I tried deleting the migration folders also i have deleted the database and recreated ( in MySQL ).
The error is coming when using python manage.py , I can't run the makemigration command as the error is appearing so that the process is not completing .
I am using ubuntu with gunicorn and nginx.
Maxim
Вячеслав
Hello, I try to create new item in the celery task.
Code looks like:
@shared_task
def send_logs():
Model.objects.create(...)
new objects were created, but I can't see them in admin panel.
Вячеслав
I checked creating new objects with Model.objects.count() before and after running task. The length were different. But in admin panel I didn't see objects
Вячеслав
Why does it work so?
The Inspired
Why does it work so?
you have to register your model in admin...
go to your app's admin folder and register with admin.site.register(your model)
Вячеслав
I did it. I have got one item, which I created a few days ago. But I didn't see new items
The Inspired
and you can see your data in your database?
Вячеслав
yes
Вячеслав
I see model and one item. Work as usually Django model in admin
Rajesh
hey guys how to use multiple table using foreign key in djongo Mongodb.I created a two tables which is like Restaurant is main table and menu for that restaurant using foreign key i can add data to restaurant table successfully using admin page the problem is while adding menu for that restaurant it shows like please select a valid data restaurant is not present...im trying to solve this problem on 2 days but i cant..Please help me..
The TokenTitan
Hello, Please a question
I am querrying a model, so I want to return up to 300 results, but I want to paginate it or do it such that the pages display just 30 results once, and then user can go to the next page, but while clicking the "NEXT", the next page will not query the database again, but will be part of the 300 returned results.
Or I am looking for a way to manage rendering many result without querying the database many times
.
Hello everyone, please tell me how to speed up data insertion via ORM? What can be improved in the code?
https://pastebin.com/HjCUhZ3W
The Inspired
Dirn
The TokenTitan
thank you
but I am not using drf (because I am not doing api) but the normal django template
The TokenTitan
Ram
Hi, I have used IsAuthenticated in a class view and also placed the syntax of simpleJWT in both settings and urls.
Now even the view is authenticated, I am not able to access that view. What can be the possible mistake I have made here?
Ram
The simpleJWT don't do token authentication automatically when I use IsAuthenticated?
Tanjiro
Is it okay if asked how to host my django project for.it to be accessible online ?
Maxim
Maxim
Rahul
Sam
Dirn
Dirn
Pagination also works with MVT
Mobin
Hi, in a class based view if I inherit from LoginRequiredMixin from contrib.auth.mixins, django will restrict users from accessing any method in that view. but I want to let the user to access the get() method but no the post(). how do I do that
AbdElrahman
Hi guys, in .env file how to set envrionment correctly and connect it with GOOGLE_DRIVE_STORAGE_JSON_FILE
Dirn
pranav
I closed my laptop after frustration so i can't provide code snippet but it was just a simple model with year as integerField but when I was giving it as an argument of required=False
I was getting error about this required argument, can anyone help
ask
ARCEE
guys does anyone have an idea how to use Nosql with Django
Dirn
Pandu
Charly
Charly
Most noob devs use mongo for relational systems, mocking features that come for free on a relational database. And not using the nice features of a schema less document based database.
А
While running my django project, terminal returned this error:
django.db.utils.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused (0x0000274D/10061)
Is the server running on that host and accepting TCP/IP connections?
connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused (0x0000274D/10061)
Is the server running on that host and accepting TCP/IP connections?
Bayram
А
'PORT' : '5432' ,
Qwerty
А
how to fix?
Qwerty
Start Postgres process on your pc
А
Qwerty
Already running.
It can't be. Check if there is a process that uses port 5432.
Use google for this.
UPD: for Mac 👇
sudo lsof -i :PORT
А
I use Windows.
Vasu
Needed Django 4 years experience guy who can contribute as individual for my requirement. Hyderabad candidates preferred
pranav
I am having hard time configuring aws s3 for my django projject to serve static and media file s, is there any tutorial you would recommend
Dirn
ADMIN_MEDIA_PREFIX = '/static/admin/'
AWS_ACCESS_KEY_ID = env('AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY = env('AWS_SECRET_ACCESS_KEY')
AWS_STORAGE_BUCKET_NAME = env('AWS_STORAGE_BUCKET_NAME')
AWS_S3_FILE_OVERWRITE = False
AWS_DEFAULT_ACL = None
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
Dirn
Set this in your settings of production file, install boto3 also
()
How to customise super admin
pranav
pranav
so now the static file is uploaded to s3 but css is still not applied on admin panel
Trap
Hello guys,
I have this code https://pastebin.com/hTyur8YA
The problem is when I try to add a new product through the admin panel, I get the error "Select a valid choice.** is not one of the available choices." What's wrong with my code?
Thanks
pranav
pranav
I had to configure some more things in settings like region and signature name and now everything is fine , video file is also getting uploaded to my bucket 👍
Tanjiro
Good day everyone, How can I integrate GCASH app as payment method in my django application
Mohsen
Valdez
Hi everyone, please how to integrate CinetPay API into a Django project. I tried to read the documentation but I can't. I integrate it into an e-commerce site. here is the site: https://docs.cinetpay.com/api/1.0-fr/sdk/python This API allows you to manage payments in Africa.
king
Charly
Valdez
In fact I'm new to django and I want to implement an application to download my documents but before downloading you pay a small sum of 100fcfa per pdf document. But the problem is that I don't know how to implement this CinetPay API with Django.
clouded
Charly
Mathew
I want to use jsonfield in django 3.0.7 version with MySQL as my DB .
How can I do it ??
vikrant
Hi everyone, please help me to fix this issue. I continuously receive Invalid HTTP_HOST header error email.
https://stackoverflow.com/questions/78622086/i-continuously-receive-invalid-http-host-header-error-email
Kuth
Islomjon Sheraliyev
I have a 3 models
Product
User
Basket
I've sent a product to Basket , but the content of product isnt showing in the basket, it looks like:
[
{
"id": 1,
"user": {
"id": 1,
"password": "islomjon2007",
"login": "islomzhonsheraliev",
"name": "Islomjon Sheraliyev",
"role": "admin"
},
"products": [ ]
}
]
here's the product api:
[
{
"id": 1,
"title": "Shuxrat",
"brand": "Shuxrat shinalari",
"description": "Shuxrat shinalari nomer 1",
"image": "http://127.0.0.1:8000/media/images/download_1_raenEd1.png",
"price": "500.00",
"size": "XXL",
"currency": "USD"
},
{
"id": 2,
"title": "trnyjryj",
"brand": "ertyerj",
"description": "rtshjrsh",
"image": "http://127.0.0.1:8000/media/images/%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA_%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0_12.png",
"price": "5000000.00",
"size": "3xxxl",
"currency": "UZS"
}
]
Tim