Help regarding view modification

2018-08-22 Thread Sagar
Hi guys,
I am working on project in which admin will post news and users will able 
to give up-votes, down-votes and comments. I'm storing data in MongoDB. I'm 
trying to store comments inside it's parent news documents. I'm facing some 
trouble with views. Look at the my code and below that I explain the 
problem.
models.py
from djongo import models

# Schema for comments collection which include in belonging news
class Comments(models.Model):
username = models.CharField(max_length=25)
comment = models.TextField()
time_stamp = models.DateTimeField(auto_now_add=True)

class Meta:
abstract = True


# Schema for news collection
class News(models.Model):
username = models.CharField(max_length=25, blank=False)
title = models.CharField(max_length=255, blank=False)
news = models.TextField()
upvotes = models.IntegerField(blank=True)
downvotes = models.IntegerField(blank=True)
time_stamp = models.DateTimeField(auto_now_add=True)
comments = models.EmbeddedModelField(model_container=Comments)

views.py
from rest_framework import generics
from news.api.serializers import NewsSerializer
from news.models import News


class NewsAPIView(generics.CreateAPIView):
lookup_field = 'id'
serializer_class = NewsSerializer

def get_queryset(self):
return News.__objects.all()


serializers.py
from rest_framework import serializers
from news.models import News, Comments


class NewsSerializer(serializers.ModelSerializer):
class Meta:
model = News
fields = '__all__'

What I'm trying to do is that when admin push the news, view should only 
add username, title and news in database and it should store 0 as default 
value up-votes and down-votes. Because comments is given by user, view 
should not expect that when admin push the news. So, how to modify the view 
so it when news pushed in database it should add username, title, news and 
time. it should add 0 as default value for up-votes and down-votes and it 
should not add anything for comments because that document will create when 
user give some comments.
With this code I'm facing error. So this code is not working.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8248ce78-78ef-45e6-a091-d6495167630f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help regarding view modification

2018-08-22 Thread Olivier Pons
Hi,

You should try this:

upvotes = models.IntegerField(blank=True, default=0)
downvotes = models.IntegerField(blank=True, default=0)

(dont forget the makemigrations, then migrate)
tell me if it worked

Le mer. 22 août 2018 à 09:25, Sagar  a écrit :

> Hi guys,
> I am working on project in which admin will post news and users will able
> to give up-votes, down-votes and comments. I'm storing data in MongoDB. I'm
> trying to store comments inside it's parent news documents. I'm facing some
> trouble with views. Look at the my code and below that I explain the
> problem.
> models.py
> from djongo import models
>
> # Schema for comments collection which include in belonging news
> class Comments(models.Model):
> username = models.CharField(max_length=25)
> comment = models.TextField()
> time_stamp = models.DateTimeField(auto_now_add=True)
>
> class Meta:
> abstract = True
>
>
> # Schema for news collection
> class News(models.Model):
> username = models.CharField(max_length=25, blank=False)
> title = models.CharField(max_length=255, blank=False)
> news = models.TextField()
> upvotes = models.IntegerField(blank=True)
> downvotes = models.IntegerField(blank=True)
> time_stamp = models.DateTimeField(auto_now_add=True)
> comments = models.EmbeddedModelField(model_container=Comments)
>
> views.py
> from rest_framework import generics
> from news.api.serializers import NewsSerializer
> from news.models import News
>
>
> class NewsAPIView(generics.CreateAPIView):
> lookup_field = 'id'
> serializer_class = NewsSerializer
>
> def get_queryset(self):
> return News.__objects.all()
>
>
> serializers.py
> from rest_framework import serializers
> from news.models import News, Comments
>
>
> class NewsSerializer(serializers.ModelSerializer):
> class Meta:
> model = News
> fields = '__all__'
>
> What I'm trying to do is that when admin push the news, view should only
> add username, title and news in database and it should store 0 as default
> value up-votes and down-votes. Because comments is given by user, view
> should not expect that when admin push the news. So, how to modify the view
> so it when news pushed in database it should add username, title, news and
> time. it should add 0 as default value for up-votes and down-votes and it
> should not add anything for comments because that document will create when
> user give some comments.
> With this code I'm facing error. So this code is not working.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8248ce78-78ef-45e6-a091-d6495167630f%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALJtQjTnThcv2cK3hSE7M7E25uK_9OuDwTAY82AFhOCLhq_t%2BQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help regarding view modification

2018-08-22 Thread Olivier Pons
Try this:

upvotes = models.IntegerField(blank=True, default=0)
downvotes = models.IntegerField(blank=True, default=0)

(dont forget the makemigrations, then migrate)
tell me if it worked

Le mercredi 22 août 2018 09:25:20 UTC+2, Sagar a écrit :
>
> Hi guys,
> I am working on project in which admin will post news and users will able 
> to give up-votes, down-votes and comments. I'm storing data in MongoDB. I'm 
> trying to store comments inside it's parent news documents. I'm facing some 
> trouble with views. Look at the my code and below that I explain the 
> problem.
> models.py
> from djongo import models
>
> # Schema for comments collection which include in belonging news
> class Comments(models.Model):
> username = models.CharField(max_length=25)
> comment = models.TextField()
> time_stamp = models.DateTimeField(auto_now_add=True)
>
> class Meta:
> abstract = True
>
>
> # Schema for news collection
> class News(models.Model):
> username = models.CharField(max_length=25, blank=False)
> title = models.CharField(max_length=255, blank=False)
> news = models.TextField()
> upvotes = models.IntegerField(blank=True)
> downvotes = models.IntegerField(blank=True)
> time_stamp = models.DateTimeField(auto_now_add=True)
> comments = models.EmbeddedModelField(model_container=Comments)
>
> views.py
> from rest_framework import generics
> from news.api.serializers import NewsSerializer
> from news.models import News
>
>
> class NewsAPIView(generics.CreateAPIView):
> lookup_field = 'id'
> serializer_class = NewsSerializer
>
> def get_queryset(self):
> return News.__objects.all()
>
>
> serializers.py
> from rest_framework import serializers
> from news.models import News, Comments
>
>
> class NewsSerializer(serializers.ModelSerializer):
> class Meta:
> model = News
> fields = '__all__'
>
> What I'm trying to do is that when admin push the news, view should only 
> add username, title and news in database and it should store 0 as default 
> value up-votes and down-votes. Because comments is given by user, view 
> should not expect that when admin push the news. So, how to modify the view 
> so it when news pushed in database it should add username, title, news and 
> time. it should add 0 as default value for up-votes and down-votes and it 
> should not add anything for comments because that document will create when 
> user give some comments.
> With this code I'm facing error. So this code is not working.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/815c61ba-9be1-40ed-bf6f-00012de5ea73%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Make an element on a page visible only to logged in users

