Re: Chatbot using Django Channels. Persist a python object in a scope?

2018-06-10 Thread Rithwik Cherian
Hi Andrew, Great. That's good to know. :) I'll try it out right away. Yeah, I read somewhere that it is available from Channels 2. I am using the latest version anyways. :) Well, pardon my usage. I am not 100% sure about what exactly these terms (websocket, asgi etc) mean exactly (I'm very

Re: Chatbot using Django Channels. Persist a python object in a scope?

2018-06-10 Thread Rithwik Cherian
Hey Ryan. The problem is actually not specific to pytransitions. But anyways, I wanted to persist an object in memory and not have to retrieve it from the DB every time. Although I'm not sure which is better for scaling (please give suggestions if you know more). As for recovering state, I'm

Re: Trouble adding users through admin site

2018-06-10 Thread Dylan Moreland
Ah, perfect! I was inheriting from django.contrib.admin.ModelAdmin instead of django.contrib.auth.admin.UserAdmin. That worked. Thanks so much! Dylan Moreland Industrial Engineering Student California Polytechnic State University, San Luis Obispo > On Jun 9, 2018, at 17:30, Daniel Germano

Re: Interfaz administrativa, login con SSH

2018-06-10 Thread carlos
Hola, tambien te recomiendo que leas esto Hi, i also recommend you read this https://hackernoon.com/5-ways-to-make-django-admin-safer-eb7753698ac8 On Sun, Jun 10, 2018 at 8:02 PM Frank Mascarell < frank_mascar...@gandiweb.com> wrote: > Vijay, thanks for the help, but the authentication of two

Odd problem with Incorrect padding error in Oauth2 flow using Django >=2.0

2018-06-10 Thread Malcolm MacKinnon
Using python 3.55 and django 1.10 in my Oauth2 flow (with django_openid_auth in my installed apps), my code executes without any errors. But in a python 3.55 and django >=2.0 environment, I get the following error: Error at /openid/login/ Incorrect padding I've spent two days searching for

Re: Interfaz administrativa, login con SSH

2018-06-10 Thread Frank Mascarell
Vijay, thanks for the help, but the authentication of two factors seems quite uncomfortable, considering that an administrator can enter every day, several times a day, having to depend on a mobile device for each login. I have to rethink the problem, perhaps by directly accessing postgres,

Re: Interfaz administrativa, login con SSH

2018-06-10 Thread Vijay Khemlani
En general SSH sirve para hacer conexiones remotas por terminal (bueno, puedes hacer una sesión X a través de SSH pero no creo que sea lo que necesites) La forma más común de aumentar la seguridad del login es por two factor authorization, básicamente mandar una validación a tu celular o algun

Re: Passing Django Template Vars to JS

2018-06-10 Thread Vijay Khemlani
I'm not sure why your code does not work (maybe there is a "race condition" between the JS click handlers), but that global variable is a bad idea in general. You can add the comment ID as an attribute to your button, like and in your event handler obtain the comment id

Interfaz administrativa, login con SSH

2018-06-10 Thread Frank Mascarell
Hola, lo siento por los errores, estoy usando google-traductor :) Contraté un VPS en Digital Ocean, instalé Django-Postgres y todo funciona correctamente. Ahora quiero aumentar la seguridad de la interfaz administrativa de Django, Quiero que los administradores del sitio inicien sesión usando

Interfaz administrativa, login con SSH

2018-06-10 Thread Frank Mascarell
Hi, sorry for the mistakes, I'm using google-translator :) I hired a VPS on Digital Ocean, installed Django-Postgres and everything works correctly. Now I want to increase the security of Django's administrative interface, I want site administrators to login using SSH, eliminating

Re: Problem with get_absolute_url() in admin

2018-06-10 Thread Anthony Anonde
the example.com is am example django give for Site. Which means there is a way for you to manage more than one site at a time, basically using the site_id. To you Questions, i don't understand why you want to hard code your uri routing like that when you can easily use the app_name and name

Re: Problem with get_absolute_url() in admin

2018-06-10 Thread Joakim Hove
Thank you; that was indeed it! On Sunday, June 10, 2018 at 11:03:54 PM UTC+2, Melvyn Sopacua wrote: > > On zondag 10 juni 2018 22:54:10 CEST Joakim Hove wrote: > > > > It is the default hostname for django.contrib.sites > > > > > > < >

Re: Problem with get_absolute_url() in admin

2018-06-10 Thread Melvyn Sopacua
On zondag 10 juni 2018 22:54:10 CEST Joakim Hove wrote: > > > It is the default hostname for django.contrib.sites > > > > > ent.py#L28> with SITE_ID = 1. > > OK - so that might be a smoking gun that I have not

Re: Problem with get_absolute_url() in admin

2018-06-10 Thread Joakim Hove
> > > > > It is the default hostname for django.contrib.sites > > > with SITE_ID = 1. > > OK - so that might be a smoking gun that I have not configured the "sites" model correctly? I have so far not

Re: Problem with get_absolute_url() in admin

2018-06-10 Thread Melvyn Sopacua
On zondag 10 juni 2018 13:30:51 CEST Joakim Hove wrote: > things do not work from the Admin. When I click on the "View on Site" link > i am redirected to "http://example.com/transaction/view/23635/; and I get > an error message about failed XML parsing. I have no clue where the > "example.com"

Re: Chatbot using Django Channels. Persist a python object in a scope?

2018-06-10 Thread Andrew Godwin
Hi! You can indeed have things persist for the entire scope - the Consumer (or any other ASGI app) does exactly this, and so if you're in a consumer you can just store things on "self". That'll be tied to a specific socket and garbage-collected once it's done (on Channels 2 only - channels 1

Passing Django Template Vars to JS

2018-06-10 Thread Simon Connah
I know that the standard way to do this is to create a script tag with a global JS variable in your Django template before you import your other JS files but that won't work for my current situation. I have an article detail view which is a single model instance. But I also have a list of comment

Re: Problem with get_absolute_url() in admin

2018-06-10 Thread Joakim Hove
Thank you for answering; but I do not agree fully with your answer: 1. It is the @permalink decorator which is removed from Django 2.x - not the get_abolute_url() method. 2. I agree using the reverse in the get_absolute_url() is nicer, and I have also tried that - but the ersults were the same

Re: Problem with get_absolute_url() in admin

2018-06-10 Thread Gerald Brown
In version 2 of Django that function has been removed. For v 1.10 here is a link that might help: https://docs.djangoproject.com/en/1.10/ref/models/instances/#get-absolute-url Here is another link that might be of help:

Problem with get_absolute_url() in admin

2018-06-10 Thread Joakim Hove
Hello, I have a model `Transaction` which can be viewed at the url: /transaction/view/$ID/ - if I just enter that url in the browser, or in template everything works. But when I have the following get_abolute_url() method: def get_absolute_url(self): return