Sagar
127.0.0.1:8000/admin/logout/ still giving error
san
*view
Sagar
path("admin/", admin.site.urls), im using this to login and logout. but im unable to logout
san
Don't you have view function for admin log out
Sagar
No, I'm using default django admin login logout
san
from django.contrib.auth import authenticate,login,logout import this and try you may get
Sagar
And create a url for the above for logout?
san
no actually you need to create a view for logout example : def admin_logout(request): logout(request) # Redirect to a specific page after logout (optional) return redirect('/admin_login') url for this logout : path('admin_logout',views.admin_logout,name='admin_logout'),
Sagar
Okay
Sourav
can make network diagram on google maps using django rest framework
Sourav
Any One Help me?
Ekoko
Hello guys, has anyone installed Inventree with Django? I'm having some difficulties here to install and run Inventree
Dinesh
Hello world! Tell me, please, has anyone worked with CKEditor 5? It's just that I ran into a problem: if the form is loaded onto the page using htmx, the editor doesn't work. And if you just launch the page, then everything works
You need to include the ckeditor's js src in your htmx response. Css can be included the normal page load, js need to be in response of htmx. https://htmx.org/docs/#3rd-party Have a look at this.
Mr. Achiever
Hello Team, I'm writing an app in which there will be multiple universities which will have different colleges under them. I've used Foreign key option in models. However, In the form, when I'm trying to select the universities and the college associated, it shows me the list of entire colleges from all the universities. Can anyone guide me what can be the best option to achieve such a scenario in which only the specific colleges for the selected University is listed, and if I change the University, then only the colleges for that specific University should be shown?
Asyrof
Hello guys i have question, i 'm learning to create a website using django. Why doesnt my django website server accept the changes in my css and html? Even though i have connected the css with a static file
Asyrof
Yes friend
Charly
Yes friend
I asked what do you mean
Asyrof
I mean, after i make changes to the html and Css files in VScode then i run the django server in a web browser there is no change at all
Charly
I mean, after i make changes to the html and Css files in VScode then i run the django server in a web browser there is no change at all
Try cleaning cache on your browser (or disable it in the network tab on the developer tools)
Asyrof
Thanks friend for helping me
Asyrof
Work it
Valentino
How to sanitizate code for htmx?
Maxim
@Donghanbari rule #1: speak English read only 1 hour
Adish CT
google is provided their new modulle you can use that in react
_
Did you import the app?
_
You have to add that in installed apps list
ford
Hello Guys, so today i come a cross funny thing in django, I have a model with three fields "name:str, comm:manytomany, active:bool" when creating the object I used get_or_create method, but even when object exist with same name it return none and tries to create a new object with same name which fails since name is unique field, has anyone ever experience same?
_
You also need to add client ID and secret key
_
Yeah then it should work
_
SOCIALACCOUNT_PROVIDERS = { "google": { "APP": { "client_id": os.getenv("GOOGLE_CLIENT_ID"), "secret": os.getenv("GOOGLE_SECRET_KEY"), "key": "" }, # These are provider-specific settings that can only be # listed here: "SCOPE": [ "profile", "email", ], "AUTH_PARAMS": { "access_type": "online", } } } Do something like this
Bhushan
In django celery incounter with the error object of type response is not json serializable
Bhushan
https://dpaste.org/JEe5V
Husen
hi guys! CommandError: “pbkdf2_sha256$720000$PmQuZpkEJCev4nJfuv4f7r$iB6wCcqqwwu63Bk2ZILRpI/zWlDTyaO+npW3K3m2dIs=” value must be either True or False.
Mirco
what is wrong here?
you are sending a string ( pwd hash ) instead of a boolean
Husen
you are sending a string ( pwd hash ) instead of a boolean
from django.db import models from django.contrib.auth.models import BaseUserManager class UserManager(BaseUserManager): def create_user(self, full_name, email=None, password=None, is_staff=False, is_admin=False, is_active=True): if not password: raise ValueError("User must have a password") if not full_name: raise ValueError("User must have a full name") user = self.model() user.email = email user.full_name = full_name user.set_password(password) user.admin = is_admin user.staff = is_staff user.active = is_active user.save(using=self._db) return user def create_superuser(self, full_name, password): user = self.create_user( full_name=full_name, password=password, is_admin=True, is_staff=True ) return user
Hominini_Inside
Hi! It's possible to build a development setup with multiple django workers for a project? With serving media and static files as with usual startserver tool? We have some solutions for these purposes?
Rohan Ekke
guys, i am getting error when submited django form: <ul class="errorlist"><li>fetured_image<ul class="errorlist"><li>This field is required.</li></ul></li></ul>
Rohan Ekke
ok
not able to figureout what to do
Rohan Ekke
ok
thank for your help
Maxim
thank for your help
all that can be gleaned from your posts: 1. you are using Django 2. some field you missed must be filled in that's not enough to help
Rohan Ekke
django.db.utils.IntegrityError: UNIQUE constraint failed
Rohan Ekke
Maxim
This error is related to slug field
Read this please: http://catb.org/~esr/faqs/smart-questions.html#intro
∴
hi everyone. what is the most used swagger lib for django?
∴
there are many
Mirco
hi everyone. what is the most used swagger lib for django?
drf-spectacular since drf-yasg doesn't support openapi 3
Rama Krishna
Where can I learn django? I'm very interested in learning django So I started with DSA with python and completed it I solved 210+ questions on leet code. But I'm unable to find clear sources for learning django
Rama Krishna
I wish to make a portfolio website with django running on backend
Moein 🌱
Your quote on quote interest is not enough you have to work hard
ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ
Valentino
Be more specific
I was checking on internet and people says that htmx is insecure. And they was saying that we have to sanitizate code
Valentino
I don't now what it means
ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ
I was checking on internet and people says that htmx is insecure. And they was saying that we have to sanitizate code
htmx is as secure as your code is, it's literally just a library to do ajax calls more efficient instead of re-rendering the entire html page
Valentino
So, if I have a Django form I need something else?
Valentino
Some func?
Никита
You need to include the ckeditor's js src in your htmx response. Css can be included the normal page load, js need to be in response of htmx. https://htmx.org/docs/#3rd-party Have a look at this.
Hello, please tell me how to add your own plugin to django-ckeditor-5? I've been looking for an answer for hours now and I haven't found it
Bacanero
Ayúdemen necesito hacer reportes complejos en Django donde puedo encontrar información
Maxim
@techadarsh55 offtopic and crossposting read only 24 hours both groups P.S. don't ever ask pure Python questions here
عبید اللہ
May blog application working properly But when pass urdu slug, Return 404 error How to fix
ali
How can I add slug into url of simple router and nested router in rest framework?
clouded
Can you help me with an example?
https://simpleisbetterthancomplex.com/tutorial/2018/01/29/how-to-implement-dependent-or-chained-dropdown-list-with-django.html