2018-08-22 Thread Olivier Pons
Hi,

I disagree with Mike Dewhirst answer, here's mine.

The simplest way is in the template, to see if it's logged in:

{% if user.is_authenticated %}


Then maybe a much more powerful way is to write your right management this 
way: first you write what you need beginning with "has_right_" like

{% if user.person.has_right_modify_account %}{% endif %}

{% if user.person.has_right_view_customers %}{% endif %}


and so on.

Then you create your "role" model (which implies the rights to do 
something), and the "person" model that has a user foreign key:


class Role(BaseModel):
R_TYPE_SUPER_ADMIN = 1
R_TYPE_ADMIN = 2
R_TYPE_EMPLOYEE = 3

TAB_R_TYPE = {
R_TYPE_SUPER_ADMIN: _("Super-admin"),
R_TYPE_ADMIN: _("Co-branding admin"),
R_TYPE_EMPLOYEE: _("Co-branding employee"),
}
authorization_level = models.IntegerField(
choices=[(a, b) for a, b in list(TAB_R_TYPE.items())],
default=R_TYPE_CO_BRANDING_EMPLOYEE)

def authorization_level_description(self):
return Role.TAB_R_TYPE[self.authorization_level]

description = models.CharField(max_length=200, default=None,
   blank=True, null=True)

def __str__(self):
return str(self.description) if self.description is not None else 
'?'



class Person(models.Model):
user = models.ForeignKey(User)
roles = models.ManyToManyField(Role)



And then, in that "Person" class, you implement the functions you called in 
the template: has_right_modify_account and has_right_view_customers:

class Person(models.Model):
user = models.ForeignKey(User)
roles = models.ManyToManyField(Role)
def has_right_modify_account(self):
# only admin and super admin
return len(self.roles.all() & [Role.R_TYPE_SUPER_ADMIN, Role.
R_TYPE_ADMIN]) > 0

def has_right_view_customers(self):
# everybody = at least one role:
return len(self.roles.all()) > 0



I'm pretty sure that code wont work out of the box, but you can fix it 
easily.

Le mercredi 22 août 2018 02:50:42 UTC+2, chanman a écrit :
>
> I want to have a page look different for users who are logged in and those 
> who aren't. For users that are signed in the page will have a sidebar with 
> account management options. For users who aren't signed in, this sidebar 
> shouldn't show up. The most obvious way to do this would be to have a 
> common layout inherited by the member viewable and outsider viewable pages. 
> But is there a way to do this by having some kind of optional component on 
> the page?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e4de489f-810d-41f5-ba26-6cc7a104bf82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: template tag help please?

2018-08-22 Thread MikeKJ


I am so rusty I’m having trouble writing a simple_tag

 

In the template

 

{% for b in list %}

{% load get_cost %}{% do_cost {{ b.name }} avn avd %}

 

Also tried (per docs) {% do_cost name={{ b.name }} avn=avn avd=avd %}

I definitely have values in the template passed from the view for avn and 
avd and of course b.name 

 

Tag

from django import template

from django.conf import settings

from django.utils.html import escape

from band.models import Data

 

register = template.Library()

 

@register.simple_tag

def do_cost( name, avn, avd, *args, **kwargs ):

avn = kwargs['avn']

avd = kwargs['avd']

name = kwargs['name']

 

val = Data.objects.filter(property=name).filter(date_period=date)

return val

 

I just keep getting do_cost takes 3 arguments

*** I know I want it to take 3 arguments***

Is it telling me that I can’t use {{ b.name }} as an arg?


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/de8c0f7e-c8ee-4329-a954-457acfd01c64%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: template tag help please?

2018-08-22 Thread Andréas Kühne
Hi,

You don't need the {{}} when sending a variable to the template tag - try
removing them.

Regards,

Andréas


Den ons 22 aug. 2018 kl 12:17 skrev MikeKJ :

>
> I am so rusty I’m having trouble writing a simple_tag
>
>
>
> In the template
>
>
>
> {% for b in list %}
>
> {% load get_cost %}{% do_cost {{ b.name }} avn avd %}
>
>
>
> Also tried (per docs) {% do_cost name={{ b.name }} avn=avn avd=avd %}
>
> I definitely have values in the template passed from the view for avn and
> avd and of course b.name
>
>
>
> Tag
>
> from django import template
>
> from django.conf import settings
>
> from django.utils.html import escape
>
> from band.models import Data
>
>
>
> register = template.Library()
>
>
>
> @register.simple_tag
>
> def do_cost( name, avn, avd, *args, **kwargs ):
>
> avn = kwargs['avn']
>
> avd = kwargs['avd']
>
> name = kwargs['name']
>
>
>
> val = Data.objects.filter(property=name).filter(date_period=date)
>
> return val
>
>
>
> I just keep getting do_cost takes 3 arguments
>
> *** I know I want it to take 3 arguments***
>
> Is it telling me that I can’t use {{ b.name }} as an arg?
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/de8c0f7e-c8ee-4329-a954-457acfd01c64%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK4qSCdcjnzhxoeLhpMsaSLbR0e7tHMtWp%2Bkczd9hyMr8e81_A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


python -m django --version

2018-08-22 Thread Basavaraj Halgali
Hi 

What is usage of -m command in this command line "python -m django 
--version".

Regards,
Basav

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/561a4362-1a31-404b-bf1f-076eaaab79cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Debugging allauth social authentiacation

2018-08-22 Thread ram manoj
Hey,

I am trying to include social authentication with google to my site with 
allauth. There are certain requirements to the site. I  am trying to modify 
the adapters, but modifying a simple adapter is giving the server error. It 
is not giving what the error is, but just popping a server error.

this is the sample code I wrote --

from allauth.Socialaccount.adapter import DefaultSocialAccountAdapter

class Loginuser(DefaultAccountAdapter):

def is_open_for_signup(self, request):
print("hello")
return False


