Zey
<class 'home.admin.ProductAdmin'>: (admin.E108) The value of 'list_display[4]' refers to 'offer', which is not a callable, an attribute of 'ProductAdmin', or an attribute or method on 'home.Product'.
Eng. Mohamed
I am sorry, I missed that, sorry again
Elii
I'm using simple JWT and want to implement Logout API in DRF But my code doesn't work. Do u guys have any idea?
Doragonsureiyā
I'm using simple JWT and want to implement Logout API in DRF But my code doesn't work. Do u guys have any idea?
Please provide a full explanation including all the details that you consider relevant. Your statement is too broad and there is no clear way to answer you, you have to explain: - what you're doing - what you're expecting - what you're using - where you're running the script - what Python version you're using - what packages and their versions you're using - and the most important thing: show the code YOU wrote (read rule 5️⃣ for that) and more details, that way your chances to get help will increase
Dharmu
Want to create a model where database value changed in some interval
Harish
Want to create a model where database value changed in some interval
You mean you want to track updates to an object's variable?
Zey
I want to upload my project on GitHub but my settings file contains sensitive information how I can make that file private?
Zey
Or how to secure that file?
Harish
But you shouldn't push sensitive information to GitHub
Zey
Actually I want to put that project into my resume so I have to give GitHub link or there any other option?
‎_/-\_¦--¦‎
You can either use environmental variables or for you sensative information or create another settings file and add it to git ignore this file can contain you sensative settings since it's ignore just provide instruction on how to set this file in the Readme or something
Zey
Thanks
‎_/-\_¦--¦‎
your welcome
Anonymous
Anyone use DRF real time with web sockets ?
Константин
Check django channels
+1 it is a good library and makes it easy to work with websockets
Anonymous
Check django channels
I want to implement it with existing model-serializer-view format(if possible). I rode the docs about channels but I can't figure out a way to implement with drf
AGASTRONICS
I need a quick start registration, login and profile with profile image
Anonymous
Hello, Does anyone know how to build a service which doesn't use a Database ? This using Django REST framework. The service is gonna be used only to valid data between other two services.
Vishnu
Hello guys, In my project, I have a model that contains a count field, there is any method to increase that count field value automatically everyday by 1 except sunday
sheikh
How to calculate count group by week in orm?
Aswith
I can't able to use my ip address as host in django it is showing error
Aswith
Even though I added my ip address to allowed_host in settings.py
Aswith
Actually I am trying to fetch data into react native
Baggy ️️
Just put *
Baggy ️️
Try it
Partha
Is there any log parser module in python??
Partha
The log file gets updated every 30 min, I need to check every 30 min if there is any error found I have to send an email with the error that occurred
Peter
I need assistance on Drf-Access policy package for managing my permissions in the project, aside from the documentation, do you have any helpful document/file?, be it a video or pdf I'll gladly appreciate Exclusively Drf-Access Policy related
Baggy ️️
Show the name of columns of table with primary key
Baggy ️️
And foreign key
Alikhanov Jakhongir
Hello, I was going back up sqlite3 database and restore it to postgresql but i am getting this error. django.db.utils.IntegrityError: Problem installing fixture '/home/app/web/db.json': Could not load auth.User(pk=3): duplicate key value violates unique constraint "users_profile_pkey" DETAIL: Key (id)=(7) already exists.
Alikhanov Jakhongir
Can anyone help me with this problem? goal is to convert the sqlite database to Postgresql
cj
I suggest use mysql
what? why? MySQL is a toy database, Django works 2000 times better with PostgreSQL
Jerome
mysql will not resolve a pk issue, just read your post, if you're still on sqlite you should delete this user then recreate it, also dumping from sqlite to another db is usually not a good idea, because of issues like that
Poojitha
can anyone tell me how to get current user username in models.py?
Eng. Mohamed
Or current_user = self.request.user
Bharathwajan
i am creating a blog site for that i created a comment box on that i was asked to select the blog everytime when i was commenting how to make that field auto selected
Anonymous
tg is quality software
Ali Vs
Hi How I get the username from Request in middleware?!??
Dhruv
can anyone tell that how can i send various data tables from views.py to my html page
Dhruv
i ve three different table and ive to print all of them to my html template
Pradeep
can anyone tell that how can i send various data tables from views.py to my html page
Create context dict with 3 keys as "table1", "table2" and "table3".... Pass the context to your template and access the tables with their names in the template
âshîsh
can anyone tell that how can i send various data tables from views.py to my html page
Fetch all data using queryset and send it as dictionary along with html page name
Dhruv
and how to print that dict on html page
Pradeep
Thats a basic of django and for that you should read django doc
Pradeep
can anyone tell me how to get current user username in models.py?
You need to pass request object from your views while accessing the model class.... eg def some_view(request): some_tests = Test.objects.user_test(request.user) # ...
Poojitha
how to use codeforces api in my website?
Poojitha
views.py def practice(request): response=requests.get('https://codeforces.com/api/problemset.problems').json() return render(request,'blog/practice.html',{'response':response}) urls.py path('practice',views.practice,name='practice') html file {% extends "blog/base.html" %} {% block content %} {% load static %} {% for i in response %} {{i.status}} {% endfor %} {% endblock content %}............no data is being displayed on browser can anyone tell the mistake
Abbas
Hi. How to add some date to the django model? Which model field may i use? Please help me
James
Can anyone help me. I face some problem when send data from html form to mysql database but i cant see it in my database and no any errors is raised
Jerome
Hi. How to add some date to the django model? Which model field may i use? Please help me
DateField & DateTimeField https://docs.djangoproject.com/en/3.2/ref/models/fields/#datefield
Abbas
DateField & DateTimeField https://docs.djangoproject.com/en/3.2/ref/models/fields/#datefield
i have three date (02.01.2021, 04.03.2021, 03.05.2021). How can i add database these? Which field can i use?
Jerome
i have three date (02.01.2021, 04.03.2021, 03.05.2021). How can i add database these? Which field can i use?
Is it dates related to models? or models related to dates? (if that makes sense..) if you need to put a date by yourself, use the DateField() then you can define the date you want in the admin panel (easiest way imo)
James
Hi developers is it possible to create own user model in django? And ignoring the default user model?
Jerome
Hi developers is it possible to create own user model in django? And ignoring the default user model?
Ye, it's even recommended. However the native user model is not bad, but restrictive.
Jerome
How can I add several times to the same field? I did not understand it. So like a list
hard to tell as i don't know your project & what you're trying to do... also i'm not a high level dev to get that instantly
James
Ye, it's even recommended. However the native user model is not bad, but restrictive.
Am suffering with some errors that is why i want to create my own user registration model
Jerome
it's not that easy to change the user model while your project is already on its way.. depends where you at, but you might rebuilt all the auth & user part
James
it's not that easy to change the user model while your project is already on its way.. depends where you at, but you might rebuilt all the auth & user part
I have done with AbstractUser class but when i trying to register new user nothing appears on my database and no any errors have been raised
Jerome
I can't help you more at this point, also you re on MySQL, i m not used to this db
Jerome
Oky
check this tuto, it's relatively simple, you'll get an idea at least https://learndjango.com/tutorials/django-custom-user-model
Jerome
you're welcome
James
Thanks
bikrant
Is there a way to serialise image and use in react?
kuzmich
Is there a way to serialise image and use in react?
Ofc, there is Image field You can do whatever you want on the backend and send it back to the frontend