Anonymous
How to access logged in user in models.py
Fan / Ac
How to access logged in user in models.py
create a new table and store user id of logged in users ?? or use django.contrib.sessions.models.Session
Reflex
Django gets error when deleting user get_user_model().objects.delete_user(user) How to delete user?
Nancy
Anybody know the solution of this error Models is not defined
Nancy
Import h
Doragonsureiyā
Import h
To share code or error tracebacks, use a pasting service, like: - https://linkode.org - https://dpaste.org
Maxim
Import h
import Models, not h
Nancy
Ok
k
icontains is not working. It is giving results as if contains only. Db : mysql Os : macbook air Framework : drf Ide : pycharm Any idea why this is happening or how to solve this?
Somebody
Hey, i faced problem , that is carousel(slides feature)in bootstrap option not working in with django. anyone who can solve this problem
k
https://dpaste.org/sdrAi
k
This one is the right one. Can someone help?
k
Maybe your code is wrong 🤷‍♂
@Carlangueitor anything now?
Vlad
Please tell me a way to implement reviews on the site, through Google authorization. No google store
mahdi
Hello to all How can I identify in the views whether the user is an admin or not?
Yuriy
Hi. I have a Filefield field with a file in the admin panel. How to make it when clicking on a link it opens in a new window?
Somebody
Somebody, [30-04-2022 11:34 PM] Hey, i faced problem , that is carousel(slides feature)in bootstrap option not working in with django. anyone who can solve this problem , here its code https://linkode.org/#JobX5Qbs2YqafVBawza5x3.
Abdullaev
Guyz which is better gunicorn or uwsgi?
Angel
Guyz which is better gunicorn or uwsgi?
uwsgi by far… a lot customizations and statistics, check fast route feature and sockets support, those are my favorites ;)
Harry gorilla
I want to put all the autogenerated media folder in my gitignore, am just wondering which name i should use to ignore such files.
Doragonsureiyā
I want to put all the autogenerated media folder in my gitignore, am just wondering which name i should use to ignore such files.
Your question is not related to Django. If it's a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.
Harry gorilla
I want to put all the autogenerated media folder in my gitignore, am just wondering which name i should use to ignore such files.
https://djangowaves.com/tips-tricks/gitignore-for-a-django-project/ I mean, i just added media to my .gitignore but i can still see the media folder in my github repo
Д
I want to put all the autogenerated media folder in my gitignore, am just wondering which name i should use to ignore such files.
if it's already in git, then adding it to .gitignore won't remove it from the repository.
Azizbek Xushnazarov
I can't count the number of sql queries in django. connection.queries is returning empty list. here is my decorator: def count_query(func): async def wrapper(*args, **kwargs): result = await func(*args, **kwargs) total_queries_count = sum(len(c.queries) for c in connections.all()) print(total_queries_count) return result return wrapper
Ionut
Hey guys! I am having some issues with the admin (in development on 127.0.0.1, I haven't tried yet in production): when I log in in the admin panel, whenever I make a request from the website to the API, it returns 403 (forbidden). If I logout, everything works like a charm again... What am I missing? I would also love to know if is there a way to make the admin panel "look better"? Idk... by installing a package, or dropping some files in the "static" folder?
Cabrel Tchomte
Good idea to start directly with DRF ( Django Rest Framework) ? 🤔
Cabrel Tchomte
With knowledge in Hello World, OOP Python of course 😅
Cabrel Tchomte
I saw, but for backend devs. is it necessary to learn all Django ?
Maxim
and i don't think anyone knows Django in its entirety
Cabrel Tchomte
For someone who has knowledge in python, can switch directly in DRF or not?
Maxim
DRF is not a standalone product, you can't use it without knowing anything about Django
Cabrel Tchomte
Ok.
Maxim
you can "switch", but you have to learn Django along with DRF
Cabrel Tchomte
Ok thanks. Good received 👍
Reflex
openid is supported by django allauth,, The question is, which of this two? the deprecated [openid] or the preferred one [openid connect] 🤔
Leo
If django-allauth supports
Reflex
Sure?
Jb Mani
Django full movie Tamil linge sand
Rohan
Movie?
Rohan
I think he’s confusing this group with Django unchained
Rohan
rtg
¿Is the same create app, or copy a created app to the folder and add to installed_apps?
Mekdim
Guys i already have to apps in my django project and when i try to the third its not routing to the template i created i figured the all the file as i use for the second as well for the firs app
rtg
SOS:
rtg
File "/home/retegi/Documents/proyectos/webretegi/env/lib/python3.8/site-packages/django/core/servers/basehttp.py", line 49, in get_internal_wsgi_application raise ImproperlyConfigured( django.core.exceptions.ImproperlyConfigured: WSGI application 'webretegi.wsgi.application' could not be loaded; Error importing module.
rtg
The problem was Middleware ; )
rtg
Question: Is correct to use SqLite database for a Blog web project and administrator system? I am not sure to use SqLite or PostgreSQL. What do you think about? Thanks!
Anonymous
can i restrict permissions to specific methods of class only(not to whole class) in DRF
J
Hi. How can I make "created_at" be returned to the client but not accepted when the request is sent (django restframework) class MessageSerializer(serializers.ModelSerializer): chat_id = serializers.PrimaryKeyRelatedField( queryset=Chat.objects.all() ) text = serializers.CharField() class Meta: model = Message fields = ( "id", "text", "chat_id", "user_id", "created_at"
Moshe
For someone who has knowledge in python, can switch directly in DRF or not?
If you are looking just for stand alone restapi I do recommend fastapi
C
Hi
C
How can wirte MySQL query in django
C
Any please help me
J
I think you can just make it one of the read_only_fields
thanks. now i need to get some post data but not return it))
J
How can wirte MySQL query in django
https://docs.djangoproject.com/en/4.0/topics/db/sql/ ?
Typucm
Hi Within our company we are using an intranet application based on django2, python2 with AD inegration. The developers left 4 years ago. I am fine to learn django latest version and enhance the application if I can have both django versions working together without negative impact on the user experience. Is it possible having django 2 and 4 + nginx behaving as a single webapp?
Д
as for the Django, I mean — if you already have a working app - what's the question?
Typucm
Thank you! The question is related to the no negative impact on the end users. For example, the user logins to the "old app" login form and the authentication/autorization works for the new app when its url is requested.
Д
the question is way too broad to answer, to be honest.
Typucm
It's one application right now