As per the documentation method, is_open_for_signup is present in both 
DefaultSocialAccountAdapter and DefaultAccountAdapter classes and any of 
them can be overridden. But it works fine with class DefaultAccountAdapter 
and not with other. It only pops a server error and does say what the error 
is !!
My intention is to find the errors in Django allauth code. Everything is 
going fine (i.e the OAuth process) but it gives a server error at the 
callback URL !!!

Need help

thanks 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/249a1f6f-a7ab-463a-8b25-d2003c2d2d87%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django Database Table Front End Editing

2018-08-22 Thread Sandeep Khatri
Hi,

I am using a django framework and wants to fetch data from mysql database 
table. I also wants user to edit and update table column data at ui/ 
frontend.

Please help me out with this issue.

Thanks and Regards,
Sandeep Khatri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f819db94-191d-4d9a-9102-1d0e1fa2632a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Database Table Front End Editing

2018-08-22 Thread Mikhailo Keda
Check the documentation:
https://docs.djangoproject.com/en/2.1/ref/databases/#connecting-to-the-database
https://docs.djangoproject.com/en/2.1/topics/forms/
https://docs.djangoproject.com/en/2.1/ref/templates/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/15db5596-4a3a-41ca-bd64-ce22aff21144%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Same superuser in diffenrent apps

2018-08-22 Thread aseem hegshetye
Hi,
I created second app and when creating superuser I get error saying 
superuser already taken. Is Django superuser shared accross all aps if DB 
is shared between those apps? I have two seperate Apps with shared DB and 
when i tried to create superuser for second app, i got error saying user 
name already taken.
Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4512cd1e-2b2d-4e5f-b606-cf77b924f9c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Same superuser in diffenrent apps

2018-08-22 Thread Mikhailo Keda
Yes, superuser will be set for all apps in this case

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2288b5e4-4422-406e-9ff3-1a9ae78e8a7d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Same superuser in diffenrent apps

2018-08-22 Thread Irenge Mufungizi
try to clear cache,

On Wed, Aug 22, 2018 at 1:45 PM aseem hegshetye 
wrote:

> Hi,
> I created second app and when creating superuser I get error saying
> superuser already taken. Is Django superuser shared accross all aps if DB
> is shared between those apps? I have two seperate Apps with shared DB and
> when i tried to create superuser for second app, i got error saying user
> name already taken.
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4512cd1e-2b2d-4e5f-b606-cf77b924f9c3%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOpsgpgjVcLgndtOpVTs7LZrQEezBLXA-nFeYWTgPVGsJ4K%2BDw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: python -m django --version

2018-08-22 Thread Jason
basic python command line arg.  you can see it when executing `python 
--help` in the terminal.

-m mod : run library module as a script (terminates option list)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/dc9934d9-fe77-4b5d-bd25-03fd52e9c5f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Same superuser in diffenrent apps

2018-08-22 Thread Jason
if you're trying to create a superuser account with the same username, you 
will get that error.  usernames are unique.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a7a7f7aa-5e7b-4364-9683-36f10d65a86a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: problems with order by month

2018-08-22 Thread Phako Perez
I think you miss the column to order

cardio = Alumno.objects.filter ( fechanacimiento __month = 
now.month).order_by(‘fechanacimiento’)  
Should be

cardio = Alumno.objects.filter ( fechanacimiento __month = 
now.month).order_by(‘fechanacimiento_day’)

Sent from my iPhone

> On Aug 21, 2018, at 6:38 PM, Osvaldo Ruso Olea  wrote:
> 
> cardio = Alumno.objects.filter ( fechanacimiento __month = 
> now.month).order_by(‘fechanacimiento’)  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/66567EB6-0843-47ED-BB24-5F7753BE169F%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: template tag help please?

2018-08-22 Thread MikeKJ

Thank you Andreas Kuhne, progress

So this {% load get_cost %}{% do_cost b.name avn avd %} is not getting any 
error on the template but as simple as the below is there is no return

from django import template
from django.conf import settings
from django.utils.html import escape
register = template.Library()

@register.simple_tag
def do_cost( name, avn, avd, *args, **kwargs ):
avn = kwargs['avn']
avd = kwargs['avd']
name = kwargs['name']
return name


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/76f303e0-84b4-4042-aad3-93e18bbfb863%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: problems with order by month

2018-08-22 Thread Franklin Sarmiento
hi Osvaldo, try filtering by date ( by month and date ), do you can filter
by month and day ??? if this is what do you want, so, you  can filter by
date by example: "fechanacimiento__date", so, the queryset sould be this:

Alumno.objecs.filter(.).order_by('fechanacimiento__date') # by default
is ascending, for descending add the "-" before the order keyword, by
example "-fechanacimiento__date"

Good look.



*Franklin Sarmiento*
*Full-stack developer*
*skype: franklin.s.dev*
*Twitter: @franklinitiel*
*linkedin: Franklin Sarmiento ( franklinit...@gmail.com
 )*
*E-mail: franklinit...@gmail.com *
*Teléfono(s): +57 320 490.79.64 / +58 426 273.8103 ( whatsapp )*



El mié., 22 ago. 2018 a las 7:16, Phako Perez (<13.phak...@gmail.com>)
escribió:

> I think you miss the column to order
>
> cardio = Alumno.objects.filter ( fechanacimiento __month =
> now.month).order_by(‘fechanacimiento’)
>
>
> Should be
>
> cardio = Alumno.objects.filter ( fechanacimiento __month =
> now.month).order_by(‘fechanacimiento_day’)
>
>
>
> Sent from my iPhone
>
> On Aug 21, 2018, at 6:38 PM, Osvaldo Ruso Olea 
> wrote:
>
> cardio = Alumno.objects.filter ( fechanacimiento __month =
> now.month).order_by(‘fechanacimiento’)
>
>-
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/66567EB6-0843-47ED-BB24-5F7753BE169F%40gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMsjBKJFGdqK9ec4ics26oFca%2BfpQ-VHaXtO4Jf%2BV9Zx72dmMw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: python -m django --version

2018-08-22 Thread Franklin Sarmiento
hi Basavaraj, you can use the command

$ python -V

for more commands you can use

$ python --help

I hope this helps you


*Franklin Sarmiento*
*Full-stack developer*
*skype: franklin.s.dev*
*Twitter: @franklinitiel*
*linkedin: Franklin Sarmiento ( franklinit...@gmail.com
 )*
*E-mail: franklinit...@gmail.com *
*Teléfono(s): +57 320 490.79.64 / +58 426 273.8103 ( whatsapp )*



El mié., 22 ago. 2018 a las 7:09, Jason () escribió:

