Django Pykafka Implementation

2019-02-09 Thread Elikem Kuadey
Hi guys,

I have been working with pykafka for some time now and its been going well
until I had to start the consumer from the wsgi.py file which works but
once started all http request to the application result in a 504 - Gateway
Timeout.

How do I resolve this issue, please?

-- 
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/CAKqsSG6HtwNORRuzsLc2ZYB%3D3am5FPtRkfUhG9JbmTi3%2BCB8YA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Password Policy Adherence. Cannot use the passwords used before

2019-02-09 Thread Simon A
@Jason, yes I believe I do need to research further when that action
happens. the point where the password is hashed and stored in the User
table. I'll continue to work on it.

@James, currently the requirements are non debatable for us developers in
the company. The security team implemented the guidelines and by any means,
they have to be implemented. (Even though the company apps don't even
follow the policies!) I believe it's just additional work for developers,
and makes the development time longer which equates to less value to
customers. But I do appreciate the points you provided. When I have the
chance to have a discussion with the security team, I will definitely bring
up these points.

On Fri, Feb 8, 2019 at 11:19 PM Matthew Pava  wrote:

> I completely support this NIST policy, James.  Unfortunately, the PCI
> Security Standards Council does not support this policy at this time.  In
> order for a company to be PCI compliant, users must change their passwords
> every three months.  PCI compliance is essential for companies to adhere to
> when they are processing credit cards.  There are ways around the
> requirements; companies could basically out-source credit card processing
> to other companies such as Stripe or Square, but they need to know what
> they are doing to maintain compliance.
>
>
>
>
> https://www.pcisecuritystandards.org/documents/Payment-Data-Security-Essential-Strong-Passwords.pdf?agreement=true=1549638814227
>
>
>
>
>
>
>
> *From:* django-users@googlegroups.com [mailto:
> django-users@googlegroups.com] *On Behalf Of *James Bennett
> *Sent:* Friday, February 8, 2019 9:00 AM
> *To:* django-users@googlegroups.com
> *Subject:* Re: Password Policy Adherence. Cannot use the passwords used
> before
>
>
>
> I'm going to suggest you step back and consider whether the policies you
> want to implement are good policies. A good, solidly-researched set of
> recommendations is NIST SP800-63B:
>
>
>
> https://pages.nist.gov/800-63-3/sp800-63b.html
>
>
>
> In particular, NIST suggests the following:
>
>
>
> * Do not use a policy which automatically "expires" passwords and forces
> users to change them periodically. Only force a password change when you
> have evidence that a password has been compromised.
>
> * Do not try to impose artificial "complexity" rules (like requiring a mix
> of uppercase/lowercase, numbers and symbols).
>
> * When a user changes their password, compare it against lists of
> known-compromised passwords.
>
>
>
> Forcing users to change their passwords on a set schedule just encourages
> them to choose weak passwords that are easy to remember. If you force me to
> change my password every three months, for example, here's what I'll do:
>
>
>
> * P@ssword!2019_1
>
> * P@ssword!2019_2
>
> * P@ssword!2019_3
>
> * P@ssword!2019_4
>
>
>
> These passwords are all different from each other, and they each contain
> at least one uppercase and one lowercase letter, at least one number and at
> least one symbol. They're also terrible passwords that would probably get
> cracked within minutes, if not seconds, by any good automated cracker.
>
> That's a year's worth of passwords, each of which is different from the
> last, each contains one
>
> --
> 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/CAL13Cg9Xi7QdCCffqROi_FjLzKimtWYBR%3DusMxf6ihf_E6%3D-9A%40mail.gmail.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/RXEq0nWCPeQ/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/7d7e9de09028498e8fca89973db6484f%40iss2.ISS.LOCAL
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Kind Regards,
Simon Arriola

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving 

Re: Trying to filter out choices in a form based on the logged in user.

2019-02-09 Thread Ricardo Cataldi
You van create this property on your model, andam the init would bem
applied to your form

