These are chat archives for django/django

9th
Apr 2018
Caleb White
@cwh1te
Apr 09 2018 04:39
Did that help? Generally when people ask for help they respond when other people try to help then.
Nikhil Nagaraju
@nikhilnagaraju
Apr 09 2018 09:57
can someone tell me a way to make django REST API without using any 'view'. (i.e make api endpoints which connects to local db and serves the request). All of the tutorials use views.py which are used to display UI stuff
Luke-VideoLibre
@LukeVideo
Apr 09 2018 13:22
False. templates are used to display UI stuff. XD You just have to serialize your models and don't bother with the views stuff that are related to UI stuff
@nikhilnagaraju use the django-rest-framework documentation. I guess it have the basics covered
Nikhil Nagaraju
@nikhilnagaraju
Apr 09 2018 13:29
@LukeVideo thanks a lot, but how can i do the db queries/filters through the api endpoints if im only serialize my models?
Luke-VideoLibre
@LukeVideo
Apr 09 2018 13:34
Well you handle the request with your views... They prepare you request object. They are used for UI stuff if send to a template but they also handle POST request. It's all in the doc. You can even get a browsable API with DRF so you don't have to do any templating in django.
Many React and Django tutorials out there use DRF. they don't handle any frontend UI stuff with django ;)
Miracle Ayodele
@iammiracle
Apr 09 2018 17:04
Hi Guys, i am having some issues sending email on django with sendgrid
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.sendgrid.net'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = 'username'
EMAIL_HOST_PASSWORD = 'password'
DEFAULT_FROM_EMAIL = ''
SERVER_EMAIL = ''
i have tried all means, yet nothing
anyone with any insight or alternative solution
Robert Green
@robdoesstuff
Apr 09 2018 19:47
@iammiracle read this, has info for debugging and a specific issue with sendgrid that someone mentioned - https://stackoverflow.com/questions/1414130/django-not-sending-emails-to-admins
Miracle Ayodele
@iammiracle
Apr 09 2018 20:51
@robdoesstuff the issue i noticed is that, on my account activity on sendgrid i can see all the mails sent and they are marked as delivered, but never dropped in my email
Stephen
@stephepush
Apr 09 2018 22:19
Hi everyone! I'm having an issue with the MDN Django tutorial, can anyone help? I posted an issue on the projects github here:
mdn/django-locallibrary-tutorial#13
Stephen
@stephepush
Apr 09 2018 22:57
figured it out