> basic python command line arg.  you can see it when executing `python
> --help` in the terminal.
>
> -m mod : run library module as a script (terminates option list)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/dc9934d9-fe77-4b5d-bd25-03fd52e9c5f9%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMsjBKLdSBhZ2BEvdrMN0zK78ox5PTZZMr-BnWhJnSMnzVfJKw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: template tag help please?

2018-08-22 Thread MikeKJ
 

Thank you Andreas Kuhne, progress

 
So this {% load get_cost %}{% do_cost b.name avn avd %} was working quite 
happily but for some reason is now complaining 

Exception Type: TemplateSyntaxError 
 Exception Value: 

Caught KeyError while rendering: 'avn'


Exception Location claims to beget_cost.py in do_cost, line 10  which 
is avn = kwargs['avn']

but the exception is in the template line {% load get_cost %}{% do_cost 
b.name avn avd %}



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8d9d18dd-c8cb-494c-a2b8-8b06b64c40d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: template tag help please?

2018-08-22 Thread Andréas Kühne
Wait a secound, you are doing some very strange things

I didn't see this before.

You have defined the following:
@register.simple_tag
def do_cost( name, avn, avd, *args, **kwargs ):
avn = kwargs['avn']
avd = kwargs['avd']
name = kwargs['name']
return name

The method has 3 parameters that you are sending to it - name, avn and avd.
They correspond to the values sent to the method in order. So you don't
need to use the kwargs dictionary - it's unnecessary...

You could just write:
@register.simple_tag
def do_cost( name, avn, avd, *args, **kwargs ):
return name

Beacause you have sent the name to the method?

Regards,

Andréas


Den ons 22 aug. 2018 kl 16:09 skrev MikeKJ :

> Thank you Andreas Kuhne, progress
>
>
> So this {% load get_cost %}{% do_cost b.name avn avd %} was working quite
> happily but for some reason is now complaining
>
> Exception Type: TemplateSyntaxError
>  Exception Value:
>
> Caught KeyError while rendering: 'avn'
>
>
> Exception Location claims to beget_cost.py in do_cost, line 10  which
> is avn = kwargs['avn']
>
> but the exception is in the template line {% load get_cost %}{% do_cost
> b.name avn avd %}
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8d9d18dd-c8cb-494c-a2b8-8b06b64c40d3%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK4qSCcnJzyrWXGjTyF9NZAc0SE6zxQ1gbrd1ZM2Oc%2B3ZL_tyQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


RE: template tag help please?

2018-08-22 Thread Mike Jones
Ah I was just doing that to prove it was working

 

This is the actual tag

 

from django import template

from django.conf import settings

from django.utils.html import escape

from band.models import Data

 

register = template.Library()

 

@register.simple_tag

def do_cost( name, avn, avd, *args, **kwargs ):

avn = kwargs['avn']

avd = kwargs['avd']

name = kwargs['name']

val_set = Data.objects.filter(prop = name).filter(date_period=avd)

avn = 7  #this line is just for testing

if avn >= 7:

for x in val_set:

val = x.full

else:

for x in val_set:

val = x.short

return val

 

From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of Andréas Kühne
Sent: 22 August 2018 15:20
To: django-users@googlegroups.com
Subject: Re: template tag help please?

 

Wait a secound, you are doing some very strange things

 

I didn't see this before.

 

You have defined the following:

@register.simple_tag
def do_cost( name, avn, avd, *args, **kwargs ):
avn = kwargs['avn']
avd = kwargs['avd']
name = kwargs['name']
return name

 

The method has 3 parameters that you are sending to it - name, avn and avd. 
They correspond to the values sent to the method in order. So you don't need to 
use the kwargs dictionary - it's unnecessary...

You could just write:

@register.simple_tag
def do_cost( name, avn, avd, *args, **kwargs ):
return name




Beacause you have sent the name to the method?

 

Regards,

 

Andréas

 

 

Den ons 22 aug. 2018 kl 16:09 skrev MikeKJ :

Thank you Andreas Kuhne, progress

 

So this {% load get_cost %}{% do_cost b.name avn avd %} was working quite 
happily but for some reason is now complaining 

 


Exception Type:

TemplateSyntaxError


 Exception Value:

Caught KeyError while rendering: 'avn'

 

Exception Location claims to beget_cost.py in do_cost, line 10  which is 
avn = kwargs['avn']

 

but the exception is in the template line {% load get_cost %}{% do_cost b.name 
avn avd %}

 

 

 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8d9d18dd-c8cb-494c-a2b8-8b06b64c40d3%40googlegroups.com
 

 .
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to a topic in the Google 
Groups "Django users" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/django-users/zG3S_9BQKMY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 
django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK4qSCcnJzyrWXGjTyF9NZAc0SE6zxQ1gbrd1ZM2Oc%2B3ZL_tyQ%40mail.gmail.com
 

 .
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5b7d7953.1c69fb81.85c08.097dSMTPIN_ADDED_BROKEN%40gmr-mx.google.com.
For more options, visit https://groups.google.com/d/optout.


Re: template tag help please?

2018-08-22 Thread Mikhailo Keda
Probably you don't need template tag at all, try {{ b.name }}
if you just need to get name value from b

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fc0cedda-78ae-484b-837b-9eb990ab1d2f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


how to import serveral csv into database by using migrations.RunPython

2018-08-22 Thread emmanuel wyckens
Hello, 

The class below didn't work if you use  migrations.RunPython several times.
Have you got an idea to manage double csv file importation into database ?

Thanks

Emmanuel

class Migration(migrations.Migration):

dependencies = [
("contact", "0001_initial"),
]

operations = [
 migrations.RunPython(
   lambda apps, schema_editor: import_countries(
   str(BASE_DIR / "contact" / "migrations" / "departement.csv")
 )
 ),
 migrations.RunPython(
 lambda apps, schema_editor: import_zipcode(
 str(BASE_DIR / "contact" / "migrations" / "codepostal.csv")
 )
 ),
]

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a0c3fd68-9db2-462d-b122-9ea439e61ce4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Help with mi first hello world please problems with urls

2018-08-22 Thread Dario Coronel
El problema que tengo es el siguiente soy un novato recien conociendo el 
mundo de python y django estaba siguiendo los pasos de la documentacion 
para crear una primera aplicacion consegui instalr django y craer con 
startproject un projecti inicial sin problemas, mi primer problema se 
presenta cuando configuro las urls al crear con el $python manage.py 
startapp polls dichos archivos sigo los pasos hasta donde en el archivo 
polls/views.py  se incrusta el siguiente codigo 


