These are chat archives for django/django

19th
May 2017
ahmadyamin
@ahmadyamin
May 19 2017 03:42
anyone try django channel for reading sensor on raspi?
Kyle Mulka
@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?
EvolvedAltair
@EvolvedAltair
May 19 2017 06:56
Can you freelance in Django?
ismail sarenkapic
@ismailnp96_twitter
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

2.Website
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?

Voxmundi
@Voxmundi
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
@ismailnp96_twitter
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
@Voxmundi
Voxmundi
@Voxmundi
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
@ismailnp96_twitter
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
@annshress
May 19 2017 09:44
@ismailnp96_twitter have you checked http://nip.io/
?
NIP.IO maps <anything>.<IP Address>.nip.io to the corresponding <IP Address>, even 127.0.0.1.nip.io maps to 127.0.0.1
ismail sarenkapic
@ismailnp96_twitter
May 19 2017 09:52
@annshress yes but didn't jelp
help
tnx
Kaushal Kumar
@kaushal087
May 19 2017 10:19

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

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

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

out_dir is passed from another function
1rjun
@1rjun
May 19 2017 11:46
hy
EvolvedAltair
@EvolvedAltair
May 19 2017 14:31
Hi
Im a mac
MBijman
@MBijman
May 19 2017 14:37
@kaushal087 look at the permissions
Anish Shrestha
@annshress
May 19 2017 16:13
@EvolvedAltair Hello Mac
I am a PC
brendanbernstein
@brendanbernstein
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
@chrisRubiano
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)
brendanbernstein
@brendanbernstein
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
azaleas
@azaleas
May 19 2017 17:46
Gizmo - Django App with Authy 2 factor authentication. Info - http://bit.ly/2rzZawj . Heroku Demo - http://bit.ly/2qFC5bZ
Cristian Samaniego
@chrisRubiano
May 19 2017 18:14
@brendanbernstein i think database-wise its better to just use the integer field, so the query is simpler