Em sáb, 9 de fev de 2019 13:15, GavinB841  Hi Ricardo,
>
> Really appreciate your reply, I am struggling to understand where I would
> create this property as I am quite new to Django and haven't worked with
> these before.
>
> Is it included in the model/view/form and under which model for the club,
> user or team.
>
> Thanks for your help.
>
> Gavin
>
> On Saturday, 9 February 2019 13:40:09 UTC, Ricardo Cataldi wrote:
>>
>> Hello there Galvin,
>>
>>
>>
>> You can create properties on the users and filter the queryset
>> conditioning to the user. It depends on how many categories of user you
>> have and how these users are supposed to be filtered by those teams.
>>
>>
>>
>> For example, if you have a spatial selection based on user location, you
>> create a property called ‘location_filter’ and set the separation rule on
>> this property, like:
>>
>>
>>
>> @property
>>
>> def location_filter(self):
>>
>> location = self.location
>>
>> filter_rule = 5miles
>>
>> return [self.location - filter_rule, self.location +
>> filter_rule]
>>
>>
>>
>> and in your form you set a init argument to query those filter rules, in
>> the fashion that you want:
>>
>>
>>
>> def __init__(self, *args, **kwargs):
>>
>> user = kwargs.pop(‘user’, None)
>>
>> self.fields[‘club_id’].queryset =
>> Club.objects.filter(place__lte=user.location_filter[1],
>> place__gte=user.location_filter[0])
>>
>>
>>
>> I have not tested this solution, but with some minor code changes it
>> should work like a charm in filtering the club queryset.
>>
>>
>>
>> *From:* django...@googlegroups.com  *On
>> Behalf Of *GavinB841
>> *Sent:* sábado, 9 de fevereiro de 2019 11:24
>> *To:* Django users 
>> *Subject:* Trying to filter out choices in a form based on the logged in
>> user.
>>
>>
>>
>> Hi all,
>>
>>
>>
>> If anyone could help or point me in the direction of some documentation
>> for the below problem I am having I would really appreciate it.
>>
>>
>>
>> Just to explain quickly:
>>
>>1. I have a model called "Team" which contains a foreign key to
>>another model called "Club"
>>2. The "Club" model contains a foreign key to the "User" model.
>>3. I have a form for the "Team" model which takes in "club_id",
>>currently it lists all the club_id for all users and I want to restrict
>>this.
>>4. I am looking to find out how I can auto-populate this field
>>"club_id" based on the logged in user, which I will then hide in the form.
>>
>> Below is my forms.py
>>
>>
>>
>> class ClubInfoForm(forms.ModelForm):
>> club_address2 = forms.CharField(required=False)
>> club_address3 = forms.CharField(required=False)
>>
>> class Meta():
>> model = ClubInfo
>> fields = ('club_name', 'club_logo', 'club_address1', 'club_address2',
>>   'club_address3', 'club_town', 'club_county', 
>> 'club_country',)
>>
>> def clean_club_name(self):
>> club_name = self.cleaned_data['club_name']
>> if ClubInfo.objects.filter(club_name=club_name).exists():
>> raise ValidationError(_("Club already exists"))
>> return club_name
>>
>>
>> class TeamForm(forms.ModelForm):
>>
>> class Meta():
>> model = Team
>> fields = ('club_id', 'team_name', 'manager_name')
>>
>> def __init__(self, *args, **kwargs):
>> super(TeamForm, self).__init__(*args, **kwargs)
>>
>>
>>
>>
>>
>> models.py
>>
>>
>>
>> class ClubInfo(models.Model):
>>
>> user = models.OneToOneField(User, on_delete=models.CASCADE)
>> club_name = models.CharField(max_length=50, default='', unique=True)
>> club_logo = models.ImageField(upload_to='profile_pics', blank=True)
>> club_address1 = models.CharField(max_length=30)
>> club_address2 = models.CharField(max_length=30, default='')
>> club_address3 = models.CharField(max_length=30, default='')
>> club_town = models.CharField(max_length=30)
>> club_county = models.CharField(max_length=30)
>> club_country = models.CharField(max_length=30)
>> created_date = models.DateTimeField(default=timezone.now)
>>
>> def __str__(self):
>> return self.club_name
>>
>>
>>
>> class Team(models.Model):
>>
>> club_id = models.ForeignKey(ClubInfo, on_delete=models.CASCADE)
>> team_name = models.CharField(max_length=30)
>> manager_name = models.CharField(max_length=20)
>>
>>
>> def __str__(self):
>> return self.team_name
>>
>>
>>
>> *Séanadh Ríomhphoist/*
>>
>> *Email Disclaimer*
>>
>> *Tá an ríomhphost seo agus aon chomhad a sheoltar leis faoi rún agus is
>> lena úsáid ag an seolaí agus sin amháin é. **Is féidir tuilleadh a léamh
>> anseo. *
>> 
>>
>> *This e-mail and any files transmitted with it are 

Re: E-commerce with Django framework

2019-02-09 Thread kibirige Gerald Joseph
check out
https://youtu.be/c_HOWIoQK-I
https://youtu.be/yxOfPNorZ-Y
https://youtu.be/iFXOx7FOC9k

On Sat, Feb 9, 2019 at 6:23 PM Birol Demirtaş 
wrote:

> I know this links but ı cant opened here :( any have video toturial ??
>
> 9 Şub 2019 Cmt, saat 18:20 tarihinde kibirige Gerald Joseph <
> geraldjose...@gmail.com> şunu yazdı:
>
>> Check out the links below. All the information you need to get started
>> with Saleor or Oscar is there.
>> https://docs.getsaleor.com/en/latest/
>> http://docs.oscarcommerce.com/en/latest/
>>
>>
>> On Sat, Feb 9, 2019 at 5:43 PM Birol Demirtaş 
>> wrote:
>>
>>> Hi guys ım trying django and ı try  learn , ı have project but . I wanna
>>> try saleor or oscar or django shop ı wanna try that it buy ı cant runserver
>>> ı need open source codes anyone help me ??
>>>
>>> 9 Şub 2019 Cmt, saat 17:40 tarihinde kibirige Gerald Joseph <
>>> geraldjose...@gmail.com> şunu yazdı:
>>>
  Thank you.
 Meanwhile, am trying out Saleor framework.
 I will try out Oscar to decide which one is the best for the work at
 hand.

 On Sat, Feb 9, 2019 at 5:03 PM Ricardo Cataldi <
 cataldi.rica...@gmail.com> wrote:

> Regarding your first question, try the Oscar e-commerce app and see if
> it suits you.
>
>
>
> *From:* django-users@googlegroups.com  *On
> Behalf Of *kibirige Gerald Joseph
> *Sent:* sábado, 9 de fevereiro de 2019 11:58
> *To:* django-users@googlegroups.com
> *Subject:* Re: E-commerce with Django framework
>
>
>
>
>
> I deleted the pgadmin4.db located on path
> C:\Users\\AppData\Roaming\pgAdmin.
>
> That's when it worked.
>
>
>
> On Sat, Feb 2, 2019 at 5:36 PM Khushal Kumar 
> wrote:
>
> you're welcome. Did it work?
>
>
>
> On Sat, Feb 2, 2019 at 7:55 PM Khushal Kumar 
> wrote:
>
> Right click on pgadmin and troubleshoot it.
>
>
>
> On Sat, Feb 2, 2019 at 6:48 PM kibirige Gerald Joseph <
> geraldjose...@gmail.com> wrote:
>
> Hello
>
> I have problem running PostgreSQL  pg admin on windows 10. whenever I
> start the application it brings out this error:
>
> "Fatal error: the application server could not be contacted."
>
>
>
> What could be the problem? What should I do?
>
>
>
> Thanks,
>
> Gerald.
>
>
>
>
>
>
>
>
>
> On Sun, Jan 20, 2019 at 10:40 AM kibirige Gerald Joseph <
> geraldjose...@gmail.com> wrote:
>
> Hello!
>
> I started learning Django framework last month. Django is great!
> Well,  is  it plausible to build an e-commerce website with Django?
>
> If so, what resources and information do I need to make an e-commerce
> website in Django a reality?
>
> Thank you
>
> Gerald
>
> --
> 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/CANNqTcM-58h8-0pEokw1SaPwAYj8mCLw-be8%2BYQnuKz9Rast2w%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/CAKOftJiudo4AyUn6iNWfzHxd9PrWFjGEEVFC3tUpAkzyPpRdOQ%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
> 

Re: E-commerce with Django framework

2019-02-09 Thread Birol Demirtaş
I know this links but ı cant opened here :( any have video toturial ??

9 Şub 2019 Cmt, saat 18:20 tarihinde kibirige Gerald Joseph <
geraldjose...@gmail.com> şunu yazdı:

> Check out the links below. All the information you need to get started
> with Saleor or Oscar is there.
> https://docs.getsaleor.com/en/latest/
> http://docs.oscarcommerce.com/en/latest/
>
>
> On Sat, Feb 9, 2019 at 5:43 PM Birol Demirtaş 
> wrote:
>
>> Hi guys ım trying django and ı try  learn , ı have project but . I wanna
>> try saleor or oscar or django shop ı wanna try that it buy ı cant runserver
>> ı need open source codes anyone help me ??
>>
>> 9 Şub 2019 Cmt, saat 17:40 tarihinde kibirige Gerald Joseph <
>> geraldjose...@gmail.com> şunu yazdı:
>>
>>>  Thank you.
>>> Meanwhile, am trying out Saleor framework.
>>> I will try out Oscar to decide which one is the best for the work at
>>> hand.
>>>
>>> On Sat, Feb 9, 2019 at 5:03 PM Ricardo Cataldi <
>>> cataldi.rica...@gmail.com> wrote:
>>>
 Regarding your first question, try the Oscar e-commerce app and see if
 it suits you.



 *From:* django-users@googlegroups.com  *On
 Behalf Of *kibirige Gerald Joseph
 *Sent:* sábado, 9 de fevereiro de 2019 11:58
 *To:* django-users@googlegroups.com
 *Subject:* Re: E-commerce with Django framework





 I deleted the pgadmin4.db located on path
 C:\Users\\AppData\Roaming\pgAdmin.

 That's when it worked.



 On Sat, Feb 2, 2019 at 5:36 PM Khushal Kumar 
 wrote:

 you're welcome. Did it work?



 On Sat, Feb 2, 2019 at 7:55 PM Khushal Kumar 
 wrote:

 Right click on pgadmin and troubleshoot it.



 On Sat, Feb 2, 2019 at 6:48 PM kibirige Gerald Joseph <
 geraldjose...@gmail.com> wrote:

 Hello

 I have problem running PostgreSQL  pg admin on windows 10. whenever I
 start the application it brings out this error:

 "Fatal error: the application server could not be contacted."



 What could be the problem? What should I do?



 Thanks,

 Gerald.









 On Sun, Jan 20, 2019 at 10:40 AM kibirige Gerald Joseph <
 geraldjose...@gmail.com> wrote:

 Hello!

 I started learning Django framework last month. Django is great!
 Well,  is  it plausible to build an e-commerce website with Django?

 If so, what resources and information do I need to make an e-commerce
 website in Django a reality?

 Thank you

 Gerald

 --
 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/CANNqTcM-58h8-0pEokw1SaPwAYj8mCLw-be8%2BYQnuKz9Rast2w%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/CAKOftJiudo4AyUn6iNWfzHxd9PrWFjGEEVFC3tUpAkzyPpRdOQ%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/CANNqTcMro0yktLaQ_nwmVxqoHJjgW8tqQDTNHYGD8P4cgi9Rcg%40mail.gmail.com
 
 .
 For more options, visit 

Re: E-commerce with Django framework

2019-02-09 Thread kibirige Gerald Joseph
Check out the links below. All the information you need to get started with
Saleor or Oscar is there.
https://docs.getsaleor.com/en/latest/
http://docs.oscarcommerce.com/en/latest/


On Sat, Feb 9, 2019 at 5:43 PM Birol Demirtaş 
wrote:

> Hi guys ım trying django and ı try  learn , ı have project but . I wanna
> try saleor or oscar or django shop ı wanna try that it buy ı cant runserver
> ı need open source codes anyone help me ??
>
> 9 Şub 2019 Cmt, saat 17:40 tarihinde kibirige Gerald Joseph <
> geraldjose...@gmail.com> şunu yazdı:
>
>>  Thank you.
>> Meanwhile, am trying out Saleor framework.
>> I will try out Oscar to decide which one is the best for the work at hand.
>>
>> On Sat, Feb 9, 2019 at 5:03 PM Ricardo Cataldi 
>> wrote:
>>
>>> Regarding your first question, try the Oscar e-commerce app and see if
>>> it suits you.
>>>
>>>
>>>
>>> *From:* django-users@googlegroups.com  *On
>>> Behalf Of *kibirige Gerald Joseph
>>> *Sent:* sábado, 9 de fevereiro de 2019 11:58
>>> *To:* django-users@googlegroups.com
>>> *Subject:* Re: E-commerce with Django framework
>>>
>>>
>>>
>>>
>>>
>>> I deleted the pgadmin4.db located on path
>>> C:\Users\\AppData\Roaming\pgAdmin.
>>>
>>> That's when it worked.
>>>
>>>
>>>
>>> On Sat, Feb 2, 2019 at 5:36 PM Khushal Kumar 
>>> wrote:
>>>
>>> you're welcome. Did it work?
>>>
>>>
>>>
>>> On Sat, Feb 2, 2019 at 7:55 PM Khushal Kumar 
>>> wrote:
>>>
>>> Right click on pgadmin and troubleshoot it.
>>>
>>>
>>>
>>> On Sat, Feb 2, 2019 at 6:48 PM kibirige Gerald Joseph <
>>> geraldjose...@gmail.com> wrote:
>>>
>>> Hello
>>>
>>> I have problem running PostgreSQL  pg admin on windows 10. whenever I
>>> start the application it brings out this error:
>>>
>>> "Fatal error: the application server could not be contacted."
>>>
>>>
>>>
>>> What could be the problem? What should I do?
>>>
>>>
>>>
>>> Thanks,
>>>
>>> Gerald.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Sun, Jan 20, 2019 at 10:40 AM kibirige Gerald Joseph <
>>> geraldjose...@gmail.com> wrote:
>>>
>>> Hello!
>>>
>>> I started learning Django framework last month. Django is great!
>>> Well,  is  it plausible to build an e-commerce website with Django?
>>>
>>> If so, what resources and information do I need to make an e-commerce
>>> website in Django a reality?
>>>
>>> Thank you
>>>
>>> Gerald
>>>
>>> --
>>> 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/CANNqTcM-58h8-0pEokw1SaPwAYj8mCLw-be8%2BYQnuKz9Rast2w%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/CAKOftJiudo4AyUn6iNWfzHxd9PrWFjGEEVFC3tUpAkzyPpRdOQ%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/CANNqTcMro0yktLaQ_nwmVxqoHJjgW8tqQDTNHYGD8P4cgi9Rcg%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 

Re: Trying to filter out choices in a form based on the logged in user.

2019-02-09 Thread GavinB841
Hi Ricardo,

Really appreciate your reply, I am struggling to understand where I would 
create this property as I am quite new to Django and haven't worked with 
these before.

Is it included in the model/view/form and under which model for the club, 
user or team. 

Thanks for your help.

Gavin 

On Saturday, 9 February 2019 13:40:09 UTC, Ricardo Cataldi wrote:
>
> Hello there Galvin,
>
>  
>
> You can create properties on the users and filter the queryset 
> conditioning to the user. It depends on how many categories of user you 
> have and how these users are supposed to be filtered by those teams.
>
>  
>
> For example, if you have a spatial selection based on user location, you 
> create a property called ‘location_filter’ and set the separation rule on 
> this property, like:
>
>  
>
> @property
>
> def location_filter(self):
>
> location = self.location
>
> filter_rule = 5miles
>
> return [self.location - filter_rule, self.location + 
> filter_rule]
>
>  
>
> and in your form you set a init argument to query those filter rules, in 
> the fashion that you want:
>
>  
>
> def __init__(self, *args, **kwargs):
>
> user = kwargs.pop(‘user’, None)
>
> self.fields[‘club_id’].queryset = 
> Club.objects.filter(place__lte=user.location_filter[1], 
> place__gte=user.location_filter[0])
>
>  
>
> I have not tested this solution, but with some minor code changes it 
> should work like a charm in filtering the club queryset.
>
>  
>
> *From:* django...@googlegroups.com  <
> django...@googlegroups.com > *On Behalf Of *GavinB841
> *Sent:* sábado, 9 de fevereiro de 2019 11:24
> *To:* Django users >
> *Subject:* Trying to filter out choices in a form based on the logged in 
> user.
>
>  
>
> Hi all,
>
>  
>
> If anyone could help or point me in the direction of some documentation 
> for the below problem I am having I would really appreciate it.
>
>  
>
> Just to explain quickly:
>
>1. I have a model called "Team" which contains a foreign key to 
>another model called "Club"
>2. The "Club" model contains a foreign key to the "User" model.
>3. I have a form for the "Team" model which takes in "club_id", 
>currently it lists all the club_id for all users and I want to restrict 
>this.
>4. I am looking to find out how I can auto-populate this field 
>"club_id" based on the logged in user, which I will then hide in the form. 
>
> Below is my forms.py
>
>  
>
> class ClubInfoForm(forms.ModelForm):
> club_address2 = forms.CharField(required=False)
> club_address3 = forms.CharField(required=False)
>
> class Meta():
> model = ClubInfo
> fields = ('club_name', 'club_logo', 'club_address1', 'club_address2',
>   'club_address3', 'club_town', 'club_county', 
> 'club_country',)
>
> def clean_club_name(self):
> club_name = self.cleaned_data['club_name']
> if ClubInfo.objects.filter(club_name=club_name).exists():
> raise ValidationError(_("Club already exists"))
> return club_name
>
>
> class TeamForm(forms.ModelForm):
>
> class Meta():
> model = Team
> fields = ('club_id', 'team_name', 'manager_name')
>
> def __init__(self, *args, **kwargs):
> super(TeamForm, self).__init__(*args, **kwargs)
>
>  
>
>  
>
> models.py
>
>  
>
> class ClubInfo(models.Model):
>
> user = models.OneToOneField(User, on_delete=models.CASCADE)
> club_name = models.CharField(max_length=50, default='', unique=True)
> club_logo = models.ImageField(upload_to='profile_pics', blank=True)
> club_address1 = models.CharField(max_length=30)
> club_address2 = models.CharField(max_length=30, default='')
> club_address3 = models.CharField(max_length=30, default='')
> club_town = models.CharField(max_length=30)
> club_county = models.CharField(max_length=30)
> club_country = models.CharField(max_length=30)
> created_date = models.DateTimeField(default=timezone.now)
>
> def __str__(self):
> return self.club_name
>
>  
>
> class Team(models.Model):
>
> club_id = models.ForeignKey(ClubInfo, on_delete=models.CASCADE)
> team_name = models.CharField(max_length=30)
> manager_name = models.CharField(max_length=20)
>
>
> def __str__(self):
> return self.team_name
>
>  
>
> *Séanadh Ríomhphoist/*
>
> *Email Disclaimer*
>
> *Tá an ríomhphost seo agus aon chomhad a sheoltar leis faoi rún agus is 
> lena úsáid ag an seolaí agus sin amháin é. **Is féidir tuilleadh a léamh 
> anseo. *  
> 
>
> *This e-mail and any files transmitted with it are confidential and are 
> intended solely for use by the addressee. **Read more here. 
> * 
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> 

Re: E-commerce with Django framework

2019-02-09 Thread Birol Demirtaş
Hi guys ım trying django and ı try  learn , ı have project but . I wanna
try saleor or oscar or django shop ı wanna try that it buy ı cant runserver
ı need open source codes anyone help me ??

9 Şub 2019 Cmt, saat 17:40 tarihinde kibirige Gerald Joseph <
geraldjose...@gmail.com> şunu yazdı:

>  Thank you.
> Meanwhile, am trying out Saleor framework.
> I will try out Oscar to decide which one is the best for the work at hand.
>
> On Sat, Feb 9, 2019 at 5:03 PM Ricardo Cataldi 
> wrote:
>
>> Regarding your first question, try the Oscar e-commerce app and see if it
>> suits you.
>>
>>
>>
>> *From:* django-users@googlegroups.com  *On
>> Behalf Of *kibirige Gerald Joseph
>> *Sent:* sábado, 9 de fevereiro de 2019 11:58
>> *To:* django-users@googlegroups.com
>> *Subject:* Re: E-commerce with Django framework
>>
>>
>>
>>
>>
>> I deleted the pgadmin4.db located on path
>> C:\Users\\AppData\Roaming\pgAdmin.
>>
>> That's when it worked.
>>
>>
>>
>> On Sat, Feb 2, 2019 at 5:36 PM Khushal Kumar 
>> wrote:
>>
>> you're welcome. Did it work?
>>
>>
>>
>> On Sat, Feb 2, 2019 at 7:55 PM Khushal Kumar 
>> wrote:
>>
>> Right click on pgadmin and troubleshoot it.
>>
>>
>>
>> On Sat, Feb 2, 2019 at 6:48 PM kibirige Gerald Joseph <
>> geraldjose...@gmail.com> wrote:
>>
>> Hello
>>
>> I have problem running PostgreSQL  pg admin on windows 10. whenever I
>> start the application it brings out this error:
>>
>> "Fatal error: the application server could not be contacted."
>>
>>
>>
>> What could be the problem? What should I do?
>>
>>
>>
>> Thanks,
>>
>> Gerald.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> On Sun, Jan 20, 2019 at 10:40 AM kibirige Gerald Joseph <
>> geraldjose...@gmail.com> wrote:
>>
>> Hello!
>>
>> I started learning Django framework last month. Django is great!
>> Well,  is  it plausible to build an e-commerce website with Django?
>>
>> If so, what resources and information do I need to make an e-commerce
>> website in Django a reality?
>>
>> Thank you
>>
>> Gerald
>>
>> --
>> 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/CANNqTcM-58h8-0pEokw1SaPwAYj8mCLw-be8%2BYQnuKz9Rast2w%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/CAKOftJiudo4AyUn6iNWfzHxd9PrWFjGEEVFC3tUpAkzyPpRdOQ%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/CANNqTcMro0yktLaQ_nwmVxqoHJjgW8tqQDTNHYGD8P4cgi9Rcg%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/007301d4c080%243a331480%24ae993d80%24%40gmail.com
>> 
>> .
>> For more options, visit 

Re: not able to run project once again

2019-02-09 Thread sachin thakur
Thank you for support !
 Start running

On Sat 9 Feb, 2019, 8:02 PM mahesh boini  Check your pipenv file whether django is available or not
>
> On Sat, 9 Feb 2019 at 19:57, sachin thakur 
> wrote:
>
>> Yaa m running
>> In virtual environment
>> M not able to run the server as far as this error wont go
>>
>> On Sat 9 Feb, 2019, 7:56 PM mahesh boini >
>>> Bro I think that’s because of virtuvalenv isssue . Have you running your
>>> project in virtuavalenv check once.
>>>
>>> On Sat, 9 Feb 2019 at 19:48, sachin thakur 
>>> wrote:
>>>
 Traceback (most recent call last):
   File "manage.py", line 8, in 
 from django.core.management import execute_from_command_line
 ModuleNotFoundError: No module named 'django'

 The above exception was the direct cause of the following exception:

 Traceback (most recent call last):
   File "manage.py", line 14, in 
 ) from exc


 ImportError: Couldn't import Django. Are you sure it's installed and
 available on your PYTHONPATH environment variable? Did you forget to
 activate a virtual environment?

  how should i debug this error please do help urgency

 --
 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/08c2c3f0-5c17-466f-bf9e-ecc3e9ad735e%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/CANR2Zjtz3F8MHB-aBxV2DqKomzzCzcon-uUzy-bHvKQ4ACE-Gw%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/CA%2BLmcYtBRrc1LP%2BcG_foJZtQsNZVK2Q5dTWCiujZzCxnrEfB5w%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/CANR2Zjvy%2BPH8OW9qXL9qvRGuPCs31-iw1_trf6F8ZGdSh8xT6w%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/CA%2BLmcYuzhD1U9_17GLvyk_pGbUCwLt7BLK25wse4F_zon0BThQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: E-commerce with Django framework

2019-02-09 Thread kibirige Gerald Joseph
 Thank you.
Meanwhile, am trying out Saleor framework.
I will try out Oscar to decide which one is the best for the work at hand.

On Sat, Feb 9, 2019 at 5:03 PM Ricardo Cataldi 
wrote:

> Regarding your first question, try the Oscar e-commerce app and see if it
> suits you.
>
>
>
> *From:* django-users@googlegroups.com  *On
> Behalf Of *kibirige Gerald Joseph
> *Sent:* sábado, 9 de fevereiro de 2019 11:58
> *To:* django-users@googlegroups.com
> *Subject:* Re: E-commerce with Django framework
>
>
>
>
>
> I deleted the pgadmin4.db located on path
> C:\Users\\AppData\Roaming\pgAdmin.
>
> That's when it worked.
>
>
>
> On Sat, Feb 2, 2019 at 5:36 PM Khushal Kumar 
> wrote:
>
> you're welcome. Did it work?
>
>
>
> On Sat, Feb 2, 2019 at 7:55 PM Khushal Kumar 
> wrote:
>
> Right click on pgadmin and troubleshoot it.
>
>
>
> On Sat, Feb 2, 2019 at 6:48 PM kibirige Gerald Joseph <
> geraldjose...@gmail.com> wrote:
>
> Hello
>
> I have problem running PostgreSQL  pg admin on windows 10. whenever I
> start the application it brings out this error:
>
> "Fatal error: the application server could not be contacted."
>
>
>
> What could be the problem? What should I do?
>
>
>
> Thanks,
>
> Gerald.
>
>
>
>
>
>
>
>
>
> On Sun, Jan 20, 2019 at 10:40 AM kibirige Gerald Joseph <
> geraldjose...@gmail.com> wrote:
>
> Hello!
>
> I started learning Django framework last month. Django is great!
> Well,  is  it plausible to build an e-commerce website with Django?
>
> If so, what resources and information do I need to make an e-commerce
> website in Django a reality?
>
> Thank you
>
> Gerald
>
> --
> 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/CANNqTcM-58h8-0pEokw1SaPwAYj8mCLw-be8%2BYQnuKz9Rast2w%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/CAKOftJiudo4AyUn6iNWfzHxd9PrWFjGEEVFC3tUpAkzyPpRdOQ%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/CANNqTcMro0yktLaQ_nwmVxqoHJjgW8tqQDTNHYGD8P4cgi9Rcg%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/007301d4c080%243a331480%24ae993d80%24%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 

Re: not able to run project once again

2019-02-09 Thread mahesh boini
Check your pipenv file whether django is available or not

On Sat, 9 Feb 2019 at 19:57, sachin thakur 
wrote:

> Yaa m running
> In virtual environment
> M not able to run the server as far as this error wont go
>
> On Sat 9 Feb, 2019, 7:56 PM mahesh boini 
>> Bro I think that’s because of virtuvalenv isssue . Have you running your
>> project in virtuavalenv check once.
>>
>> On Sat, 9 Feb 2019 at 19:48, sachin thakur 
>> wrote:
>>
>>> Traceback (most recent call last):
>>>   File "manage.py", line 8, in 
>>> from django.core.management import execute_from_command_line
>>> ModuleNotFoundError: No module named 'django'
>>>
>>> The above exception was the direct cause of the following exception:
>>>
>>> Traceback (most recent call last):
>>>   File "manage.py", line 14, in 
>>> ) from exc
>>>
>>>
>>> ImportError: Couldn't import Django. Are you sure it's installed and
>>> available on your PYTHONPATH environment variable? Did you forget to
>>> activate a virtual environment?
>>>
>>>  how should i debug this error please do help urgency
>>>
>>> --
>>> 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/08c2c3f0-5c17-466f-bf9e-ecc3e9ad735e%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/CANR2Zjtz3F8MHB-aBxV2DqKomzzCzcon-uUzy-bHvKQ4ACE-Gw%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/CA%2BLmcYtBRrc1LP%2BcG_foJZtQsNZVK2Q5dTWCiujZzCxnrEfB5w%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/CANR2Zjvy%2BPH8OW9qXL9qvRGuPCs31-iw1_trf6F8ZGdSh8xT6w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: not able to run project once again

2019-02-09 Thread sachin thakur
Yaa m running
In virtual environment
M not able to run the server as far as this error wont go

On Sat 9 Feb, 2019, 7:56 PM mahesh boini  Bro I think that’s because of virtuvalenv isssue . Have you running your
> project in virtuavalenv check once.
>
> On Sat, 9 Feb 2019 at 19:48, sachin thakur 
> wrote:
>
>> Traceback (most recent call last):
>>   File "manage.py", line 8, in 
>> from django.core.management import execute_from_command_line
>> ModuleNotFoundError: No module named 'django'
>>
>> The above exception was the direct cause of the following exception:
>>
>> Traceback (most recent call last):
>>   File "manage.py", line 14, in 
>> ) from exc
>>
>>
>> ImportError: Couldn't import Django. Are you sure it's installed and
>> available on your PYTHONPATH environment variable? Did you forget to
>> activate a virtual environment?
>>
>>  how should i debug this error please do help urgency
>>
>> --
>> 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/08c2c3f0-5c17-466f-bf9e-ecc3e9ad735e%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/CANR2Zjtz3F8MHB-aBxV2DqKomzzCzcon-uUzy-bHvKQ4ACE-Gw%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/CA%2BLmcYtBRrc1LP%2BcG_foJZtQsNZVK2Q5dTWCiujZzCxnrEfB5w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: not able to run project once again

2019-02-09 Thread mahesh boini
Bro I think that’s because of virtuvalenv isssue . Have you running your
project in virtuavalenv check once.

On Sat, 9 Feb 2019 at 19:48, sachin thakur 
wrote:

> Traceback (most recent call last):
>   File "manage.py", line 8, in 
> from django.core.management import execute_from_command_line
> ModuleNotFoundError: No module named 'django'
>
> The above exception was the direct cause of the following exception:
>
> Traceback (most recent call last):
>   File "manage.py", line 14, in 
> ) from exc
>
>
> ImportError: Couldn't import Django. Are you sure it's installed and
> available on your PYTHONPATH environment variable? Did you forget to
> activate a virtual environment?
>
>  how should i debug this error please do help urgency
>
> --
> 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/08c2c3f0-5c17-466f-bf9e-ecc3e9ad735e%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/CANR2Zjtz3F8MHB-aBxV2DqKomzzCzcon-uUzy-bHvKQ4ACE-Gw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


not able to run project once again

2019-02-09 Thread sachin thakur
Traceback (most recent call last):
  File "manage.py", line 8, in 
from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "manage.py", line 14, in 
) from exc
 

ImportError: Couldn't import Django. Are you sure it's installed and 
available on your PYTHONPATH environment variable? Did you forget to 
activate a virtual environment?

 how should i debug this error please do help urgency

-- 
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/08c2c3f0-5c17-466f-bf9e-ecc3e9ad735e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: E-commerce with Django framework

2019-02-09 Thread Ricardo Cataldi
Regarding your first question, try the Oscar e-commerce app and see if it suits 
you.

 

From: django-users@googlegroups.com  On Behalf 
Of kibirige Gerald Joseph
Sent: sábado, 9 de fevereiro de 2019 11:58
To: django-users@googlegroups.com
Subject: Re: E-commerce with Django framework

 

 

I deleted the pgadmin4.db located on path C:\Users\\AppData\Roaming\pgAdmin.

That's when it worked.

 

On Sat, Feb 2, 2019 at 5:36 PM Khushal Kumar mailto:kkhushal1...@gmail.com> > wrote:

you're welcome. Did it work?

 

On Sat, Feb 2, 2019 at 7:55 PM Khushal Kumar mailto:kkhushal1...@gmail.com> > wrote:

Right click on pgadmin and troubleshoot it.

 

On Sat, Feb 2, 2019 at 6:48 PM kibirige Gerald Joseph mailto:geraldjose...@gmail.com> > wrote:

Hello

I have problem running PostgreSQL  pg admin on windows 10. whenever I start the 
application it brings out this error:

"Fatal error: the application server could not be contacted."

 

What could be the problem? What should I do?

 

Thanks,

Gerald.

 

 

 

 

On Sun, Jan 20, 2019 at 10:40 AM kibirige Gerald Joseph 
mailto:geraldjose...@gmail.com> > wrote:

Hello!

I started learning Django framework last month. Django is great!
Well,  is  it plausible to build an e-commerce website with Django?

If so, what resources and information do I need to make an e-commerce website 
in Django a reality?

Thank you

Gerald

-- 
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/CANNqTcM-58h8-0pEokw1SaPwAYj8mCLw-be8%2BYQnuKz9Rast2w%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/CAKOftJiudo4AyUn6iNWfzHxd9PrWFjGEEVFC3tUpAkzyPpRdOQ%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/CANNqTcMro0yktLaQ_nwmVxqoHJjgW8tqQDTNHYGD8P4cgi9Rcg%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/007301d4c080%243a331480%24ae993d80%24%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: E-commerce with Django framework

2019-02-09 Thread kibirige Gerald Joseph
I deleted the pgadmin4.db located on path
C:\Users\\AppData\Roaming\pgAdmin.
That's when it worked.

On Sat, Feb 2, 2019 at 5:36 PM Khushal Kumar  wrote:

> you're welcome. Did it work?
>
> On Sat, Feb 2, 2019 at 7:55 PM Khushal Kumar 
> wrote:
>
>> Right click on pgadmin and troubleshoot it.
>>
>> On Sat, Feb 2, 2019 at 6:48 PM kibirige Gerald Joseph <
>> geraldjose...@gmail.com> wrote:
>>
>>> Hello
>>> I have problem running PostgreSQL  pg admin on windows 10. whenever I
>>> start the application it brings out this error:
>>> "Fatal error: the application server could not be contacted."
>>>
>>> What could be the problem? What should I do?
>>>
>>> Thanks,
>>> Gerald.
>>>
>>>
>>>
>>>
>>> On Sun, Jan 20, 2019 at 10:40 AM kibirige Gerald Joseph <
>>> geraldjose...@gmail.com> wrote:
>>>
 Hello!

 I started learning Django framework last month. Django is great!
 Well,  is  it plausible to build an e-commerce website with Django?

 If so, what resources and information do I need to make an e-commerce
 website in Django a reality?

 Thank you

 Gerald

>>> --
>>> 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/CANNqTcM-58h8-0pEokw1SaPwAYj8mCLw-be8%2BYQnuKz9Rast2w%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/CAKOftJiudo4AyUn6iNWfzHxd9PrWFjGEEVFC3tUpAkzyPpRdOQ%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/CANNqTcMro0yktLaQ_nwmVxqoHJjgW8tqQDTNHYGD8P4cgi9Rcg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


RE: Trying to filter out choices in a form based on the logged in user.

2019-02-09 Thread Ricardo Cataldi
Hello there Galvin,

 

You can create properties on the users and filter the queryset conditioning to 
the user. It depends on how many categories of user you have and how these 
users are supposed to be filtered by those teams.

 

For example, if you have a spatial selection based on user location, you create 
a property called ‘location_filter’ and set the separation rule on this 
property, like:

 

@property

def location_filter(self):

location = self.location

filter_rule = 5miles

return [self.location - filter_rule, self.location + 
filter_rule]

 

and in your form you set a init argument to query those filter rules, in the 
fashion that you want:

 

def __init__(self, *args, **kwargs):

user = kwargs.pop(‘user’, None)

self.fields[‘club_id’].queryset = 
Club.objects.filter(place__lte=user.location_filter[1], 
place__gte=user.location_filter[0])

 

I have not tested this solution, but with some minor code changes it should 
work like a charm in filtering the club queryset.

 

From: django-users@googlegroups.com  On Behalf 
Of GavinB841
Sent: sábado, 9 de fevereiro de 2019 11:24
To: Django users 
Subject: Trying to filter out choices in a form based on the logged in user.

 

Hi all,

 

If anyone could help or point me in the direction of some documentation for the 
below problem I am having I would really appreciate it.

 

Just to explain quickly:

1.  I have a model called "Team" which contains a foreign key to another 
model called "Club"
2.  The "Club" model contains a foreign key to the "User" model.
3.  I have a form for the "Team" model which takes in "club_id", currently 
it lists all the club_id for all users and I want to restrict this.
4.  I am looking to find out how I can auto-populate this field "club_id" 
based on the logged in user, which I will then hide in the form. 

Below is my forms.py

 

class ClubInfoForm(forms.ModelForm):
club_address2 = forms.CharField(required=False)
club_address3 = forms.CharField(required=False)

class Meta():
model = ClubInfo
fields = ('club_name', 'club_logo', 'club_address1', 'club_address2',
  'club_address3', 'club_town', 'club_county', 'club_country',)

def clean_club_name(self):
club_name = self.cleaned_data['club_name']
if ClubInfo.objects.filter(club_name=club_name).exists():
raise ValidationError(_("Club already exists"))
return club_name


class TeamForm(forms.ModelForm):

class Meta():
model = Team
fields = ('club_id', 'team_name', 'manager_name')

def __init__(self, *args, **kwargs):
super(TeamForm, self).__init__(*args, **kwargs)
 
 
models.py
 
class ClubInfo(models.Model):

user = models.OneToOneField(User, on_delete=models.CASCADE)
club_name = models.CharField(max_length=50, default='', unique=True)
club_logo = models.ImageField(upload_to='profile_pics', blank=True)
club_address1 = models.CharField(max_length=30)
club_address2 = models.CharField(max_length=30, default='')
club_address3 = models.CharField(max_length=30, default='')
club_town = models.CharField(max_length=30)
club_county = models.CharField(max_length=30)
club_country = models.CharField(max_length=30)
created_date = models.DateTimeField(default=timezone.now)

def __str__(self):
return self.club_name
 
class Team(models.Model):

club_id = models.ForeignKey(ClubInfo, on_delete=models.CASCADE)
team_name = models.CharField(max_length=30)
manager_name = models.CharField(max_length=20)


def __str__(self):
return self.team_name

 

Séanadh Ríomhphoist/

Email Disclaimer

Tá an ríomhphost seo agus aon chomhad a sheoltar leis faoi rún agus is lena 
úsáid ag an seolaí agus sin amháin é. Is féidir tuilleadh a léamh anseo. 
  
  

This e-mail and any files transmitted with it are confidential and are intended 
solely for use by the addressee. Read more here. 
  

-- 
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/8188ff6e-bf56-4010-9caf-90d8a294a187%40googlegroups.com
 

 .
For more options, visit 

Re: Django template

2019-02-09 Thread rich gang
Hi guys,
I just finished learning python on sololeran.com.
And I wanna start django, so I was wondering If anybody would wanna help me
personally.
Like I said I have a fair knowledge about python.
I would be grateful.
thanks,

On Sat, 9 Feb 2019 at 11:43, PASCUAL Eric  wrote:

> Hi,
>
> Templates are nothing more than HTML files with special tags inside. In
> their simplest form, they can be plain HTML without any templating tags and
> they will thus be rendered without any change.
>
> In conclusion, to keep it simple and still let you the opportunity to
> benefit from templating features if ever the need arises in the future, let
> settings as they are and follow template view examples. The overhead will
> be minimal for such "static" templates since the engine provides a quite
> efficient preprocessing and caching mechanism and in any case,
> negligible compared to DB or network related stuff.
>
> Anyway, if for any reason you do not want to keep the templating engine in
> the path at all, your views can return basic HTTP responses containing
> static HTML data, either stored as constant strings in your code (not the
> cleanest option) or, better, as resources in your project (e.g. plain files
> somewhere they can be read from the app code).
>
> Best
>
> Eric
>
> --
> *From:* django-users@googlegroups.com  on
> behalf of Tom Zhang 
> *Sent:* Friday, February 8, 2019 19:59
> *To:* Django users
> *Subject:* Django template
>
> Hi,
>
> If I don't want to use any Django template and I just want to use regular
> html/javascript, how should I setup the template config in settings.py?
>
> Right now, my settings are:
>
> TEMPLATES = [
> {
> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
> 'DIRS': [os.path.join(BASE_DIR, 'templates')],
> 'APP_DIRS': True,
> 'OPTIONS': {
> 'context_processors': [
> 'django.template.context_processors.debug',
> 'django.template.context_processors.request',
> 'django.contrib.auth.context_processors.auth',
> 'django.contrib.messages.context_processors.messages',
> ],
> },
> },
> ]
>
> Thanks,
>
> 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/e88d65e8-c992-4a57-ac5b-3ed5f60dab24%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/AM0P193MB03088A4EC2AEDE3EDCE2C2BE8C6A0%40AM0P193MB0308.EURP193.PROD.OUTLOOK.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/CAAx3FUw1xTs0yRLqOAaS0A5xmGg80pJ-fPdkS79KwiCuGVeVVg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: I am newbie to Django REST,

2019-02-09 Thread Dom Delbuco
I've been watching this guys tuts, extremely solid
https://www.youtube.com/watch?v=UmljXZIypDc

On Saturday, February 2, 2019 at 8:15:27 AM UTC-5, shubham joshi wrote:
>
>  How to use cookeicutter for setting up new project?
>

-- 
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/75d9d130-1459-47bb-bd57-2635747069b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Trying to filter out choices in a form based on the logged in user.

2019-02-09 Thread GavinB841
Hi all,

If anyone could help or point me in the direction of some documentation for 
the below problem I am having I would really appreciate it.

Just to explain quickly:

   1. I have a model called "Team" which contains a foreign key to another 
   model called "Club"
   2. The "Club" model contains a foreign key to the "User" model.
   3. I have a form for the "Team" model which takes in "club_id", 
   currently it lists all the club_id for all users and I want to restrict 
   this.
   4. I am looking to find out how I can auto-populate this field "club_id" 
   based on the logged in user, which I will then hide in the form. 

Below is my forms.py

class ClubInfoForm(forms.ModelForm):
club_address2 = forms.CharField(required=False)
club_address3 = forms.CharField(required=False)

class Meta():
model = ClubInfo
fields = ('club_name', 'club_logo', 'club_address1', 'club_address2',
  'club_address3', 'club_town', 'club_county', 'club_country',)

def clean_club_name(self):
club_name = self.cleaned_data['club_name']
if ClubInfo.objects.filter(club_name=club_name).exists():
raise ValidationError(_("Club already exists"))
return club_name


class TeamForm(forms.ModelForm):

class Meta():
model = Team
fields = ('club_id', 'team_name', 'manager_name')

def __init__(self, *args, **kwargs):
super(TeamForm, self).__init__(*args, **kwargs)



models.py


class ClubInfo(models.Model):

user = models.OneToOneField(User, on_delete=models.CASCADE)
club_name = models.CharField(max_length=50, default='', unique=True)
club_logo = models.ImageField(upload_to='profile_pics', blank=True)
club_address1 = models.CharField(max_length=30)
club_address2 = models.CharField(max_length=30, default='')
club_address3 = models.CharField(max_length=30, default='')
club_town = models.CharField(max_length=30)
club_county = models.CharField(max_length=30)
club_country = models.CharField(max_length=30)
created_date = models.DateTimeField(default=timezone.now)

def __str__(self):
return self.club_name


class Team(models.Model):

club_id = models.ForeignKey(ClubInfo, on_delete=models.CASCADE)
team_name = models.CharField(max_length=30)
manager_name = models.CharField(max_length=20)


def __str__(self):
return self.team_name


-- 
__

Séanadh Ríomhphoist/_

Email Disclaimer__
**

Tá an ríomhphost seo agus 
aon chomhad a sheoltar leis faoi rún agus is lena úsáid ag an seolaí agus 
sin amháin é. Is féidir tuilleadh a léamh anseo. 
  
*
_

This e-mail and any 
files transmitted with it are confidential and are intended solely for use 
by the addressee. Read more here. 
 _
*_

-- 
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/8188ff6e-bf56-4010-9caf-90d8a294a187%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django template

2019-02-09 Thread PASCUAL Eric
Hi,

Templates are nothing more than HTML files with special tags inside. In their 
simplest form, they can be plain HTML without any templating tags and they will 
thus be rendered without any change.

In conclusion, to keep it simple and still let you the opportunity to benefit 
from templating features if ever the need arises in the future, let settings as 
they are and follow template view examples. The overhead will be minimal for 
such "static" templates since the engine provides a quite efficient 
preprocessing and caching mechanism and in any case, negligible compared to DB 
or network related stuff.

Anyway, if for any reason you do not want to keep the templating engine in the 
path at all, your views can return basic HTTP responses containing static HTML 
data, either stored as constant strings in your code (not the cleanest option) 
or, better, as resources in your project (e.g. plain files somewhere they can 
be read from the app code).

Best

Eric


From: django-users@googlegroups.com  on behalf 
of Tom Zhang 
Sent: Friday, February 8, 2019 19:59
To: Django users
Subject: Django template

Hi,

If I don't want to use any Django template and I just want to use regular 
html/javascript, how should I setup the template config in settings.py?

Right now, my settings are:

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

Thanks,

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/e88d65e8-c992-4a57-ac5b-3ed5f60dab24%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/AM0P193MB03088A4EC2AEDE3EDCE2C2BE8C6A0%40AM0P193MB0308.EURP193.PROD.OUTLOOK.COM.
For more options, visit https://groups.google.com/d/optout.