polls/views.py
 from django.http import HttpResponse


def index(request):
return HttpResponse("Hello, world. You're at the polls index.")

luego sigue
crear un archivo urls.py en el mismo directorio

polls/
__init__.py
admin.py
apps.py
migrations/
__init__.py
models.py
tests.py
urls.py
views.py


luego sigue incrustar el codigo en el archivo


polls/urls.py

from django.urls import path
from . import views

urlpatterns = [
path('', views.index, name='index'),
]

seguido de agregar el siguiente codigo al siguiente directorio

mysite/urls.py

from django.contrib import admin
from django.urls import include, path

urlpatterns = [
path('polls/', include('polls.urls')),
path('admin/', admin.site.urls),
]


De ahi en teoria al ejecutar en la consola $python manage.py runserver debria 
de poder ver el hola mundo y solo me da el error de 

Not Found

The requested URL / was not found on this server.



cual seria mi error agradecreia mucho una ayuda.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c7ea8aff-ee2a-481b-b50f-05586f4a97ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Data Binding Example Channels 2

2018-08-22 Thread weezardofwoz
Hello,

In another question it was pointed out that data binding has been removed 
form the channels 2.x core. Andrew said "You can write most of the data 
binding functionality yourself in Channels 2 by adding group send methods 
to model save methods" - can anyone provide a basic example of how to 
properly import and use the consumer to send communication this way (I 
presume that the model save method would be overloaded in the models.py and 
the consumer would be imported and called there)?

Thanks in advance

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8a9c44a8-83ec-4aeb-96d1-7b47e0df2632%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Making a django project and an API.

2018-08-22 Thread vineeth sagar
Hi I am pretty comfortable django. Now recently started working on a fresh 
project, they want a normal project and an browsable api. I have seen the 
drf and it's great, the browsable api in drf documentation is what they(my 
boss) wants. How do I start developing both of them simultaneously. I will 
have all the models written in the normal django applications, all I have 
to do is make model serializers for the api, that's straight forward, The 
views of our django project that return json data can be made as a drf 
views and can be made callable without re-writing much of the logic. How 
ever the doubt I have is, how should I handle views that render webpages? 
Should I re-write the whole functions again to return json data, or Is 
there something available in the drf that will help with this? I am new to 
making api's. I know for a fact an api returns json data. How can I handle 
this particular case please help me. If any parts of the questions 
confusing you please ask me I will give you the clarification. If my 
concept has a flaw(Which I think there is) please correct me.


Thanks
vineeth

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/637196ee-178a-40f2-b2a8-1fee569802db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Data Binding Example Channels 2

2018-08-22 Thread Mikhailo Keda
There is an example of simple chat site (direct link to save method where 
data binding is implemented):
https://bitbucket.org/voron-raven/chat/src/f78b6531652f866109dbfa2f8aeffac6c0f1bb32/core/models.py#lines-157

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e286b19e-e218-4e50-8632-fb952eb8f134%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Data Binding Example Channels 2

2018-08-22 Thread Mikhailo Keda
link to the chat site - https://chat.mkeda.me/

середа, 22 серпня 2018 р. 22:12:58 UTC+3 користувач Mikhailo Keda написав:
>
> There is an example of simple chat site (direct link to save method where 
> data binding is implemented):
>
> https://bitbucket.org/voron-raven/chat/src/f78b6531652f866109dbfa2f8aeffac6c0f1bb32/core/models.py#lines-157
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f1f31ed5-d0d4-4673-9c5a-3e44ead3613d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Data Binding Example Channels 2

2018-08-22 Thread weezardofwoz
Thank you very much! This will be extremely helpful in accomplishing my 
intended usage!

On Wednesday, August 22, 2018 at 3:16:42 PM UTC-4, Mikhailo Keda wrote:
>
> link to the chat site - https://chat.mkeda.me/
>
> середа, 22 серпня 2018 р. 22:12:58 UTC+3 користувач Mikhailo Keda написав:
>>
>> There is an example of simple chat site (direct link to save method where 
>> data binding is implemented):
>>
>> https://bitbucket.org/voron-raven/chat/src/f78b6531652f866109dbfa2f8aeffac6c0f1bb32/core/models.py#lines-157
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3fb1526a-8901-49df-a405-7ed857e8c348%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Data Binding Example Channels 2

2018-08-22 Thread weezardofwoz
Another thought occurs to me: what are the benefits (if any) of this method 
vs. hooking into the save / create / delete signals?

On Wednesday, August 22, 2018 at 3:30:44 PM UTC-4, weezar...@gmail.com 
wrote:
>
> Thank you very much! This will be extremely helpful in accomplishing my 
> intended usage!
>
> On Wednesday, August 22, 2018 at 3:16:42 PM UTC-4, Mikhailo Keda wrote:
>>
>> link to the chat site - https://chat.mkeda.me/
>>
>> середа, 22 серпня 2018 р. 22:12:58 UTC+3 користувач Mikhailo Keda написав:
>>>
>>> There is an example of simple chat site (direct link to save method 
>>> where data binding is implemented):
>>>
>>> https://bitbucket.org/voron-raven/chat/src/f78b6531652f866109dbfa2f8aeffac6c0f1bb32/core/models.py#lines-157
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/607aa8a0-7e5e-42d5-b257-ea78e9d61fef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Data Binding Example Channels 2

2018-08-22 Thread weezardofwoz
Also, if for instance I am updating a user model with information that I 
want only that specific user to see, how do I send over the websocket to 
only that user (they would have an authenticated session)?

sorry for the bombardment of questions :P

On Wednesday, August 22, 2018 at 3:45:15 PM UTC-4, weezar...@gmail.com 
wrote:
>
> Another thought occurs to me: what are the benefits (if any) of this 
> method vs. hooking into the save / create / delete signals?
>
> On Wednesday, August 22, 2018 at 3:30:44 PM UTC-4, weezar...@gmail.com 
> wrote:
>>
>> Thank you very much! This will be extremely helpful in accomplishing my 
>> intended usage!
>>
>> On Wednesday, August 22, 2018 at 3:16:42 PM UTC-4, Mikhailo Keda wrote:
>>>
>>> link to the chat site - https://chat.mkeda.me/
>>>
>>> середа, 22 серпня 2018 р. 22:12:58 UTC+3 користувач Mikhailo Keda 
>>> написав:

 There is an example of simple chat site (direct link to save method 
 where data binding is implemented):

 https://bitbucket.org/voron-raven/chat/src/f78b6531652f866109dbfa2f8aeffac6c0f1bb32/core/models.py#lines-157

