These are chat archives for django/django

May 2017
May 19 2017 03:42
anyone try django channel for reading sensor on raspi?
Kyle Mulka
May 19 2017 04:46
Do you mean channels? Like the websockets thing for Django?
I haven't used it for reading a sensor. Is there python documentation for the sensor though?
May 19 2017 06:56
Can you freelance in Django?
ismail sarenkapic
May 19 2017 07:34

I'm trying to allow users to login with facebook via django allauth to my website but I am getting the following error:
URL Blocked: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings. Make sure Client and Web OAuth Login are on and add all your app domains as Valid OAuth Redirect URIs.

I configured my Facebook app like this:

  1. Made it Public

site URL: http://localhost:8000/ (since I'm running locally)

  1. Client OAuth Login -ON
    Web OAuth Login -ON

4.Valid OAuth redirect URIs: what do I put here, and is it even necessary to put something?

May 19 2017 08:20
@ismailnp96_twitter Most of the Api services prefer real website url, instead of localhost. Try to redirect one website to your Local host. You can direct it from your Host file. By that way you can give FB or other Api service your directed url.
ismail sarenkapic
May 19 2017 08:50
I think that fb accepts local host url, I don't know what is the problem, really stuck with this for 2 days now,
tnx for answer
May 19 2017 08:56
@ismailnp96_twitter check this tschellenbach/Django-facebook#376
perhaps, you can use the URL, where you want to direct user, after log in
ismail sarenkapic
May 19 2017 09:15
@Voxmundi I just want to redirect user to home page- http://localhost:8000/
I already checked that link didn't help , I just posted a question there
Anish Shrestha
May 19 2017 09:44
@ismailnp96_twitter have you checked
NIP.IO maps <anything>.<IP Address> to the corresponding <IP Address>, even maps to
ismail sarenkapic
May 19 2017 09:52
@annshress yes but didn't jelp
Kaushal Kumar
May 19 2017 10:19

Hi, I want to create directory programatically in django. It works fine on my local server ( runserver ) but on nginx it doesn't work

d = '/home/kaushal/saintparrot/media_cdn/' + out_dir
    print d
    if not os.path.exists(d):

What could be the reason. How to debug and resolve it.

out_dir is passed from another function
May 19 2017 11:46
May 19 2017 14:31
Im a mac
May 19 2017 14:37
@kaushal087 look at the permissions
Anish Shrestha
May 19 2017 16:13
@EvolvedAltair Hello Mac
I am a PC
May 19 2017 16:23
hey guys. I am working on creating some models that will have fields to filter by. Think Restaurants where I want to filter by pricing (a rank of price 1-5). Should price be a separate model too and I add it as a foreign key or just an integer field on the model?
what is most efficient?
Cristian Samaniego
May 19 2017 16:30
@brendanbernstein you can just use an integer field and filter it with something like Dataset.objects.filter(price__lte=x, price__gte=y)
May 19 2017 17:33
is that the best way to do it, when I'm using django rest framework
or should i use another model
i know both could work im just wondering whats best
May 19 2017 17:46
Gizmo - Django App with Authy 2 factor authentication. Info - . Heroku Demo -
Cristian Samaniego
May 19 2017 18:14
@brendanbernstein i think database-wise its better to just use the integer field, so the query is simpler