Ur Friend
How to use unicode in slug
Ur Friend
Any idea
Ur Friend
Getting this error "enter a valid “slug” consisting of unicode letters, numbers, underscores, or hyphens."
Husen
#help TypeError: cannot pickle '_io.BufferedReader' object
Maxim
#help TypeError: cannot pickle '_io.BufferedReader' object
you can't serialize some object types and you can't do anything about it
Eric
Hello everybody. I want to cache the data in listapiview in drf through redis without using docker but I can't do it please help
Just have redis installed in your host machine, and in your settings.py you'll set the connection string to the details that match that redis.
park seo joon
Hi I need help please I created a table and added some class to move the table to the middle, table should fit in the whole page, and even add bordered to it but all I got was just a table that wasn't organized and no border
park seo joon
doesn't look like anything Django-related
I'm using Django to build just a small web app
Maxim
I'm using Django to build just a small web app
but your issue has nothing to do with Django Django doesn't provide any tools for layout
park seo joon
but your issue has nothing to do with Django Django doesn't provide any tools for layout
I'm asking if there is any suggestions Django might also provide how to costume layout
Rose
Hi I need help please I created a table and added some class to move the table to the middle, table should fit in the whole page, and even add bordered to it but all I got was just a table that wasn't organized and no border
This is not a Django specific question, please delete your offtopic message. If it's a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.
Rose
User Danilo has 1/3 warnings; be careful! Reason: crossposting
अज्ञानी
what are the appropriate details like what
Like your email, username password
amira
Like your email, username password
i put them in models? or in the admin.py file ... it is already in a data base file
Rose
User Kevin has 1/3 warnings; be careful! Reason: cross-posting
Pralaya
i put them in models? or in the admin.py file ... it is already in a data base file
After running python manage.py createsuperuser, You have to enter username, email id and password in terminal then you can login admin
अज्ञानी
And now I see it has been answered already
Hooman
Hello everyone what is the best way to check a model video field height and width from django administration before save to database?
Rose
This is not a Django specific question, please delete your offtopic message. If it's a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.
Anton
How can I speed up this code? It currently takes 1.5 seconds with production data which is way to long, whole page takes ~4s on my m1 mac and i guess it’s gonna be even longer on my vds @timer def get_leftovers(): steps = Step.objects.all() leftovers = {} for step in steps: leftovers[step.pk] = {} for order_entry in OrderEntry.objects.all(): for step in steps: leftovers[step.pk][order_entry.pk] = -order_entry.quantity for report_entry in ReportEntry.objects.filter(report__order=order_entry.order, report__step=step, detail=order_entry.detail): leftovers[step.id][order_entry.pk] += report_entry.quantity return leftovers
Walter
i have one question guys i have created a user by using create_usr function the authentication is not working on it but when i create using superuser function it is authenticating is something their that it only authenticates superusr
Nerd
mostly I don't use django authenticate I first find the user by primary key and use user.check_password to validate the password
Snuppe
Hi, I try to learn Web development. Want to build a small canban board. But the login doesn't work. https://github.com/KayBeckmann/join-angular https://github.com/KayBeckmann/join-backend http://localhost:8000/auth/login/ If I test the login in browser worth manual input, I get a positive response. But with angular, I get error code '0'. Google and chatgpt didn't bring me to the right answer. I hope, it's just a little mistake, but I can't find it.
Snuppe
Maybe it's a little bit German in code 😇
The Inspired
StackOveflow says it usually happens when cors isn't configured, so maybe try doing that?
Snuppe
Thank you. I will try it
The Inspired
Hello everyone what is the best way to check a model video field height and width from django administration before save to database?
I'm fairly sure you cannot get a video's dimensions using Django. That is something you would have to do in JS.
Anton
This code snippet generates over 400 SQL Queries and it is extremely slow https://dpaste.org/TXb5o Have no idea how to fix it Lines 26 and 37 are pointed by debug tools
clouded
This code snippet generates over 400 SQL Queries and it is extremely slow https://dpaste.org/TXb5o Have no idea how to fix it Lines 26 and 37 are pointed by debug tools
To give you an idea, you need to reduce amount of calls to <Table>.objects.<something>, which is, theoretically, easy to do, since you use loops to call those methods several times.
Anton
To give you an idea, you need to reduce amount of calls to <Table>.objects.<something>, which is, theoretically, easy to do, since you use loops to call those methods several times.
yeah but what is a clean way to do it, to execute query and store it the best way in python can i reed some article about it? can’t really find anything
Samuel
Hi Django's previous settings prevent connecting to localhost I added these codes to settings.py for extra security SECURE_BROWSER_XSS_FILTER = True SECURE_CONTENT_TYPE_NOSNIFF = True SECURE_SSL_REDIRECT = True SECURE_HSTS_SECONDS = 86400 SECURE_HSTS_PRELOAD = True SECURE_HSTS_INCLUDE_SUBDOMAINS = True SESSION_COOKIE_SECURE = True CSRF_COOKIE_SECURE = True Then on 127.0.0.1:8000 I could no longer connect to the Django server, even when I deleted that line of code I couldn't connect to the Django development server even in another project. Browsers return this This site can't provide a secure connection. 127.0.0.1 sent an invalid response. ERR_SSL_PROTOCOL_ERROR Django Console: [31/Mar/2024 22:15:09] code 400, message Bad request version ('8³£\x14õì=\x18\x01\x8f*Ú\x86á\x00') Django version: 4.1.7 I tried clearing the cache / using other browsers and reversing the same code snippet but to no avail .Someone even recommended resetting the database, but it didn't help Anyone can help?
Rose
User Akbarov has 1/3 warnings; be careful! Reason: offtopic contextless link
Mohammad
What's the Difference when u this and and django authentication?
Using check_password method is more custom Also Django authentication is using this method So I guess there isn't any difference between them until you make an customize user model in you project
Ali
AuthFailed at /oauth/complete/linkedin-oauth2/ Authentication failed: Scope "r_emailaddress" is not authorized for your application I get this error when I log in via LinkedIn. Does anyone know the solution?
Rose
User .​ has 1/3 warnings; be careful! Reason: rule #10 violation
Abdulfattah
Sweet website using django and postgresql and I want one post for hosting that supports all versions
Brook
yeah but what is a clean way to do it, to execute query and store it the best way in python can i reed some article about it? can’t really find anything
If you still haven't found a solution. I think The orm makes new queries whenever a loop runs. Instead of a loop you could use row_report_entries.filter(machine__in=machines) kind of logic where only one transaction will be made with the db.
Anton
If you still haven't found a solution. I think The orm makes new queries whenever a loop runs. Instead of a loop you could use row_report_entries.filter(machine__in=machines) kind of logic where only one transaction will be made with the db.
yeah but i need to get resulting table where rows are time ranges and columns are machines and the data in table cell in row machine_x and time_range_y is all the report entries which fill condition: report_entry.machine == machine_x and timestamp in time_range_y
Anton
so i kinda have to iterate filter them all by machines and by time but i thought of doing it this way report_entries = ReportEntry.objects.filter( report__date__range=(timestamps[0], timestamps[-1]), report__step=step).select_related("detail") and then smth like for report_entry in report_entries: table[timestamp_to_shift(report_entry.timestamp)][report_entry.machine] = # further table cell generations
Arneeth
What is the difference between Redis and REST API when using in django application?
Rupesh
What are the Django project based on real world help to get jobs?
Victor
What is the difference between Redis and REST API when using in django application?
These are different items, redis is used in memory data store.. REST API is a software architecture style. https://redis.io/docs/about/ https://www.redhat.com/en/topics/api/what-is-a-rest-api
Victor
What are the Django project based on real world help to get jobs?
First of all, try to make simple projects if you have no experience in Django, simple TODO lists. With these projects you can carry out real projects.
Jean
Apart from TODO lists, what are some other great projects for django beginners.
Rose
User Kiro has 1/3 warnings; be careful! Reason: rule #1: speak English
Kiro
Can anyone tell me the folder structure of Django rest framework?
Charly
Apart from TODO lists, what are some other great projects for django beginners.
https://www.google.com/search?q=django+projects+for+beginners
Charly
Can anyone tell me the folder structure of Django rest framework?
The same as without rest framework just with a serializers module for your app
Shubhtiwarii
Anyone have project which implementation of login, register page by the help of html,css,js and the backend uses by django rest framework.
Shubhtiwarii
Guide me about how to attach the rest api with html css js login page.
Rose
User ꯭꯭⚜꯭꯭[꯭꯭🇲🇾꯭꯭]𝚸꯭𝛂꯭𝚻꯭𝚁𝛊ꯥ꯭𝛓𝚱ꯥ꯭🌚꯭꯭🌿꯭꯭꯭𝙅꯭𝛂꯭𝚴꯭𝙚[꯭꯭🇺🇿꯭]⚜꯭꯭ has 1/3 warnings; be careful! Reason: nonsense
Abdullah
Hello everyone, I wanna learn Django, is there anyone who can guide me. I'll be very thankful
Rose
Hello everyone, I wanna learn Django, is there anyone who can guide me. I'll be very thankful
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial (https://docs.djangoproject.com/en/dev/intro/tutorial01/) * Tutorial from MDN (https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django) * Tutorial from django-girls (https://tutorial.djangogirls.org/en/)
.
Is timezone.now() really not following the settings’ TIME_ZONE by default? For example, I tried to use TIME_ZONE = “Asia/Singapore”. Then when I check >> from django.utils import timezone >> timezone.now() datetime.datetime(2024, 4, 1, 23, etc.., tzinfo=datetime.timezone.utc) Notice its timezone is UTC. But then >> timezone.get_current_timezone() zoneinfo.ZoneInfo(key=‘Asia/Singapore’) In this case is Singapore. I’m afraid I might be setting something wrong.
amira
for a parental control app using django is there any helpful sites or open source codes for that ?
amira
just GitHub
.
Look in your settings the date time and others
I already have in settings TIME_ZONE = “Asia/Singapore” USE_I18N = True USE_TZ = True
Prashant
my project is perfectly working on localhost but when i am runnning it in production it is loading slow. can someone help me out
Prashant
what details you need
Ivan
good morning everyone how do i change the name on the header of my database from django administration to another name
Maxim
good morning everyone how do i change the name on the header of my database from django administration to another name
it's unclear what you're talking about, because databases don't have headers
Ivan
likeon top of the database it is showing django administration instead now i want to change that to my own name