>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f90be8fb-baeb-45f1-9891-17a5aa31b6c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to import serveral csv into database by using migrations.RunPython

2018-08-22 Thread Mike Dewhirst

On 23/08/2018 1:32 AM, emmanuel wyckens wrote:

Hello,

The class below didn't work if you use migrations.RunPython several times.
Have you got an idea to manage double csv file importation into database ?


In your migration file ...

from django.db import migrations, models
from .utils import double_csv_file_importation

class Migration(migrations.Migration):
    dependencies = [
    ('', ''),
    ]
    operations = [
        migrations.RunPython(
            double_csv_file_importation,
            # afterwards, edit the first line of 
double_csv_file_importation to return None

    # so that subsequent migrations don't re-import the csv files
        ),
    ]

I use this way frequently to import changing reference data from 
multiple csv files. It lets me build and test the importation process 
separately and just trigger it from a new migration whenever necessary.


You may also consider using a management command. I also uses these for 
csv imports. It is slightly more complex to set up - but well documented 
- but easier to manage if you have access to the server to run them 
whenever necessary.




Thanks

Emmanuel

class Migration(migrations.Migration):

    dependencies = [
    ("contact", "0001_initial"),
    ]

    operations = [
 migrations.RunPython(
       lambda apps, schema_editor: import_countries(
   str(BASE_DIR / "contact" / "migrations" / 
"departement.csv")

 )
 ),
 migrations.RunPython(
 lambda apps, schema_editor: import_zipcode(
 str(BASE_DIR / "contact" / "migrations" / 
"codepostal.csv")

 )
 ),
    ]
--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-users+unsubscr...@googlegroups.com 
.
To post to this group, send email to django-users@googlegroups.com 
.

Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a0c3fd68-9db2-462d-b122-9ea439e61ce4%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2964133e-fb3c-34b5-8670-3b21e7d0b693%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: Making a django project and an API.

2018-08-22 Thread Mike Dewhirst
If you can get your hands on a copy of Two Scoops of Django 1.11, there 
is a whole chapter on DRF. I've just had a look through it (20+ pages) 
and I reckon it will answer all your questions.


On 23/08/2018 5:10 AM, vineeth sagar wrote:
Hi I am pretty comfortable django. Now recently started working on a 
fresh project, they want a normal project and an browsable api. I have 
seen the drf and it's great, the browsable api in drf documentation is 
what they(my boss) wants. How do I start developing both of them 
simultaneously. I will have all the models written in the normal 
django applications, all I have to do is make model serializers for 
the api, that's straight forward, The views of our django project that 
return json data can be made as a drf views and can be made callable 
without re-writing much of the logic. How ever the doubt I have is, 
how should I handle views that render webpages? Should I re-write the 
whole functions again to return json data, or Is there something 
available in the drf that will help with this? I am new to making 
api's. I know for a fact an api returns json data. How can I handle 
this particular case please help me. If any parts of the questions 
confusing you please ask me I will give you the clarification. If my 
concept has a flaw(Which I think there is) please correct me.



Thanks
vineeth
--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-users+unsubscr...@googlegroups.com 
.
To post to this group, send email to django-users@googlegroups.com 
.

Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/637196ee-178a-40f2-b2a8-1fee569802db%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1aaaf770-14a4-0b56-1e5d-42815b62639c%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: Making a django project and an API.

2018-08-22 Thread vineeth sagar
Hey Mike I like reading books rather than tutorials please share the name
of the book.

On Aug 23, 2018 5:47 AM, "Mike Dewhirst"  wrote:

> If you can get your hands on a copy of Two Scoops of Django 1.11, there is
> a whole chapter on DRF. I've just had a look through it (20+ pages) and I
> reckon it will answer all your questions.
>
> On 23/08/2018 5:10 AM, vineeth sagar wrote:
>
>> Hi I am pretty comfortable django. Now recently started working on a
>> fresh project, they want a normal project and an browsable api. I have seen
>> the drf and it's great, the browsable api in drf documentation is what
>> they(my boss) wants. How do I start developing both of them simultaneously.
>> I will have all the models written in the normal django applications, all I
>> have to do is make model serializers for the api, that's straight forward,
>> The views of our django project that return json data can be made as a drf
>> views and can be made callable without re-writing much of the logic. How
>> ever the doubt I have is, how should I handle views that render webpages?
>> Should I re-write the whole functions again to return json data, or Is
>> there something available in the drf that will help with this? I am new to
>> making api's. I know for a fact an api returns json data. How can I handle
>> this particular case please help me. If any parts of the questions
>> confusing you please ask me I will give you the clarification. If my
>> concept has a flaw(Which I think there is) please correct me.
>>
>>
>> Thanks
>> vineeth
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com > django-users+unsubscr...@googlegroups.com>.
>> To post to this group, send email to django-users@googlegroups.com
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/637196ee-178a-40f2-b2a8-1fee569802db%40googlegroups.com
>> > a-40f2-b2a8-1fee569802db%40googlegroups.com?utm_medium=email
>> &utm_source=footer>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/ms
> gid/django-users/1aaaf770-14a4-0b56-1e5d-42815b62639c%40dewhirst.com.au.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMMZq8Mp6ewPs7MC%3Dig4bGtmWWCzwCdJjd3RbOhZKns4_dqpnA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Making a django project and an API.

2018-08-22 Thread vineeth sagar
Sorry, got the name of the book.

On Aug 23, 2018 9:29 AM, "vineeth sagar"  wrote:

