Guru
How to define group based users roles using MySQL I am fresher in django any help would be appreciated
kam
T4P4N
T4P4N
kam
with your existing business logic
So i can start with default django for website and when needed turn my backend into an API to maintain both website and mobile applications? How labor intense is that?
T4P4N
T4P4N
typically blog things can turn into api within few hours max
Mirco
Mirco
Shabaz
When I'm doing cv2.imread() its opening a seperate window, I want that window to be opened in to my webapp i.e. chrome
yusof
hey guys
i have model name like this
class User:
#some field
def device_login_count(self):
return self.devicelogin_set.get_login_count(user=self)
and devicelogin is a reverse key to another model like this:
class DeviceLogin:
user = foreignkey(User)
def get_login_count(self, user):
return self.get_login(user=user).count()
does anyone know how should i use prefetch related to decrease queries for each user ?
Mohd
Hi guys, I loaded some html files in my django project and tried to acces them. The relative url of html is not working properly. Did anyone experience this?
CARPE
Ata Ul Munim
Hello guys!
Facing "apps aren't loaded yet" error while setting up asgi
Can anyone help??
Joao Paulo
Hello ! Can someone Help me? I need to implement a funcion wich returns the number of visualizatios of an especific object from a model class. This object comes from the search bar. Thanks !!
Semyon
Sanket
In ajax delete function
Sanket
Anyone know
Vinayreddy
Kazi
✋ guys, I am stuck at django social logging using firebase in django rest framework. Can anyone help me out of this? Or any video or blog suggestions would be great!
Charly
Anyone know
Know what? You haven't asked a question you just said random things
Charly
Ajay
Hi guys, I am having a problem while using jinja in css background URL
style="background-image:url({% static '/images/beach.svg' %})"
Ajay
if i do this it shows multiple errors
Anonymous
Ajay
) expectedcss(css-rparentexpected)
Ajay
semi-colon expectedcss(css-semicolonexpected)
at-rule or selector expectedcss(css-ruleorselectorexpected)
Charly
Anonymous
Anonymous
I am using django rest, i had 2 apis, in one api i need only 2 field from the serializer and other api i need full fields from serilaizer, i need to use only one serializer for both the above cases, can i use the same serilaizer for this?
Anonymous
not_found
I am trying to save json.file data into djnago dB, So I am facing error when I am try to save "" in integer field how I can save blank("") in integer field
Charly
not_found
Ajay
Sanket
Sanket
How to delete a table row using ajax
Charly
How to delete a table row using ajax
It depends on what does represent that row, a model instance?
If yes just create a view to handle the delete, and do your ajax request to do it
Sanket
deleteItem: function (row) {
return $.ajax({
method : "GET"
type: "DELETE"
url: "(%ur1 delete )" +table . id,
data:(" row" : row, "table" ; table)
Sanket
I have created ajax like as
SANKET.....❤
fn
Hi everyone!
Did anybody try django-filter package?
Case:
Two models, X and Z.
Z model has foreign key field pointing to X model.
In views, I am counting the number of objects of Z model according to the objects of X model using query with annotation() to X model and rendered it.
Question: How to filter X model's query, that is rendered to .html using another field of Z model?
Anonymous
Aris
HI, Is MPTT not working anymore on django 4.0
Amit
def profileform(request):
if request.method == "POST":
name =request.POST.get('name')
mail_id =request.POST.get('mail_id')
mobile_number =request.POST.get('mobile_number')
about =request.POST.get('about')
address =request.POST.get('address')
interest =request.POST.get('interest')
profile_img =request.FILES['profile_img']
profileform =Profile(name=name, address=address, profile_img=profile_img, mail_id=mail_id, mobile_number=mobile_number, about=about, interest=interest)
profileform.save()
return render(request, 'createprofile.html')
Amit
MultiValueDictKeyError at /createprofile
'profile_img'
Request Method: POST
Request URL: http://127.0.0.1:8000/createprofile
Django Version: 3.2.9
Exception Type: MultiValueDictKeyError
Exception Value:
'profile_img'
Exception Location: C:\Users\mohan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\django\utils\datastructures.py, line 78, in getitem
Python Executable: C:\Users\mohan\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe
Python Version: 3.9.10
Amit
i m getting multivaluedictkey error
Amit
please help
Charly
Amit
you are not sending a field with that name
class Profile(models.Model):
name = models.CharField(max_length=200)
mobile_number = models.CharField(max_length=200)
mail_id = models.EmailField(max_length=200)
address = models.CharField(max_length=200)
about = models.CharField(max_length=200)
interest = models.CharField(max_length=1000)
skills= models.ManyToManyField(Langauge_skill)
profile_img= models.ImageField(upload_to='media/profileimg',blank=True)
def str(self):
return self.name
Charly
Anonymous
How to save particular field object in drf serializer in def save(self)
Amit
is it right sir i m fresher so i m not getting your point
Amit
Charly
Amit
http://dpaste.org/nDZt
Amit
show it
done i have added enctype='multipart/form-data' in form tag
Amit
STATIC_URL = '/static/'
STATICFILES_DIRS = [
BASE_DIR / "static",
]
Amit
Add this in seetings.py
PRAVEEN
also make sure you add {% load static %} in your template 🙂
Samaneh
Hi guys. How can i load Form error feild in my template?
Amit
Then only add static URL only
أيمن سليم عامر
Hi guys, i have two applications one is django and the other is flask in need to use make_password in flask to rest django user password
༆𖤍ཽ🇻 G⃖r༙e༙y༙h༙a༙t༙⚚×͡×
Hey guys, I want to make django app in which user can submit questions and answers and also with like and dislike button then what should I do
༆𖤍ཽ🇻 G⃖r༙e༙y༙h༙a༙t༙⚚×͡×
Anyone can help 🙏
Haresh
Study
Nirav
༆𖤍ཽ🇻 G⃖r༙e༙y༙h༙a༙t༙⚚×͡×
It has readymade poll application
In poll app questions and answers are already present but i want that user can create a question and answer to that question