Эндейл
Hi,guys , how can i fix this error OSError: [Errno 38] Function not implemented [30/Jul/2022 07:35:28] "POST /student/studentsignup HTTP/1.1" 500 144120
Bruce
hey anyone know how to host django website with tailwind css
EAgold
hi how to control websocket connections from http views? let's say i want to close some connection via http request is it possible to make something like this: def close_connection(request): connection = WScontext.get_connection(connection_id) connection.close() (django channels)
Erkaboy
Hi guys. How can I override method in serializers which converts data to Json
SJ
I need help with hosting, I want to host my Django project. please dm if you have a solution. 6$ is what heroku charge. Let me know if you can get it done somewhere else with ssl.
Tin
??
SJ
So you mean heroku started charging hosting
I mean to use ssl you need to buy premium package which coat you around 6$ per month
Sultan
hello , i have this error in graphql upload file "No file was submitted. Check the encoding type on the form."
IM~Exynos
Which is most used schedule task library? Most advanced
Anonymous
You'll have to make some changes in proc file
İ solved but how i solved i dont know
IM~Exynos
Celery
Celery having some issues with my task 🥺🥺 anything advanced than that?
IM~Exynos
You can develop your own library...
😬😬 not much time to do that's why asking it.
Vaibhav
😬😬 not much time to do that's why asking it.
😶 tbh celery is pretty much simple, try a few YouTube tutorials... You should be good to go
Conditional elector of HRE
Hi. Why doesn't it work like that? {% for lang_code, lang_name in languages %} {% language lang_code %} <li><a href="{{ request.path }}">{{ lang_name }}</a></li> {% endlanguage %} {% endfor %} </ul> And, for example, it switching languages: {% for lang_code, lang_name in languages %} {% language lang_code %} <li><a href="{% url 'index' %}">{{ lang_name }}</a></li> {% endlanguage %} {% endfor %} </ul>
Conditional elector of HRE
Paths return the same
Ulug'bek | Python Developer
HI guys. STATUS = ( ('active','Active'), ('arxiv','Arxiv'), ) my api > 'color':'active' I want it be > 'color':'Active' How I change key to value ?
Mirco
HI guys. STATUS = ( ('active','Active'), ('arxiv','Arxiv'), ) my api > 'color':'active' I want it be > 'color':'Active' How I change key to value ?
If you have Django > 3 Use TextChoices to create an enum And then you can use the display name to get Active In any case, the get display of the field will give you the verbose name
Alexander
Hi. A weird question: is there any way to make a queryset that is filtered with a condition like... like takewhile/dropwhile? (Assuming it is somehow ordered, of course). For example, which contains of the elements of the query, until some condition starts to happen.
() { :;}; echo Nickolas
How about overriding get_queryset() and checking for your conditionals
Alexander
What is filterfalse/dropwhile. Two terms i never heard of
Things from itertools: https://docs.python.org/3/library/itertools.html#itertools.dropwhile
Alexander
How about overriding get_queryset() and checking for your conditionals
This would happen on the Python level, what is scary for large queries.
Alexander
I wonder if that can be specified somehow to stay on SQL layer of the queryset
() { :;}; echo Nickolas
Unless the orm you're using supports it idk if you can drag this to the SQL layer
Alexander
That was the whole hope that Django's ORM does support it 🙁
() { :;}; echo Nickolas
Perhaps you can do whatever you need to do in a celery task and keep the results stored somewhere and fetch when you need it? Unless you need it real time
() { :;}; echo Nickolas
That way you wouldn't block the django layer and keep it in a separate task
Alexander
My real case is that I am basically doing a weird pagination. (So this obviously must happen inside my django view/code). And the syntax of this pagination is something like records(afterUid, number). Or records(beforeUid, number)
() { :;}; echo Nickolas
My real case is that I am basically doing a weird pagination. (So this obviously must happen inside my django view/code). And the syntax of this pagination is something like records(afterUid, number). Or records(beforeUid, number)
Sounds to me - correct me if I'm wrong - that you're attempting to "reinvent the wheel" in a sense that Django offers pagination built-in. Do you have a specific reason to not use the built-in pagination?
Alexander
It is very trivial if you evaluate the queryset, and use those itertools goodies directly; but... but my inner DBA begs me to keep that in SQL
Alexander
Also I don't remember if the builtin pagination offers the “afterUid/number” pattern, rather than basic “limit/offset”.
() { :;}; echo Nickolas
So you're using graphene-django then? Sorry, my graphql knowledge is limited to tutorials
Alexander
There are some reasons why limit/offset is unacceptable in my case; limit number is not stable, so if the data is regularly updated, it will move.
Alexander
So you're using graphene-django then? Sorry, my graphql knowledge is limited to tutorials
Sure; but most good pagination is still to be done manually, even then 🙁 especially in my “afterUid” stable indexing case
Alexander
So you're using graphene-django then? Sorry, my graphql knowledge is limited to tutorials
Btw, after years of DRF, switching to Graphene was like... a grasp of fresh air. Everything became easier and shorter.
() { :;}; echo Nickolas
Afraid i can't contribute more than I already have. Everything i know is built on my experience with DRF that has baked in pagination which never let me down
() { :;}; echo Nickolas
Good luck tho, do provide an update if you've figured it out.
Alexander
Afraid i can't contribute more than I already have. Everything i know is built on my experience with DRF that has baked in pagination which never let me down
Yeah, basically I am trying to do something similar to CursorPagination of DRF, except with two cursors (in both directions), and do it manually, and stay on SQL level as much as I can 🙂 Doing this with dropwhile/filterfalse is rather easy, though; virtually two lines. Maybe I'll live with evaluating too much...
Alexander
Thanks for brainstorming!
() { :;}; echo Nickolas
M
Hey guys i just deployed my api with heroku, but what i find is that my api's is failing when handling nested fields, but it works fine when i run them locally
M
https://postimg.cc/gallery/wtFZKpS , like this when i visit the order/pk/items it should give me 2 fields so that i can input the data, but its only giving me order_pk on the heroku app
Mirco
Thank you. Whare i write displey name? Is it function?
You can find it on Django doc when you have choices , you can access to get_FOO_display() method to get the display name where foo is your field name It's a method of your model In Django setializer you can use the source attribute to inject it
ShuvamTheBeast
Whenever i raise a PermissionDenied error it is printed in terminal, any way to hide it from there?
Iñaki
you can change a data of a modelform?
Conditional elector of HRE
M̴A̴. ̴
is it good to use Django for backend and react for frontend ... Or using Django for backend and frontend?
Koen de
is it good to use Django for backend and react for frontend ... Or using Django for backend and frontend?
Use whatever feels right for you and what suits your project best. I have used a few; - just Django backend and frontend - Django + React - Django + Vue
Avina
Hey guys, Is it possible to use django 3 and older versions syntaxes in the latest version of django? 'Cause I'm going to make a project with django 3 but the version 4 in installed on my machine
Shandilya
Is it possible to make full project in django frontend backend all database with MySQL?
Shandilya
Yes, but same would be in Django itself
G4st0n
wtf
Koen de
Eslam
Guys I use http How if someone entered the site redirect to https
Koen de
Guys I use http How if someone entered the site redirect to https
You might check the docs from nginx or apache. This is not really Django related
Xeon
Is it possible to create a database in sqlite3 and later migrate to Postgresql
Koen de
Is it possible to create a database in sqlite3 and later migrate to Postgresql
yes, with pgloader ; https://pgloader.readthedocs.io/en/latest/ref/sqlite.html
Koen de
Is it possible to create a database in sqlite3 and later migrate to Postgresql
But.. why not start with Postgres in the first place?
Xeon
But.. why not start with Postgres in the first place?
Am a beginner and that was easy starting😅
Dani
Is it possible to create a database in sqlite3 and later migrate to Postgresql
Yes, just backup the data first python manage.py dumpdata > datadump.json Change the database settings in your project and load it python manage.py loaddata datadump.json
Xeon
Challenge yourself 😉
Alright I will thanks
Xeon
Wow thanks
Xeon
Could using sqlite3 be the reason why am trying to upload my app to heroku and it's saying app error?
Xeon
Yep, heroku doesn't support sqlite
Ok then will do as you are saying and try it out