Re: Validate and get the user using the jwt token inside a view

2017-09-15 Thread Robin Lery
to decode handler inside the code. > > -- > sincerely, > Oon Arfiandwi > > > On Fri, Sep 15, 2017 at 10:11 AM, Robin Lery wrote: > >> I am using django-rest-framework <http://www.django-rest-framework.org/> >> for the REST API and django-rest-framework-jwt >

Re: Validate and get the user using the jwt token inside a view

2017-09-16 Thread Robin Lery
I was about to that by this from rest_framework_jwt.serializers import VerifyJSONWebTokenSerializer data = {'token': token} valid_data = VerifyJSONWebTokenSerializer().validate(data) user = valid_data['user'] Hope this helps any body like me. On Sat, Sep 16, 2017 at 9:34 A

Re: How to authenticate a user in websocket connection in django channels when using token authentication

2017-09-16 Thread Robin Lery
{ "text": "Authentication error", "close": True }) On Fri, Sep 15, 2017 at 10:37 PM, Andrew Godwin wrote: > You'll have to write your own authentication code that runs in `connect` > and puts a user into the channel sessi

Channels architecture for chat application and subscriptions

2017-09-17 Thread Robin Lery
I would like to make a chat application using django and channels. I have two models to achieve a chat like application. 1. Thread - A thread can have list of users. So, it can be used for chat between two users, or groups of user. If it's a group thread, it can have a subject for the

Re: Channels architecture for chat application and subscriptions

2017-09-17 Thread Robin Lery
t case. > > Channels is a piece of a solution for a full-featured chat, but you're > going to have to write a lot of additional logic around it. I have on my > backlog a proper event-sourcing solution that would solve many of these, > but I am focused on channels 2.0 first and the c

Re: Channels architecture for chat application and subscriptions

2017-09-22 Thread Robin Lery
their send > implementation is also a for loop (though it's a little bit tighter) so not > sure how drastic the difference will be. > > Andrew > > On Sun, Sep 17, 2017 at 10:15 PM, Robin Lery wrote: > >> Thank you, Andrew. Also, after reading more about channels in SO >&

Re: Django 2.0 alpha 1 released

2017-09-22 Thread Robin Lery
+1 On Sat, Sep 23, 2017 at 12:16 AM, Tim Graham wrote: > We've made the first release on the way to Django's next major > release, Django 2.0! With just a little over two months until the > final release (scheduled for December 1), we'll need timely testing > from the community to ensure an on t

Re: Learning Django problems

2015-07-29 Thread Robin Lery
Do u have static directory? And does it have the required resources? On 29 Jul 2015 16:50, "Roshan Pannase" wrote: > sir i am a new learner can you send me the code of this application > > On Wed, Jul 29, 2015 at 11:33 AM, Stas soroka > wrote: > >> I'm currently reading a book "Learning Django

Re: same field in two classes

2015-08-02 Thread Robin Lery
You can use inheritance. Or content type. Or use signals to get the value of salary from one model and save it to another model. On 2 Aug 2015 23:38, "Alex Heyden" wrote: > Sorry, I think there might be a bit of a language barrier. What do you > mean by "take the value of employee salary to payro

Upload new file to the uploaded file path

2015-08-04 Thread Robin Lery
I have a model for Video: class Video(models.Model): title = models.CharField(max_length=75) pubdate = models.DateTimeField(default=timezone.now) original_video = models.FileField(upload_to=get_upload_file_name) mp4_720 = models.FileField(upload_to=get_upload_file_name,blank=True,

Re: Celery to process task and modify the model fields

2015-08-04 Thread Robin Lery
Hi, Thank you so very much kind sir. This really helped! On Wed, Jul 15, 2015 at 4:08 PM, 'Tom Evans' via Django users < django-users@googlegroups.com> wrote: > On Tue, Jul 14, 2015 at 9:15 PM, Robin Lery wrote: > > Yes. That time you were the one to guide me. I was lo

Re: Upload new file to the uploaded file path

2015-08-08 Thread Robin Lery
It works perfectly! I am using it to upload in s3, and even for s3 it works as it is supposed to. I am really grateful to you. Thank you. On Wed, Aug 5, 2015 at 4:37 PM, 'Tom Evans' via Django users < django-users@googlegroups.com> wrote: > On Tue, Aug 4, 2015 at 9:45 PM

Re: No module named 'blog'

2015-08-09 Thread Robin Lery
Did you add your 'blog' app in the installed apps in settings.py? On Sun, Aug 9, 2015 at 10:35 PM, Maggie Chang wrote: > hi all, > would like to seek for everyone's help. > I am following the django girls instruction => > http://tutorial.djangogirls.org/en/django_urls/index.html#your-first-djang

Re: Different auth user models withoout doing multi-table inheritance

2015-08-10 Thread Robin Lery
You surely can use Choice field for either Customer or Merchant in your custom user class. On 10 Aug 2015 20:12, "Avraham Serour" wrote: > I personally like a profile model, but if you implement two you may have > headaches when doing a reverse relation from user, you would need to check > every

Re: Django clustering - How to manage Image uploading

2015-09-09 Thread Robin Lery
You upload all your images into s3. On 9 Sep 2015 17:23, "Gabriele Morgante" wrote: > Hi, > > I developed a Django 1.8.4 webapp and now I've to deploy it in production > environment. The app allows users to upload images on the server. My > problem is that in a production environment I've many se

Re: django on Windows

2015-10-01 Thread Robin Lery
Did you install python? And is it in your environmental variable? If both the answers yes then you could try all the commands using cmd prompt in windows. On 1 Oct 2015 17:51, "Антон Заровский" wrote: > How use concole commands at windows? > > -- > You received this message because you are subscr

Re: Exchange models between apps

2015-10-17 Thread Robin Lery
Can u try this from userprofile.models import UserProfile On 17 Oct 2015 19:24, "svewa" wrote: > Hello everyone, > > I have a problem with using models between django apps. In my project I > have an app called *userprofile *containing a model *UserProfile*. In > another app where I have a model *

Re: Timer for online examination

2015-11-16 Thread Robin Lery
Hello, I think you will have to implement jquery/javascript to make the timer. After the countdown finishes js can post the form automatically. Cheers. On Tue, Nov 17, 2015 at 1:11 PM, Jani Tiainen wrote: > Hi, > > If you're looking something magical there isn't anything. Just declare > expira

Re: Timer for online examination

2015-11-17 Thread Robin Lery
t; example). So even someone manages to hack the js (which is really simple) > they can't overcome limitation from the server. > > Like the rule #1 in web development says - "Never trust user input". > > > On 17.11.2015 09:47, Robin Lery wrote: > > Hello, > I

Display the form errors in the django template with ajax post

2015-12-24 Thread Robin Lery
I have a contact form through which users would be able to contact me. I am using django with ajax, and it works fine *if* there's no error. I would like to show the errors if there's any like it displays above the input fields and not just the errors, but both the input and the errors. It does how

Re: Merry Xmass

2015-12-25 Thread Robin Lery
Merry Christmas! On Fri, Dec 25, 2015 at 3:09 AM, Andrea Mucci wrote: > Merry Xmass to all and all your family > Have a good djangoized new year > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and sto

Display form errors above its respective field with ajax

2015-12-27 Thread Robin Lery
I have a contact form through which users would be able to contact me. I am using django with ajax, and it works fine if there's no error. I would like to show the errors if there's any like it displays above the input fields and not just the errors, but both the input and the errors. It does howev

<    1   2