Rajjix
Nice, migrations make a lot of headaches in development stages
Mitko
hello, I am playing with django-rest-framework-json-api and I want to use included resources. Lets say I have blog post and comments. Comments need to be visible if include=comments is used. But relationship is blog_post with comments is always present. Is there option ot show relationships only if include is passed?
Mitko
I mean that include=comments in my setup only shows included array and data.relationships is always present. I want data.relationships to be rendered only if include=comments
Code9
pass a different query for the two scenarios
Mitko
May be I didn't explained the problem good enough. I don't have 2 scenarios. I just don't want to see related ids of comments when I fetch blog posts
Mitko
Without include param
Mitko
And only when include=comments is send, then api should return relationships and comment objects
Belmo NaTazu
Hi guys, for production use Gunicorn or uWSGI ???
cj
May be I didn't explained the problem good enough. I don't have 2 scenarios. I just don't want to see related ids of comments when I fetch blog posts
Including param would be one scenario, without including param would be the second scenario... Wouldn't?
Manish
psycopg2.ProgrammingError: relation "listing_business_type" does not exist LINE 1: ..._slug", "listing_business_type"."created_at" FROM "listing_b...
Manish
this occur when i am trying to migrate to new server with fresh postgres and django installed
Rajjix
assuming u have ur models correct, seems that u copied over old migration stacks as well, delete them
Manish
this error only with listing model
Rajjix
Share
Manish
Share
i think this can be because listing_business_type_slug but i actually mean listing >business_type >slug. but query thinks listing >businees >type >slug
Joseph
Joseph Oti Boateng: Please how can I access my website under development from a computer that is on the Same Wi-Fi network as my computer
Rajjix
python manage.py runserver 0.0.0.0:8000
Rajjix
runserver on ip 0 + ifconfig to get ip
cj
please, don't cross-spam in many groups an already answered question
Guilherme
Good night everyone.
Guilherme
I’m new with Django and started an app to learn and create my personal page.
Guilherme
Does anybody knows where can I find an easy tutorial to deploy my app “for dummies”?
Guilherme
Btw
Guilherme
Can I open my local machine instead of buying a server to host it?
cj
Does anybody knows where can I find an easy tutorial to deploy my app “for dummies”?
https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Deployment and this: https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-18-04
Guilherme
yes, but you will need to do some tricks
By tricks you mean, for example?
cj
By tricks you mean, for example?
some ports forwardings or tunnels, depends how you go to the wild internet from your home
Guilherme
look to python enywhere hosting
A friend of mine told me about it. But isn’t it payed?
Mirco
Heroku has free tier as well, AWS etc.
Guilherme
some ports forwardings or tunnels, depends how you go to the wild internet from your home
Got it. But, for a person that isn’t familiarity with infrastructure, do you think that can be too complicated?
cj
but, as Mirco said, you can use some services that offers free tiers
Guilherme
I’ll try them all. And see which one is the best for me. But do you have anyone that you prefer?
Mirco
Thank you Mirco
Yw 😀😀
Guilherme
So, the list is big enough. I had no idea to be honest.
Mirco
Heroku is good
Yep, it's just your personal page so the its free tier is enough for ya
Guilherme
Amazing. After, for sure, as I grow my Django knowledge, I’ll purchase a payed tier. But for now I just need to know all the way to make it a working/functional app.
Guilherme
Thank you very much. I appreciate all suggestions.
cj
Mirco
Ronald
Random question. What's the benefits of using something like Django Rest Framework or Graphql as opposed to just writing views that returns json?
Rajjix
Random question. What's the benefits of using something like Django Rest Framework or Graphql as opposed to just writing views that returns json?
From my point of view it saves you a lot of work from working with http headers, meta data and everything related to http header request/response
Rajjix
it’s like the function and class views both do the same thing but cbv do it much better with less code
George
Hi, i got a problem, when i have an open session in django admin i got problems with ajax
Rammanoj
Hey, I got a problem on using celery with django, Initially it worked fine. But I am really not sure what changes happend. It suddenly poped out an error "unhashable type 'list' " on calling delay function. Without delay function it is working fine.
Rammanoj
Is there any way to use djcelery with celery version 4.2 ??
Nedd
Hey guys I'm facing a problem with the django forms.py. I'm trying to make a user registration form(creating an account on a social website) but the user entry fields are not being shown on the page. Only things that are being shown are headers and the submit button
Rammanoj
can you post your code ?
Rammanoj
I mean the html tempalte where you are actually using this form 😅
Nedd
Oh lol wait
Rammanoj
are you returning the context with the name "form" from the view ??
Nedd
Oh my god. You were right. It was such a small mistake. The {{form.as_p}} is actually {{user_form.as_p}}
Nedd
Thank you so much
Anonymous
How to integrate chatterbot with psql???
Rammanoj
I guess you can refer this to integrate your django project with psql instead of sqlite3 https://www.digitalocean.com/community/tutorials/how-to-use-postgresql-with-your-django-application-on-ubuntu-14-04
R
Some time ago, I read a post where a django core dev was saying they were going to start trying to implement the possibility of allowing async http requests and db calls through asyncio, and his ideas of how this could be achieved, but haven’t seen anything else regarding that topic for a long time. Does someone have any information about this?
Firdaus
i assume Channels is the way to do async in Django for now?
Firdaus
seens a few youtubes on async... i still cannot wrap my brains around it.
R
not yet, if I don't go wrong before django 3.x or later we won't see that possibility core devs say it's a lot of work and it takes some long time but I have not checked about earlier updates
Found it (https://groups.google.com/forum/m/#!topic/django-developers/Kw7-xV6TrSM) and you’re right, until 3.x we won’t see it :(
R
i assume Channels is the way to do async in Django for now?
Yes, it’s the way for now but I think that having asyncio integrated by default, would be much better
Sergei
Hello guys! I need to test web app on different devices and browsers. Any advice where to start or what to read first. Thanx in advance
Sergei
Do you mean different resolutions??
resolutions and functions. To check if website works properly anywhere and to detect bugs as many as possible.
R
Selenium?
Sergei
Selenium?
Ok I'll check. Anything else?
Anonymous
any code to do datatraining???
Rajjix
resolutions and functions. To check if website works properly anywhere and to detect bugs as many as possible.
why would you want to test a django app on multiple browsers? functional tests basically have same behavior on all browsers, because they check for user actions , selenium is best for that. but if your looking for layout testing (css, js), I think it’s better to do it outside of django with ready tools such as browserling.com, then lastly you still have performance test which also has it’s own tools like chrome lighthouse extension, and many others.performance isn’t that important it just helps you render your templates faster on slower connections. That’s all frontend stuff that doesn’t have anything to do with django