> Hey Mike I like reading books rather than tutorials please share the name
> of the book.
>
> On Aug 23, 2018 5:47 AM, "Mike Dewhirst"  wrote:
>
>> If you can get your hands on a copy of Two Scoops of Django 1.11, there
>> is a whole chapter on DRF. I've just had a look through it (20+ pages) and
>> I reckon it will answer all your questions.
>>
>> On 23/08/2018 5:10 AM, vineeth sagar wrote:
>>
>>> Hi I am pretty comfortable django. Now recently started working on a
>>> fresh project, they want a normal project and an browsable api. I have seen
>>> the drf and it's great, the browsable api in drf documentation is what
>>> they(my boss) wants. How do I start developing both of them simultaneously.
>>> I will have all the models written in the normal django applications, all I
>>> have to do is make model serializers for the api, that's straight forward,
>>> The views of our django project that return json data can be made as a drf
>>> views and can be made callable without re-writing much of the logic. How
>>> ever the doubt I have is, how should I handle views that render webpages?
>>> Should I re-write the whole functions again to return json data, or Is
>>> there something available in the drf that will help with this? I am new to
>>> making api's. I know for a fact an api returns json data. How can I handle
>>> this particular case please help me. If any parts of the questions
>>> confusing you please ask me I will give you the clarification. If my
>>> concept has a flaw(Which I think there is) please correct me.
>>>
>>>
>>> Thanks
>>> vineeth
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com >> django-users+unsubscr...@googlegroups.com>.
>>> To post to this group, send email to django-users@googlegroups.com
>>> .
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/django-users/637196ee-178a-40f2-b2a8-1fee569802db%40googlegroups.com
>>> >> a-40f2-b2a8-1fee569802db%40googlegroups.com?utm_medium=email
>>> &utm_source=footer>.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/1aaaf770-14a4-0b56-1e5d-42815b62639c%40dewhirst.com.au.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMMZq8Prm9c_JWnT5pXCU4sZmDnBdQjOhYP0%3DDdrQ1Rt4jggVw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Making a django project and an API.

2018-08-22 Thread Vineet Kothari
You want the response in front end that's what you wantSent from my Huawei Mobile Original Message Subject: Re: Making a django project and an API.From: vineeth sagar To: django-users@googlegroups.comCC: Sorry, got the name of the book.On Aug 23, 2018 9:29 AM, "vineeth sagar"  wrote:Hey Mike I like reading books rather than tutorials please share the name of the book.On Aug 23, 2018 5:47 AM, "Mike Dewhirst"  wrote:If you can get your hands on a copy of Two Scoops of Django 1.11, there is a whole chapter on DRF. I've just had a look through it (20+ pages) and I reckon it will answer all your questions.

On 23/08/2018 5:10 AM, vineeth sagar wrote:

Hi I am pretty comfortable django. Now recently started working on a fresh project, they want a normal project and an browsable api. I have seen the drf and it's great, the browsable api in drf documentation is what they(my boss) wants. How do I start developing both of them simultaneously. I will have all the models written in the normal django applications, all I have to do is make model serializers for the api, that's straight forward, The views of our django project that return json data can be made as a drf views and can be made callable without re-writing much of the logic. How ever the doubt I have is, how should I handle views that render webpages? Should I re-write the whole functions again to return json data, or Is there something available in the drf that will help with this? I am new to making api's. I know for a fact an api returns json data. How can I handle this particular case please help me. If any parts of the questions confusing you please ask me I will give you the clarification. If my concept has a flaw(Which I think there is) please correct me.


Thanks
vineeth
-- 
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com django-users+unsubscrib...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/637196ee-178a-40f2-b2a8-1fee569802db%40googlegroups.com .
For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1aaaf770-14a4-0b56-1e5d-42815b62639c%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.





-- 
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMMZq8Prm9c_JWnT5pXCU4sZmDnBdQjOhYP0%3DDdrQ1Rt4jggVw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.




-- 
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/qdoe45cn6cj9-6kugoe-htqbe6-glh83j-xs8fwdcfge8pii11hn-o46dkx37jxn4-up2b4op9qf6wkn0gpd-j4tpss8dvqtkq2e79i-nyp31m-ccfnpdgyglf-2gz48niwlrwrjfkdjdttx5g1-7kkgjr.1534997491025%40email.android.com.
For more options, visit https://groups.google.com/d/optout.


Re: Disable HTTP Referer checking

2018-08-22 Thread Siphiwe Gwebu
Did you ever have any luck with disabling referer checnking?

On Thursday, 29 September 2011 08:25:26 UTC+2, sspross wrote:
>
> On Sep 28, 5:19 pm, Tom Evans  wrote: 
> > On Wed, Sep 28, 2011 at 4:03 PM, sspross  wrote: 
> > > hi tom 
> > 
> > > thanks for your reply, but 
> > 
> > > i'm don't want to disable a whole view, just disabling the http 
> > > referer checking in https. 
> > 
> > > silvan 
> > 
> Thanks Tom, I will take a closer look at this! 
>
> Silvan 
>
> > Oh I see - my bad. 
> > 
> > There's no way to disable this check, looking at the source code. 
> > 
> > The CSRF middleware will automatically accept a request, regardless of 
> > the referrer/CSRF tokens provided, if the request has the attribute 
> > '_dont_enforce_csrf_checks' set to True. 
> > This is meant to be for the test suite to skip CSRF checks (I think), 
> > but you could abuse it, eg by adding some middleware which checks that 
> > the call is valid and adding that attribute if you think the request 
> > is genuine. 
> > 
> > Cheers 
> > 
> > Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b04093f7-a29c-43c8-9b93-ea14065d406f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Data Binding Example Channels 2

2018-08-22 Thread Mikhailo Keda
There are no benefits. As for me if you need to implement data binding just 
for one model - you could do this directly in the model, if you need data 
binding for few models - better to use signals to keep code clean and 
readable.

You could create groups with just one user.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6e8c5543-aaac-406f-b435-2602f9426065%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django sqlite3 error

2018-08-22 Thread ruban bharath


Hi these are my tables

music_name = char(username),userId(int)

meaning = char(meaning),userid(int)

i have used the join to merge this

db = sqlite3.connect('db.sqlite3')
cursor = db.cursor()

cursor.execute('\n'

   'INSERT INTO  music_result SELECT username, meaning 
,NULL\n'

   'FROM music_name N JOIN music_sample1 T ON N.userid = 
T.userid \n')
db.commit()

when i tried to do this i got an error like

*sqlite3.IntegrityError: datatype mismatch*

please do help me to solve this error

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fe247615-ee16-49ff-833f-590fc2f9d602%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to delete least recently used not expired django sessions?

2018-08-22 Thread Web Architect
Hi Avraham,

Thanks for the recommendation. Will take a look at the package. 

Thanks.

On Monday, August 20, 2018 at 1:00:03 PM UTC+5:30, Avraham Serour wrote:
>
> maybe something like this could be useful for your use case:
> https://pypi.org/project/django-session-timeout/
> it has an option for SESSION_EXPIRE_AFTER_LAST_ACTIVITY
>
>
> maybe this could also be useful for you: 
> https://django-session-security.readthedocs.io/en/latest/
>
>
>
> On Mon, Aug 20, 2018 at 8:34 AM Web Architect  > wrote:
>
>> Hi Jason,
>>
>> Thanks for your response.
>>
>> As mentioned in my earlier post...I have a long expiry date for the 
>> sessions (and hence, the cookies)  as we want our users to be always logged 
>> in or in session (till they clear their cookies). And that's what is 
>> causing the issue. 
>>
>> The goal is to keep the regular users logged in whereas flush out the non 
>> active users (even if their sessions haven't expired). Hence, was looking 
>> for a solution for the same. 
>>
>> Thanks.
>>
>> On Saturday, August 18, 2018 at 5:39:19 PM UTC+5:30, Jason wrote:
>>>
>>> With database sessions out of the box, no.
>>>
>>>
>>> https://github.com/django/django/blob/master/django/contrib/sessions/base_session.py
>>>
>>> You can see there are three attributes for a session model: key, data 
>>> and expire_date
>>>
>>> That said, since sessions are backed by browser cookies, django's 
>>> default is two weeks for session cookies as you can see at 
>>> https://docs.djangoproject.com/en/2.1/ref/settings/#std:setting-SESSION_COOKIE_AGE,
>>>  
>>> which are used here:  
>>> https://github.com/django/django/blob/master/django/contrib/sessions/backends/base.py#L225-L244
>>>
>>> So if you haven't altered that, all sessions expire in two weeks, and 
>>> you can just delete those expired sessions by using the clearsessions 
>>> management command 
>>> 
>>> .
>>>
>>> if you have changed that, then what Hemendra suggested above seems like 
>>> a reasonable approach, but one that is not backwards compatible if you 
>>> don't have a timestamp field for last access 
>>>
>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/4794450f-ad83-4a00-96e3-f354745b322b%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c8c48fbf-e381-4867-ba7b-94e62c7dce1e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to delete least recently used not expired django sessions?

2018-08-22 Thread Web Architect
Hi,

Thanks for the approach. On our site, customers have option to do guest 
checkout wherein users can make a purchase without getting 
registered/signing up. We are still using session information for such 
users. Hence, the session is kind of combined for logged in and not logged 
in users. The challenge is to figured out the sessions for logged in users 
(atleast I am not aware of how to do that in Django).  
Typically in businesses, users (specifically the masses and who aren't that 
tech savvy) prefer a flow that's smooth and hassle free though security 
definitely becomes an important aspect. Hence, the challenge is to combine 
the both.

I would certainly look into the approach you have suggested. 

Thanks. 

On Monday, August 20, 2018 at 2:08:30 PM UTC+5:30, Michal Petrucha wrote:
>
> -BEGIN PGP SIGNED MESSAGE- 
> Hash: SHA512 
>
> On Fri, Aug 17, 2018 at 05:44:22AM -0700, Web Architect wrote: 
> > Hi, 
> > 
> > We are using persistent django sessions for our website where in the 
> > session information is stored in MySQL. Over last couple of years, the 
> > session data has grown to a huge number and we were planning to clean it 
> up. 
> > I know that there is a django management command 'clearsessions' and we 
> are 
> > using the same as a daily cronjob. 
> > But our challenge is we have long expiry timelines of like 100 years so 
> > that our users are never logged out (unless they clear their cookies 
> etc). 
> > Hence, the clearsessions won't help. 
> > 
> > The solution we are looking for are removing the sessions which are 
> never 
> > used for a long period. Let's say a user never came to our site for 3 
> > months after last logging in. We would like to purge those sessions. 
> Would 
> > really appreciate if anyone could suggest any such solution - be it in 
> > Django or if we need to custom build it. 
> > 
> > Thanks. 
>
> There is another de-facto standard solution to this problem, which 
> does not involve setting the session expiry to years – it's usually 
> referred to as “persistent authentication cookie”. That way, sessions 
> would expire after the usual short period of time, and it also makes 
> the persistent login feature optional for your users. 
>
> I haven't found a maintained package that would implement this for 
> Django applications, but you can find a bunch of material on this 
> topic. For example, this article seems to consider a lot of potential 
> attack vectors: 
>
> https://paragonie.com/blog/2015/04/secure-authentication-php-with-long-term-persistence#title.2
>  
>
> Michal 
> -BEGIN PGP SIGNATURE- 
> Version: GnuPG v1 
>
> iQIcBAEBCgAGBQJben3lAAoJEHA7T/IPM/klRiMQAKnoqOWIrbQDiDcaARde9jl+ 
> SuPfHZP/H44t7z610+CC2D03C4hps+7acQWslH2S+WFL/+VUJPqytGTWsAJbs12A 
> /R+UaIlwDGFMeRBw2xdDusZtbE4t+atGS5PPgr8hEW89/op9/DruSed1cVxoUiBp 
> pwNwBst+cieNhtBYpXBUCe8mRxRegc8xCz/pKRw9ZycszYgB4rTpDVwOFMmxPWuS 
> rKDRgMsXhYQskiGWi5oSHQ8xEgxBeGXdv3HnlwCm9TenXs1gfVQwbRhG4btivCUD 
> nzhpUTtHx3PP5/uDK0GM87MqB6ufuf7H/7QXgFKTWBZxSeOXwaxICsxYaG54DMld 
> hYxFk36RtjufWgcffQooBfw3eavtzAnPdjlZzEI3ZYj5fPx9agGJf177JAVSCovS 
> bppF1QbipuIfQlLyv7gee8bR6a6uLEQZ4vp9NHrfqWjXYqmIDxubnVB5B1/d6yvG 
> S9liRlkoGAWC9tTS5ig03QV1b4nBlJIonKIRBecrfJXHw3G2WojY8HAiSyyz9A4P 
> S/XcvOzK7dWsw/NUmx84GkR3SGfFeQor3bVWUeBhG6BBOjZq6cj+MHa2gZswIIYa 
> d6dHRCa4hyDwBLZDaEbI4EDbIkrY82L87PD9KW+0xbBYojwysQz8pL/3WHc8F1NL 
> 0VXYCCnD/4/LdzywjR21 
> =njLP 
> -END PGP SIGNATURE- 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fbcb5b75-de8b-43fb-a47e-5232b1c95212%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.