RE: Project together

2023-11-23 Thread Iwambe denen andy
Yeah it makes sense to me


On Nov 23, 2023 7:24 PM, "marvel"  wrote:

Im interested



Sent from Mail  for Windows



*From: *Denny 
*Sent: *Thursday, 23 November 2023 19:22
*To: *django-users@googlegroups.com
*Subject: *Re: Project together



Where is the link we can do together



On Thu, Nov 23, 2023, 21:13 Youssef Bachraoui 
wrote:

Hi developer i search to make a group on WhatsApp to begin a project
together anyone interested about that?



-- 
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/d5244e76-6bd3-4bde-bf31-a72720bee1acn%40googlegroups.com

.

-- 
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CAHN7osCK_-jWyK7D6Q1YySOuvyA1gTFVYAWbhL0-WZ2sC%2ByRyQ%40mail.gmail.com

.



-- 
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/C612169D-57F5-446D-8EA1-AAFFC3C24B29%40hxcore.ol

.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPBx5w%3DYjbjXUjp%3DrQmBKptvE%3DDwoiqRhZqf2BGa0FUhHLLSKA%40mail.gmail.com.


Re: How to implement visa card and debit card payment in django

2023-03-13 Thread Andy Piltser-Cowan

Do you have an account with a payment processing company?  That's the first 
step; second step is read their documentation about API access / web 
integration.
On Friday, March 10, 2023 at 10:02:58 AM UTC-5 Ntanda Aloysius wrote:

> how can I implement payment integartion in my Django ecommerce website

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/23073a7c-13db-4dba-9da2-f3e2b71ba1f8n%40googlegroups.com.


double forms

2022-05-06 Thread Andy Li
Hi I'm trying to put two forms, here is my code:
```
class FrontView(LoginRequiredMixin, UserPassesTestMixin, FormView):
template_name = "template.html"
form_class = FirstForm
coupon_form = SecondForm

def get_context_data(self, **kwargs):
kwargs['second_form'] = self.second_form
return super().get_context_data(**kwargs)
```
In the template I used {{ second_form }}. However it's not showing up.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/546d7871-29f1-4884-b84c-ecfb3599a3c5n%40googlegroups.com.


File Upload

2021-09-04 Thread Williams Andy Inc
Hi i am am trying to upload a file through a function but not the form and 
am facing difficulties 

how do i upload a file from server path without using the template form or 
forms.form

```class Image(models.Model):
name = models.CharField(max_length=40, blank=True, unique=True)
image_file = models.FileField(upload_to="images/")
created = models.DateField(auto_now_add=True)
updated = models.DateField(auto_now=True)

def __str__(self):
return self.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d6eb6033-a0a6-47ef-907d-6451f97e79f6n%40googlegroups.com.


Re: please help! not getting the desired output. how to add multiple orders via Django forms using Javascript?

2021-06-19 Thread Williams Andy Inc
Anyone interested in talking about django sharing their knowledge or path
or want to learn more?

meeting Now

https://meet.google.com/wcv-ojtf-vhi

On Sat, Jun 19, 2021 at 10:31 AM DJANGO DEVELOPER 
wrote:

> please can someone help me?
>
> On Sat, Jun 19, 2021 at 9:31 AM DJANGO DEVELOPER 
> wrote:
>
>> for convenience, please follow addorder1 to addorder5 respectively.
>>
>> On Saturday, June 19, 2021 at 9:29:48 AM UTC+5 DJANGO DEVELOPER wrote:
>>
>>> Hi guys I need urgent help. your help is appreciated.
>>> When I try to add a single order from user side then it works fine but
>>> when I try to add multiple orders at the same time then neither it updates
>>> a products price nor print all the orders on the invoice. can any one help
>>> me? screenshots attached below.
>>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/a5126278-cdf7-455c-8718-e9f0692f5ef3n%40googlegroups.com
>> 
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAKPY9pnHpB7CDXe078G2QPZZMsfJ69egDRRxAX4ijvjvNCRQyQ%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPCthNJW%3DtmAs04%3DBn7OfuyWk6CmYpBTx1du0MV4dsNLvthgBQ%40mail.gmail.com.


Re: Need to volunteer in a django project to emprove my knowledge

2021-06-18 Thread Williams Andy Inc
Today for all interested in learning together... we can have a google
meeting time is 4pm gmt  +3

DJANGO PRACTICE SESSIONS
Saturday, June 19 · 4:00 – 6:00pm
Google Meet joining info
Video call link: https://meet.google.com/wcv-ojtf-vhi

On Fri, Jun 18, 2021 at 4:08 PM Williams Andy Inc 
wrote:

> Okay for all interested then lets have a google meet video call... so we
> can set sessions...
>
> This is practically a learning project and i have learned alot from this
> and willing to learn more or teach others.
>
> please email me on swissb...@gmail.com waiting for ur emails so we can
> setup a meeting by weekend.
>
> On Fri, Jun 18, 2021 at 3:39 PM Goke Aruna  wrote:
>
>> Dear Williams
>>
>> I am interested in learning with you.
>>
>> Regarde
>>
>> On Thu, Jun 17, 2021, 1:13 PM Williams Andy Inc 
>> wrote:
>>
>>> I currently have a django project going on incase you want to learn or
>>> contribute or collaborate for learning.
>>>
>>> https://swiss-social.herokuapp.com/
>>>
>>> code https://github.com/swisscodes/social-app
>>>
>>> anyone want to learn or collaborate msg me. we could do video learning
>>> by zoom or google. can share my knowledge and learn from you
>>>
>>> On Thu, Jun 17, 2021 at 3:00 PM Nikeet NA 
>>> wrote:
>>>
>>>> OK that interesting I can help.
>>>>
>>>> On Thursday, 17 June 2021 at 17:03:28 UTC+5:30 flavie...@gmail.com
>>>> wrote:
>>>>
>>>>> Actually im not working on any django project but i was working on
>>>>> geodjango in the past
>>>>> Flavien
>>>>>
>>>>> On 6/17/21, Nikeet NA  wrote:
>>>>> > What type of project are you working upon ?
>>>>> >
>>>>> > On Thursday, 17 June 2021 at 16:51:01 UTC+5:30 flavie...@gmail.com
>>>>> wrote:
>>>>> >
>>>>> >> hi guys in term of improving my knowledge in building Django
>>>>> project,
>>>>> >> i need to be a volunteer
>>>>> >> I'm good in English and fluent in French
>>>>> >>
>>>>> >> My WhatsApp number:+243815357825 <+243%20815%20357%20825>
>>>>> <+243%20815%20357%20825>
>>>>> >> thank you so much
>>>>> >> Flavien
>>>>> >>
>>>>> >> --
>>>>> >> FLAVIEN HERI
>>>>> >>
>>>>> >> *Information management AscociateUNHCR-Kinshasa*
>>>>> >> Tél:+243978587009 <+243%20978%20587%20009>
>>>>> <+243%20978%20587%20009>
>>>>> >> Skype: flavien.heri1
>>>>> >> Facebook: flavien semi
>>>>> >>
>>>>> >
>>>>> > --
>>>>> > 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 view this discussion on the web visit
>>>>> >
>>>>> https://groups.google.com/d/msgid/django-users/12f66979-6742-4552-b09e-eec6dc9e169an%40googlegroups.com.
>>>>>
>>>>> >
>>>>>
>>>>>
>>>>> --
>>>>> FLAVIEN HERI
>>>>>
>>>>> *Information management AscociateUNHCR-Kinshasa*
>>>>> Tél:+243978587009 <+243%20978%20587%20009>
>>>>> Skype: flavien.heri1
>>>>> Facebook: flavien semi
>>>>>
>>>> --
>>>> 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 view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/django-users/6691c88c-14d5-40b1-91fe-7b8466c559a6n%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/django-users/6691c88c-14d5-40b1-91fe-7b8466c559a6n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>>

Re: Need to volunteer in a django project to emprove my knowledge

2021-06-18 Thread Williams Andy Inc
Okay for all interested then lets have a google meet video call... so we
can set sessions...

This is practically a learning project and i have learned alot from this
and willing to learn more or teach others.

please email me on swissb...@gmail.com waiting for ur emails so we can
setup a meeting by weekend.

On Fri, Jun 18, 2021 at 3:39 PM Goke Aruna  wrote:

> Dear Williams
>
> I am interested in learning with you.
>
> Regarde
>
> On Thu, Jun 17, 2021, 1:13 PM Williams Andy Inc 
> wrote:
>
>> I currently have a django project going on incase you want to learn or
>> contribute or collaborate for learning.
>>
>> https://swiss-social.herokuapp.com/
>>
>> code https://github.com/swisscodes/social-app
>>
>> anyone want to learn or collaborate msg me. we could do video learning by
>> zoom or google. can share my knowledge and learn from you
>>
>> On Thu, Jun 17, 2021 at 3:00 PM Nikeet NA 
>> wrote:
>>
>>> OK that interesting I can help.
>>>
>>> On Thursday, 17 June 2021 at 17:03:28 UTC+5:30 flavie...@gmail.com
>>> wrote:
>>>
>>>> Actually im not working on any django project but i was working on
>>>> geodjango in the past
>>>> Flavien
>>>>
>>>> On 6/17/21, Nikeet NA  wrote:
>>>> > What type of project are you working upon ?
>>>> >
>>>> > On Thursday, 17 June 2021 at 16:51:01 UTC+5:30 flavie...@gmail.com
>>>> wrote:
>>>> >
>>>> >> hi guys in term of improving my knowledge in building Django
>>>> project,
>>>> >> i need to be a volunteer
>>>> >> I'm good in English and fluent in French
>>>> >>
>>>> >> My WhatsApp number:+243815357825 <+243%20815%20357%20825>
>>>> <+243%20815%20357%20825>
>>>> >> thank you so much
>>>> >> Flavien
>>>> >>
>>>> >> --
>>>> >> FLAVIEN HERI
>>>> >>
>>>> >> *Information management AscociateUNHCR-Kinshasa*
>>>> >> Tél:+243978587009 <+243%20978%20587%20009> <+243%20978%20587%20009>
>>>> >> Skype: flavien.heri1
>>>> >> Facebook: flavien semi
>>>> >>
>>>> >
>>>> > --
>>>> > 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 view this discussion on the web visit
>>>> >
>>>> https://groups.google.com/d/msgid/django-users/12f66979-6742-4552-b09e-eec6dc9e169an%40googlegroups.com.
>>>>
>>>> >
>>>>
>>>>
>>>> --
>>>> FLAVIEN HERI
>>>>
>>>> *Information management AscociateUNHCR-Kinshasa*
>>>> Tél:+243978587009 <+243%20978%20587%20009>
>>>> Skype: flavien.heri1
>>>> Facebook: flavien semi
>>>>
>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/6691c88c-14d5-40b1-91fe-7b8466c559a6n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/6691c88c-14d5-40b1-91fe-7b8466c559a6n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAPCthNK3ZOoO77OSo6wYFatzo-Y0KPx8OD33Q5b6%3DaFgrYufVw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAPCthNK3ZOoO77OSo6wYFatzo-Y0KPx8OD33Q5b6%3DaFgrYufVw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAAsJh%3DHP13Agr9Ay-piMV5pntF-ms8A6Dh_JBCMdesALM3k6Fg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAAsJh%3DHP13Agr9Ay-piMV5pntF-ms8A6Dh_JBCMdesALM3k6Fg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPCthN%2BHpwFc6BHFCJw%2BeBhmv4QRN%2BgQ0xH7-idJ9-ctGnet5Q%40mail.gmail.com.


Re: Need to volunteer in a django project to emprove my knowledge

2021-06-17 Thread Williams Andy Inc
Communication will be difficult, I think .

On Thu, Jun 17, 2021 at 11:27 PM Luciano Martins  wrote:

> it also accepts dev BR, but I don't speak english and I use google
> translator
>
> Em quinta-feira, 17 de junho de 2021 às 14:40:43 UTC-3, swiss...@gmail.com
> escreveu:
>
>> https://github.com/swisscodes
>>
>> On Thu, Jun 17, 2021 at 5:50 PM Williams Andy Inc 
>> wrote:
>>
>>> Its open for anyone ready to participate just add me on my github or msg
>>> me here we can do some google meets or zoom ,,, for example now i want to
>>> add the edit and delete button using jquery and ajax.. so it stays on same
>>> page.
>>> we can collaborate and learn
>>>
>>> On Thu, Jun 17, 2021 at 4:05 PM Boris Pérez  wrote:
>>>
>>>> I´m intrested on participate too...is it posiible??? Thanks, Boris
>>>>
>>>> 2021-06-17 8:13 GMT-04:00, Williams Andy Inc :
>>>> > I currently have a django project going on incase you want to learn or
>>>> > contribute or collaborate for learning.
>>>> >
>>>> > https://swiss-social.herokuapp.com/
>>>> >
>>>> > code https://github.com/swisscodes/social-app
>>>> >
>>>> > anyone want to learn or collaborate msg me. we could do video
>>>> learning by
>>>> > zoom or google. can share my knowledge and learn from you
>>>> >
>>>> > On Thu, Jun 17, 2021 at 3:00 PM Nikeet NA 
>>>> wrote:
>>>> >
>>>> >> OK that interesting I can help.
>>>> >>
>>>> >> On Thursday, 17 June 2021 at 17:03:28 UTC+5:30 flavie...@gmail.com
>>>> wrote:
>>>> >>
>>>> >>> Actually im not working on any django project but i was working on
>>>> >>> geodjango in the past
>>>> >>> Flavien
>>>> >>>
>>>> >>> On 6/17/21, Nikeet NA  wrote:
>>>> >>> > What type of project are you working upon ?
>>>> >>> >
>>>> >>> > On Thursday, 17 June 2021 at 16:51:01 UTC+5:30
>>>> flavie...@gmail.com
>>>> >>> wrote:
>>>> >>> >
>>>> >>> >> hi guys in term of improving my knowledge in building Django
>>>> project,
>>>> >>> >> i need to be a volunteer
>>>> >>> >> I'm good in English and fluent in French
>>>> >>> >>
>>>> >>> >> My WhatsApp number:+243815357825 <+243%20815%20357%20825>
>>>> <+243%20815%20357%20825>
>>>> >>> <+243%20815%20357%20825>
>>>> >>> >> thank you so much
>>>> >>> >> Flavien
>>>> >>> >>
>>>> >>> >> --
>>>> >>> >> FLAVIEN HERI
>>>> >>> >>
>>>> >>> >> *Information management AscociateUNHCR-Kinshasa*
>>>> >>> >> Tél:+243978587009 <+243%20978%20587%20009>
>>>> <+243%20978%20587%20009> <+243%20978%20587%20009>
>>>> >>> >> Skype: flavien.heri1
>>>> >>> >> Facebook: flavien semi
>>>> >>> >>
>>>> >>> >
>>>> >>> > --
>>>> >>> > 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 view this discussion on the web visit
>>>> >>> >
>>>> >>>
>>>> https://groups.google.com/d/msgid/django-users/12f66979-6742-4552-b09e-eec6dc9e169an%40googlegroups.com
>>>> .
>>>> >>>
>>>> >>> >
>>>> >>>
>>>> >>>
>>>> >>> --
>>>> >>> FLAVIEN HERI
>>>> >>>
>>>> >>> *Information management AscociateUNHCR-Kinshasa*
>>>> >>> Tél:+243978587009 <+243%20978%20587%20009> <+243%20978%20587%20009>
>>>> >>> Skype: flavien.heri1
>>>>

Re: Hiring Django developers in Mumbai

2021-06-17 Thread Williams Andy Inc
Am not in india but ill like to collaborate with you so i can learn from
other developers and also add to my cv. here is my latest work.

https://swiss-social.herokuapp.com/

On Thu, Jun 17, 2021 at 10:00 PM Prasad Ajmire 
wrote:

> Interested
>
> On Sun, May 23, 2021, 9:28 AM Sidhesh D  wrote:
>
>> Hello,
>>
>> We are building a new website for kids to engage with our content and
>> showcase their projects. We are looking for a mid-level full-stack
>> developer.
>>
>>
>> Please mail your resume to care...@curiositygym.com.
>>
>> - sidhesh
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/a835a37b-a40d-4662-8ccc-c5abb8dc97f6n%40googlegroups.com
>> 
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJC%2BgnDz6P6gdnQwuX241pJsbTpzB%2BQ8Tc6%3D4YmZ5PX%2BW%2BSuxA%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPCthNJz5uDt-YLAaSzzr_ijUSN7-KmH3iM%2Bkh27AN_sNNV5ng%40mail.gmail.com.


Re: Need to volunteer in a django project to emprove my knowledge

2021-06-17 Thread Williams Andy Inc
https://github.com/swisscodes

On Thu, Jun 17, 2021 at 5:50 PM Williams Andy Inc 
wrote:

> Its open for anyone ready to participate just add me on my github or msg
> me here we can do some google meets or zoom ,,, for example now i want to
> add the edit and delete button using jquery and ajax.. so it stays on same
> page.
> we can collaborate and learn
>
> On Thu, Jun 17, 2021 at 4:05 PM Boris Pérez  wrote:
>
>> I´m intrested on participate too...is it posiible??? Thanks, Boris
>>
>> 2021-06-17 8:13 GMT-04:00, Williams Andy Inc :
>> > I currently have a django project going on incase you want to learn or
>> > contribute or collaborate for learning.
>> >
>> > https://swiss-social.herokuapp.com/
>> >
>> > code https://github.com/swisscodes/social-app
>> >
>> > anyone want to learn or collaborate msg me. we could do video learning
>> by
>> > zoom or google. can share my knowledge and learn from you
>> >
>> > On Thu, Jun 17, 2021 at 3:00 PM Nikeet NA 
>> wrote:
>> >
>> >> OK that interesting I can help.
>> >>
>> >> On Thursday, 17 June 2021 at 17:03:28 UTC+5:30 flavie...@gmail.com
>> wrote:
>> >>
>> >>> Actually im not working on any django project but i was working on
>> >>> geodjango in the past
>> >>> Flavien
>> >>>
>> >>> On 6/17/21, Nikeet NA  wrote:
>> >>> > What type of project are you working upon ?
>> >>> >
>> >>> > On Thursday, 17 June 2021 at 16:51:01 UTC+5:30 flavie...@gmail.com
>> >>> wrote:
>> >>> >
>> >>> >> hi guys in term of improving my knowledge in building Django
>> project,
>> >>> >> i need to be a volunteer
>> >>> >> I'm good in English and fluent in French
>> >>> >>
>> >>> >> My WhatsApp number:+243815357825 <+243%20815%20357%20825>
>> >>> <+243%20815%20357%20825>
>> >>> >> thank you so much
>> >>> >> Flavien
>> >>> >>
>> >>> >> --
>> >>> >> FLAVIEN HERI
>> >>> >>
>> >>> >> *Information management AscociateUNHCR-Kinshasa*
>> >>> >> Tél:+243978587009 <+243%20978%20587%20009> <+243%20978%20587%20009>
>> >>> >> Skype: flavien.heri1
>> >>> >> Facebook: flavien semi
>> >>> >>
>> >>> >
>> >>> > --
>> >>> > 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 view this discussion on the web visit
>> >>> >
>> >>>
>> https://groups.google.com/d/msgid/django-users/12f66979-6742-4552-b09e-eec6dc9e169an%40googlegroups.com
>> .
>> >>>
>> >>> >
>> >>>
>> >>>
>> >>> --
>> >>> FLAVIEN HERI
>> >>>
>> >>> *Information management AscociateUNHCR-Kinshasa*
>> >>> Tél:+243978587009 <+243%20978%20587%20009>
>> >>> Skype: flavien.heri1
>> >>> Facebook: flavien semi
>> >>>
>> >> --
>> >> 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 view this discussion on the web visit
>> >>
>> https://groups.google.com/d/msgid/django-users/6691c88c-14d5-40b1-91fe-7b8466c559a6n%40googlegroups.com
>> >> <
>> https://groups.google.com/d/msgid/django-users/6691c88c-14d5-40b1-91fe-7b8466c559a6n%40googlegroups.com?utm_medium=email&utm_source=footer
>> >
>> >> .
>> >>
>> >
>> > --
>> > 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 view this discussion on the web visit
>> >
>> https://groups.google.com/d/msgid/django-users/CAPCthNK3ZOoO77OSo6wYFatzo-Y0KPx8OD33Q5b6%3DaFgrYufVw%40mail.gmail.com
>> .
>> >
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAObPVPDK_3%2B0gmqfAt6FCpD4yAeuS1TgPcuPnvYd1E6wcZBDuw%40mail.gmail.com
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPCthNJV%3D9jEXfaM1RKywkYpE%2BONA8M1%2B9RV%3DFD6JmwNaM59hA%40mail.gmail.com.


Re: Need to volunteer in a django project to emprove my knowledge

2021-06-17 Thread Williams Andy Inc
Its open for anyone ready to participate just add me on my github or msg me
here we can do some google meets or zoom ,,, for example now i want to add
the edit and delete button using jquery and ajax.. so it stays on same page.
we can collaborate and learn

On Thu, Jun 17, 2021 at 4:05 PM Boris Pérez  wrote:

> I´m intrested on participate too...is it posiible??? Thanks, Boris
>
> 2021-06-17 8:13 GMT-04:00, Williams Andy Inc :
> > I currently have a django project going on incase you want to learn or
> > contribute or collaborate for learning.
> >
> > https://swiss-social.herokuapp.com/
> >
> > code https://github.com/swisscodes/social-app
> >
> > anyone want to learn or collaborate msg me. we could do video learning by
> > zoom or google. can share my knowledge and learn from you
> >
> > On Thu, Jun 17, 2021 at 3:00 PM Nikeet NA 
> wrote:
> >
> >> OK that interesting I can help.
> >>
> >> On Thursday, 17 June 2021 at 17:03:28 UTC+5:30 flavie...@gmail.com
> wrote:
> >>
> >>> Actually im not working on any django project but i was working on
> >>> geodjango in the past
> >>> Flavien
> >>>
> >>> On 6/17/21, Nikeet NA  wrote:
> >>> > What type of project are you working upon ?
> >>> >
> >>> > On Thursday, 17 June 2021 at 16:51:01 UTC+5:30 flavie...@gmail.com
> >>> wrote:
> >>> >
> >>> >> hi guys in term of improving my knowledge in building Django
> project,
> >>> >> i need to be a volunteer
> >>> >> I'm good in English and fluent in French
> >>> >>
> >>> >> My WhatsApp number:+243815357825 <+243%20815%20357%20825>
> >>> <+243%20815%20357%20825>
> >>> >> thank you so much
> >>> >> Flavien
> >>> >>
> >>> >> --
> >>> >> FLAVIEN HERI
> >>> >>
> >>> >> *Information management AscociateUNHCR-Kinshasa*
> >>> >> Tél:+243978587009 <+243%20978%20587%20009> <+243%20978%20587%20009>
> >>> >> Skype: flavien.heri1
> >>> >> Facebook: flavien semi
> >>> >>
> >>> >
> >>> > --
> >>> > 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 view this discussion on the web visit
> >>> >
> >>>
> https://groups.google.com/d/msgid/django-users/12f66979-6742-4552-b09e-eec6dc9e169an%40googlegroups.com
> .
> >>>
> >>> >
> >>>
> >>>
> >>> --
> >>> FLAVIEN HERI
> >>>
> >>> *Information management AscociateUNHCR-Kinshasa*
> >>> Tél:+243978587009 <+243%20978%20587%20009>
> >>> Skype: flavien.heri1
> >>> Facebook: flavien semi
> >>>
> >> --
> >> 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 view this discussion on the web visit
> >>
> https://groups.google.com/d/msgid/django-users/6691c88c-14d5-40b1-91fe-7b8466c559a6n%40googlegroups.com
> >> <
> https://groups.google.com/d/msgid/django-users/6691c88c-14d5-40b1-91fe-7b8466c559a6n%40googlegroups.com?utm_medium=email&utm_source=footer
> >
> >> .
> >>
> >
> > --
> > 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 view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/django-users/CAPCthNK3ZOoO77OSo6wYFatzo-Y0KPx8OD33Q5b6%3DaFgrYufVw%40mail.gmail.com
> .
> >
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAObPVPDK_3%2B0gmqfAt6FCpD4yAeuS1TgPcuPnvYd1E6wcZBDuw%40mail.gmail.com
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPCthNJ-85ZVDjr6Eat37t2DvKctBXv%2B0VaHRMh-pXBGnKs%3DLQ%40mail.gmail.com.


Re: Need to volunteer in a django project to emprove my knowledge

2021-06-17 Thread Williams Andy Inc
I currently have a django project going on incase you want to learn or
contribute or collaborate for learning.

https://swiss-social.herokuapp.com/

code https://github.com/swisscodes/social-app

anyone want to learn or collaborate msg me. we could do video learning by
zoom or google. can share my knowledge and learn from you

On Thu, Jun 17, 2021 at 3:00 PM Nikeet NA  wrote:

> OK that interesting I can help.
>
> On Thursday, 17 June 2021 at 17:03:28 UTC+5:30 flavie...@gmail.com wrote:
>
>> Actually im not working on any django project but i was working on
>> geodjango in the past
>> Flavien
>>
>> On 6/17/21, Nikeet NA  wrote:
>> > What type of project are you working upon ?
>> >
>> > On Thursday, 17 June 2021 at 16:51:01 UTC+5:30 flavie...@gmail.com
>> wrote:
>> >
>> >> hi guys in term of improving my knowledge in building Django project,
>> >> i need to be a volunteer
>> >> I'm good in English and fluent in French
>> >>
>> >> My WhatsApp number:+243815357825 <+243%20815%20357%20825>
>> <+243%20815%20357%20825>
>> >> thank you so much
>> >> Flavien
>> >>
>> >> --
>> >> FLAVIEN HERI
>> >>
>> >> *Information management AscociateUNHCR-Kinshasa*
>> >> Tél:+243978587009 <+243%20978%20587%20009> <+243%20978%20587%20009>
>> >> Skype: flavien.heri1
>> >> Facebook: flavien semi
>> >>
>> >
>> > --
>> > 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 view this discussion on the web visit
>> >
>> https://groups.google.com/d/msgid/django-users/12f66979-6742-4552-b09e-eec6dc9e169an%40googlegroups.com.
>>
>> >
>>
>>
>> --
>> FLAVIEN HERI
>>
>> *Information management AscociateUNHCR-Kinshasa*
>> Tél:+243978587009 <+243%20978%20587%20009>
>> Skype: flavien.heri1
>> Facebook: flavien semi
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/6691c88c-14d5-40b1-91fe-7b8466c559a6n%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPCthNK3ZOoO77OSo6wYFatzo-Y0KPx8OD33Q5b6%3DaFgrYufVw%40mail.gmail.com.


Re: Working with forms

2021-06-15 Thread Williams Andy Inc
for now reason its now showing up thanks.   i guess i needed to do hard
refresh with f5 although i was using {% now "U" %}

On Tue, Jun 15, 2021 at 10:10 AM Williams Andy Inc 
wrote:

> class LoginForm(forms.Form):
> username = forms.CharField(
> label="Email or Username",
> widget=forms.TextInput(
> attrs={
> "class": "fas fa-user",
> "placeholder": "f007 Username or Email",
> }
> ),
> ) the class is not showing up but the placeholder shows up without the
> f007
>
> On Tue, Jun 15, 2021 at 10:04 AM Williams Andy Inc 
> wrote:
>
>> Thanks am already trying that,   and using that works for
>> adding placeholder, but then it doesn't add a class,  if it could add i
>> class i could use the font awesome unicode which would have been the
>> easiest solution.
>>
>> On Tue, Jun 15, 2021 at 9:53 AM Lalit Suthar 
>> wrote:
>>
>>> you can try if it can be done with widgets I am not sure
>>> https://docs.djangoproject.com/en/2.2/ref/forms/widgets/
>>>
>>> On Tue, 15 Jun 2021 at 11:24, Williams Andy Inc 
>>> wrote:
>>>
>>>> I would like to know is there any easier way rather than overriding
>>>> super, how do i add icons into the html input eg to have a key icon on the
>>>> password field
>>>>
>>>> without installing any third party app also.
>>>>
>>>> is the best solution to render form in html and pass field values to
>>>> django? or is there anyway to manipulate django and insert a text between
>>>> input
>>>>
>>>>
>>>> django has this
>>>> >>> id="id_email">
>>>>
>>>>
>>>> i want to have this
>>>> >>> id="id_email" >
>>>>
>>>> --
>>>> 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 view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/django-users/946421cf-4abf-45cd-b40c-f3639203b43bn%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/django-users/946421cf-4abf-45cd-b40c-f3639203b43bn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAGp2JVHRMgxFF9km7%3D5eQP8wDi3ePuOveyN3vkjJj1hRL0BVJA%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAGp2JVHRMgxFF9km7%3D5eQP8wDi3ePuOveyN3vkjJj1hRL0BVJA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPCthNJozPG4hNQqN3T-%2B8ALF2rU8k-BVwW%3D54x%3DrFnX4h6kMQ%40mail.gmail.com.


Re: Working with forms

2021-06-15 Thread Williams Andy Inc
class LoginForm(forms.Form):
username = forms.CharField(
label="Email or Username",
widget=forms.TextInput(
attrs={
"class": "fas fa-user",
"placeholder": "f007 Username or Email",
}
),
) the class is not showing up but the placeholder shows up without the
f007

On Tue, Jun 15, 2021 at 10:04 AM Williams Andy Inc 
wrote:

> Thanks am already trying that,   and using that works for
> adding placeholder, but then it doesn't add a class,  if it could add i
> class i could use the font awesome unicode which would have been the
> easiest solution.
>
> On Tue, Jun 15, 2021 at 9:53 AM Lalit Suthar 
> wrote:
>
>> you can try if it can be done with widgets I am not sure
>> https://docs.djangoproject.com/en/2.2/ref/forms/widgets/
>>
>> On Tue, 15 Jun 2021 at 11:24, Williams Andy Inc 
>> wrote:
>>
>>> I would like to know is there any easier way rather than overriding
>>> super, how do i add icons into the html input eg to have a key icon on the
>>> password field
>>>
>>> without installing any third party app also.
>>>
>>> is the best solution to render form in html and pass field values to
>>> django? or is there anyway to manipulate django and insert a text between
>>> input
>>>
>>>
>>> django has this
>>> >> id="id_email">
>>>
>>>
>>> i want to have this
>>> >> id="id_email" >
>>>
>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/946421cf-4abf-45cd-b40c-f3639203b43bn%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/946421cf-4abf-45cd-b40c-f3639203b43bn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAGp2JVHRMgxFF9km7%3D5eQP8wDi3ePuOveyN3vkjJj1hRL0BVJA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAGp2JVHRMgxFF9km7%3D5eQP8wDi3ePuOveyN3vkjJj1hRL0BVJA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPCthN%2BOcUujz0BV2RbgC5a%3DDc4YY%3D4H3HOPpW%3DcpOshNvLYuA%40mail.gmail.com.


Re: Working with forms

2021-06-15 Thread Williams Andy Inc
Thanks am already trying that,   and using that works for
adding placeholder, but then it doesn't add a class,  if it could add i
class i could use the font awesome unicode which would have been the
easiest solution.

On Tue, Jun 15, 2021 at 9:53 AM Lalit Suthar 
wrote:

> you can try if it can be done with widgets I am not sure
> https://docs.djangoproject.com/en/2.2/ref/forms/widgets/
>
> On Tue, 15 Jun 2021 at 11:24, Williams Andy Inc 
> wrote:
>
>> I would like to know is there any easier way rather than overriding
>> super, how do i add icons into the html input eg to have a key icon on the
>> password field
>>
>> without installing any third party app also.
>>
>> is the best solution to render form in html and pass field values to
>> django? or is there anyway to manipulate django and insert a text between
>> input
>>
>>
>> django has this
>> 
>>
>>
>> i want to have this
>> > >
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/946421cf-4abf-45cd-b40c-f3639203b43bn%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/946421cf-4abf-45cd-b40c-f3639203b43bn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAGp2JVHRMgxFF9km7%3D5eQP8wDi3ePuOveyN3vkjJj1hRL0BVJA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAGp2JVHRMgxFF9km7%3D5eQP8wDi3ePuOveyN3vkjJj1hRL0BVJA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPCthN%2BZdCPAv48%3DkW%3DV3xRSgo6h_ku-K5xW0%3Dg45-pZwn6kGg%40mail.gmail.com.


Working with forms

2021-06-14 Thread Williams Andy Inc
I would like to know is there any easier way rather than overriding super, 
how do i add icons into the html input eg to have a key icon on the 
password field 

without installing any third party app also.

is the best solution to render form in html and pass field values to 
django? or is there anyway to manipulate django and insert a text between 
input


django has this



i want to have this
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/946421cf-4abf-45cd-b40c-f3639203b43bn%40googlegroups.com.


Re: Django request.session persist between logins of different users.

2021-06-08 Thread Williams Andy Inc
Did you have your own logout function view or class view?


On Tue, Jun 8, 2021 at 9:17 AM Mateusz Wasielewski <
mateusz.wasielewsk...@gmail.com> wrote:

> Hello,
> I want to implement two factor authetication in my django app. The steps
> are as follows:
> 1. User need to register
> 2. User need to login
> 3. As login user, user need to send a token for verification, if
> verification is ok, I set the variable like this
> request.session['token']=True.
>
> I have a problem cause when I login as different users this session
> variable is still set to true. I am probably missing something, I assume
> that request.session is per user not per whole app.
>
> Best regard
> Mateusz Wasielewski
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8af41ff9-f313-4d2e-bd12-4e113f531e1bn%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPCthNK4Cq%3Dt3s9JU8yaa1UCWyWH4nY30o-%3D4Oj0XYAWdRphZQ%40mail.gmail.com.


Suggestions for update

2021-06-08 Thread Williams Andy Inc
Hi and thanks to everyone, I have a few opinions and suggestions I would 
like to talk about which if possible I would also be part of contributors.

We are all Django users, there are many professionals here and also there 
are beginners and learners too, like myself a learner too. 

I am on a discord server for Django lots of questions get asked and 
answered and could be saved a part of DRY but people find it hard to search 
through a large Disord disorganized list or history of discussion, so the 
same questions are being asked over and over again.

The suggestions are 
1. this Google group is great but feels a little bit outdated for such a 
wonderful community, so we could keep this group going on but have a page 
dedicated to this group and many all topics about Django from other servers 
or sites on the internet like the official Django community forum.

2. Each Question being asked on here could be posted to the blog or page by 
a script or anything you call it that gets it posted to the blog or 
website. we could take advantage of the elastic search or Postgres 
functions for search.

3. this should be an open-source project that everyone can contribute to, I 
brought this topic here because there are tons of things out there about 
Django that people has no information about

4. there are tons of Django related javascript that we Django developers 
all write which we can basically have a dedicated section or and advice on 
what steps to use or follow based on what case and share best javascript 
libraries or tools to make our life's easier. and make Django more 
beautiful.

thank you.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/50f5728e-2b04-45a2-bb4c-afef3c8b86e1n%40googlegroups.com.


Re: Using Countries with django

2021-06-07 Thread Williams Andy Inc
thank you very much

On Mon, Jun 7, 2021 at 7:13 PM dupakoor kannan 
wrote:

> Hi,
>
> Here is the list https://djangopackages.org/grids/g/countries/.
>
> Hope this helps
>
> Kannan
>
> On Sun, Jun 6, 2021 at 4:22 PM Williams Andy Inc 
> wrote:
>
>> Can anyone recommend a 3rd party app to me to use with forms form
>> countries and states and cities of the world ..
>>
>> thank you
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/beb5a5d0-83c3-4b37-b5d2-1acaf758cb8en%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/beb5a5d0-83c3-4b37-b5d2-1acaf758cb8en%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CADiZb_e60CmrV2WSBJdGiq8y-3XKoPTJcT4x1o1fciRVzx_b-g%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CADiZb_e60CmrV2WSBJdGiq8y-3XKoPTJcT4x1o1fciRVzx_b-g%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPCthNK0bnBwjOr305Cs8C_93Go1V0%2BKrQdacSUgHMWx86nKgw%40mail.gmail.com.


Using Countries with django

2021-06-06 Thread Williams Andy Inc
Can anyone recommend a 3rd party app to me to use with forms form countries 
and states and cities of the world ..

thank you

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/beb5a5d0-83c3-4b37-b5d2-1acaf758cb8en%40googlegroups.com.


Re: Django/uWSGI/nginx under load

2021-02-20 Thread Andy Robinson
I'm unsure what you mean - do you mean "are we executing raw SQL queries 
and a Python db api, or using Django's ORM?"   If so, usually the latter 
but this is definitely not a problem of poorly written queries, we've 
profiled them.

- Andy

On Saturday, 20 February 2021 at 17:44:45 UTC jmccla...@gmail.com wrote:

> are you using django directly to run the queries or are you querying the 
> db. I had a similar problem a while back with a project and the load was 
> resolved by letting python do the work.
>
>
>
> On Sat, 20 Feb 2021 at 15:23, Andy Robinson  wrote:
>
>> Hi all,
>>
>> We're maintaining an application that is hitting scaling problems.   It 
>> helps run grass-roots sporting events all over Europe, so Saturdays can 
>> produce large and unpredictable loads, with both logged-in users and public 
>> viewers. Despite a powerful server seemingly being lightly loaded (htop 
>> suggests just 3-6 out of24 cores typically busy, and free memory 
>> available), it often "hangs" for long periods - simple requests return 
>> after 10sec, and at times we have had to restart nginx.   
>>
>> If anyone here has experience of this configuration under high loads, 
>> we'd be keen to hire an experienced expert to review and check we are not 
>> doing anything stupid with our nginx or uwsgi configuration.  
>>
>> Likewise, if you really know how to cache Django with nginx, and work 
>> around the various cookies and language settings so that logged-in pages 
>> still work but anonymous ones can be cached, we'd love to get a bit of 
>> help  
>>
>> Architecture is ubuntu 18.04, Django 3.0.12, with MariaDB and Mongo back 
>> ends used for slightly different things.
>>
>> Feel free to contact me by private email if you,
>>
>> Otherwise, if people have suggestions and questions here, I'll try to 
>> share what I can and am very grateful for any help...
>>
>> Best Regards
>>
>>
>> Andy Robinson
>>  
>>
>> -- 
>>
> 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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/4fcc006e-37bb-4497-a692-45dfb99bfad1n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/4fcc006e-37bb-4497-a692-45dfb99bfad1n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
>
> -- 
> John McClain
>
> Cell: 085-1977-823
> Skype: jmcclain0129
> Email: jmccla...@gmail.com
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1aa1c853-8028-4f58-8c40-bf966caa5e56n%40googlegroups.com.


Re: Django/uWSGI/nginx under load

2021-02-20 Thread Andy Robinson
Thanks for this.  27k file descriptors out of about 370k allowed.  I 
presume that means this isn't a problem?

(We run a lot of different virtual hosts on this box, each with a few 
Django processes)

- Andy
On Saturday, 20 February 2021 at 16:15:12 UTC mob...@aldian.net wrote:

> Check the number of open file descriptor when you experienced the slow 
> response.
>
> On Sat, Feb 20, 2021 at 10:23 PM Andy Robinson  
> wrote:
>
>> Hi all,
>>
>> We're maintaining an application that is hitting scaling problems.   It 
>> helps run grass-roots sporting events all over Europe, so Saturdays can 
>> produce large and unpredictable loads, with both logged-in users and public 
>> viewers. Despite a powerful server seemingly being lightly loaded (htop 
>> suggests just 3-6 out of24 cores typically busy, and free memory 
>> available), it often "hangs" for long periods - simple requests return 
>> after 10sec, and at times we have had to restart nginx.   
>>
>> If anyone here has experience of this configuration under high loads, 
>> we'd be keen to hire an experienced expert to review and check we are not 
>> doing anything stupid with our nginx or uwsgi configuration.  
>>
>> Likewise, if you really know how to cache Django with nginx, and work 
>> around the various cookies and language settings so that logged-in pages 
>> still work but anonymous ones can be cached, we'd love to get a bit of 
>> help  
>>
>> Architecture is ubuntu 18.04, Django 3.0.12, with MariaDB and Mongo back 
>> ends used for slightly different things.
>>
>> Feel free to contact me by private email if you,
>>
>> Otherwise, if people have suggestions and questions here, I'll try to 
>> share what I can and am very grateful for any help...
>>
>> Best Regards
>>
>>
>> Andy Robinson
>>  
>>
>> -- 
>> 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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/4fcc006e-37bb-4497-a692-45dfb99bfad1n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/4fcc006e-37bb-4497-a692-45dfb99bfad1n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
>
> -- 
> Regards,
>
> Aldian Fazrihady
> http://aldianfazrihady.com
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c2093676-90f5-4e69-b646-868102361d18n%40googlegroups.com.


Django/uWSGI/nginx under load

2021-02-20 Thread Andy Robinson
Hi all,

We're maintaining an application that is hitting scaling problems.   It 
helps run grass-roots sporting events all over Europe, so Saturdays can 
produce large and unpredictable loads, with both logged-in users and public 
viewers. Despite a powerful server seemingly being lightly loaded (htop 
suggests just 3-6 out of24 cores typically busy, and free memory 
available), it often "hangs" for long periods - simple requests return 
after 10sec, and at times we have had to restart nginx.   

If anyone here has experience of this configuration under high loads, we'd 
be keen to hire an experienced expert to review and check we are not doing 
anything stupid with our nginx or uwsgi configuration.  

Likewise, if you really know how to cache Django with nginx, and work 
around the various cookies and language settings so that logged-in pages 
still work but anonymous ones can be cached, we'd love to get a bit of 
help  

Architecture is ubuntu 18.04, Django 3.0.12, with MariaDB and Mongo back 
ends used for slightly different things.

Feel free to contact me by private email if you,

Otherwise, if people have suggestions and questions here, I'll try to share 
what I can and am very grateful for any help...

Best Regards


Andy Robinson
 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4fcc006e-37bb-4497-a692-45dfb99bfad1n%40googlegroups.com.


CockroachDB & Django

2019-07-08 Thread &#x27;Andy Woods' via Django users
Hello All! 

I'm a product manager at Cockroach Labs 
<https://github.com/cockroachdb/cockroach/> working on our SQL product 
area. CockroachDB leverages the Postgres wire protocol to provide 
distributed SQL to our customers. Because we support the same protocol as 
Postgres, we can often take advantage of the drivers, ORMs, and tools 
already created for Postgres with CockroachDB. 

Over the years we've seen community interest 
<https://github.com/cockroachdb/cockroachdb-python/pull/14> in making a 
CockroachDB specific implementation of Django. In fact, one of our 
engineers even went so far as to build a working prototype 
<https://github.com/cockroachlabs/cockroach-django> that passes the initial 
Django tutorial. 

We are now seeking help from experts in the Django community in advancing 
our prototype to the next level. We would happily welcome contributors to 
our open-source Django prototype. 

We'd also love any beta testers who would be willing to give our prototype 
a try and provide feedback to us.

If this is something you might be interested in, please let me know.

Thank you! 

Andy

a...@cockroachlabs.com

-- 
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/816723fc-bae9-46a3-adce-31cd0f5b40e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is Django and DjangoRestAPI's the correct framework for my project?

2018-11-22 Thread Andy Gardner
Essentially I want to end up with a set of API's that will send a JSON 
encoded request along with data parameters to a middleware process and pass 
out the returning JSON encoded replies, either as a single string or a set 
of extracted data parameters. I have about 50+ CLI calls to represent in 
this way, so I was thinking of representing each call eg. create_user, 
login, logout, delete_user, run_emulation, change this emulation parameter 
etc, with an app or single api call. It doesn't have to be using the Django 
framework - if there is a more appropriate one that will allow me to 
produce a set of Restful API's to complete this, then I am open to 
suggestions on that front as well - it just so happens I started with 
Django and why I'm querying whether it's the right way to go, and if so, 
how do I implement it (presumably I don't need to create a model, but I 
probably need to set up a view and a serializer?)

Andy

On Thursday, 22 November 2018 17:06:12 UTC, Tim Vogt wrote:
>
> What problem are you trying to solve?
> What reason do You use djanfo now for?
>
> And what do You want with the json?
> Stored? Displayed? Or put trough as other apps might use the data?
> Tim
>
>
> Verstuurd vanaf mijn iPhone
>
> Op 22 nov. 2018 om 16:40 heeft Andy Gardner  > het volgende geschreven:
>
> I am new to Django, Python and Rest API's and have been learning it over 
> the last few weeks with a view to generating REST API's to control an 
> engine process.
>
> Currently I have an engine process running in the background, and a python 
> based test harness, which takes JSON encoded requests containing the 
> command and the data parameters. I currently use a simple command line to 
> write the JSON encoded requests and I get back JSON encoded replies, eg. I 
> send a login request to the backend process and I get a session id back 
> from it, which then has to be passed in subsequent engine requests.
>
> I have worked my way through William S Vincent's books for a beginner's 
> guide to Django and the follow-up Rest API's and I can see how quick and 
> useful the Django framework is for mocking up web pages and all the work 
> behind it to display, but it seems that all the examples are database based 
> and displaying of the contents all self-contained, which is not what I want 
> to do.
>
> I want to be able to create an API that sends requests to my test harness 
> (eventually this will be replaced with a proper middleware process but 
> doing the same sort of thing) and handles the replies. I was thinking along 
> the lines of creating an app per CLI call (ie. command request to test 
> harness), so I do not see any need for an underlying database or storage of 
> data as the API will eventually be used by an existing GUI that I will be 
> supplying the API's to. Neither can I really use the Django login framework 
> and authentication as I need to interact with the login mechanism with the 
> backend process ie the backend process needs to hold information on any 
> requests to create users and when those users login supply session id - the 
> backend process needs to work for many users in parallel).
>
> So my question is, is Django the right framework for what I want to do, or 
> should I be looking at a different framework, can I write Rest API's that 
> send JSON encoded command and parameter data requests and get back JSON 
> encoded responses from my engine process? If the answer to the last 
> question is yes, can someone give me an example on how I write that using 
> Django ie. do I not bother with a model, but just serialize a set of fields 
> to represent the command and the data parameters for that request the app 
> represents? Instead of using framework .as_view() functions etc do I write 
> my own messaging function or does the framework actually have something 
> already to do this kind of thing?
>
> Thanks in advance for answers/suggestions etc?
>
> Andy
>
>
> CONFIDENTIALITY NOTICE: This e-mail transmission and/or any attachments 
> may contain confidential information belonging to the sender. Any
>  unauthorised interception of this transmission is illegal under the law. 
> If you have received this transmission in error, please promptly notify the 
> sender by reply e-mail, and then destroy all copies of the transmission.
>
> -- 
> 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

Is Django and DjangoRestAPI's the correct framework for my project?

2018-11-22 Thread Andy Gardner
I am new to Django, Python and Rest API's and have been learning it over 
the last few weeks with a view to generating REST API's to control an 
engine process.

Currently I have an engine process running in the background, and a python 
based test harness, which takes JSON encoded requests containing the 
command and the data parameters. I currently use a simple command line to 
write the JSON encoded requests and I get back JSON encoded replies, eg. I 
send a login request to the backend process and I get a session id back 
from it, which then has to be passed in subsequent engine requests.

I have worked my way through William S Vincent's books for a beginner's 
guide to Django and the follow-up Rest API's and I can see how quick and 
useful the Django framework is for mocking up web pages and all the work 
behind it to display, but it seems that all the examples are database based 
and displaying of the contents all self-contained, which is not what I want 
to do.

I want to be able to create an API that sends requests to my test harness 
(eventually this will be replaced with a proper middleware process but 
doing the same sort of thing) and handles the replies. I was thinking along 
the lines of creating an app per CLI call (ie. command request to test 
harness), so I do not see any need for an underlying database or storage of 
data as the API will eventually be used by an existing GUI that I will be 
supplying the API's to. Neither can I really use the Django login framework 
and authentication as I need to interact with the login mechanism with the 
backend process ie the backend process needs to hold information on any 
requests to create users and when those users login supply session id - the 
backend process needs to work for many users in parallel).

So my question is, is Django the right framework for what I want to do, or 
should I be looking at a different framework, can I write Rest API's that 
send JSON encoded command and parameter data requests and get back JSON 
encoded responses from my engine process? If the answer to the last 
question is yes, can someone give me an example on how I write that using 
Django ie. do I not bother with a model, but just serialize a set of fields 
to represent the command and the data parameters for that request the app 
represents? Instead of using framework .as_view() functions etc do I write 
my own messaging function or does the framework actually have something 
already to do this kind of thing?

Thanks in advance for answers/suggestions etc?

Andy

-- 





CONFIDENTIALITY NOTICE: This e-mail transmission and/or any 
attachments may contain confidential information belonging to the sender. 
Any unauthorised interception of this transmission is illegal under the 
law. If you have received this transmission in error, please promptly 
notify the sender by reply e-mail, and then destroy all copies of the 
transmission.

-- 
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/14cea50a-dd1c-4746-9547-7a71a2e146e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to clean a model after the related models inline forms have been saved?

2018-08-26 Thread Andy
Please forget about the persisting data part. 
The problem is that inside the parent form i dont have access to the 
related data and the formsets new related data is validated after the 
parent models data.
Inside the formset every related data model does not have access to the 
other related instances.

I want to have additional validation after all data on the admin page has 
been processed .. not necessarily saved into the database, but i need some 
way of doing additional validation after the basic stuff has been taken 
care of by the admin and its form.



Am Sonntag, 26. August 2018 18:44:17 UTC+2 schrieb Jason:
>
> I still don't understand why you want to persist unvalidated data to the 
> db then?  if a user requests the data in mid-update, that's something that 
> can be handled with transaction locks on the db.  so when that happens, the 
> request will wait till the locks are released before executing the db query
>
>
> https://stackoverflow.com/questions/42520917/does-django-atomic-transaction-lock-the-database
>

-- 
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/6aa2f0c1-eb89-46fa-8b19-6d4a6927405b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to clean a model after the related models inline forms have been saved?

2018-08-26 Thread Andy


Am Sonntag, 26. August 2018 18:29:49 UTC+2 schrieb Jason:
>
> I think we're missing a few things.  how fast does this query with updated 
> values execute after the form submits? 
>

a neglectable amount of milliseconds
 

> if you need to return the value back to the view, can't you do some sort 
> of post-save retrieval and form populate?
>

No i dont want to return anything but a possible validation error based on 
all related objects new data. 
I probably see myself rewriting the changeform_view and manually adding the 
error the the forms non field errors, unless somebody comes up with a more 
clever idea.

-- 
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/1d2f8a9e-57f3-4d67-83b7-6f6f6a0cf9ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to clean a model after the related models inline forms have been saved?

2018-08-26 Thread Andy


Am Sonntag, 26. August 2018 18:07:25 UTC+2 schrieb Jason:
>
> why would you want to persist unvalidated data to your db?
>
>>
>>
Well, i dont necessarily have to, but i somehow need to be able to perform 
a query with all updated data taken into account. The easiest solution i 
came up with is putting everything into the DB while in transaction so i 
could perform my queries and rollback if the checks dont work out. 

Im open to any other ideas.
And is there a prepared admin function that is suitable for validation 
logic after related objects are validated?
I might also just write some validation data to the parent while executing 
the formet validation and so i could verify my parent validation against 
this extra data even without additional queries against the DB.

So far i just see that the changeform_view handles object and formset 
validation without any way of interfering (other than rewriting that view 
logic).

-- 
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/2f46c2d4-a628-4571-8f23-9607125d462b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to clean a model after the related models inline forms have been saved?

2018-08-26 Thread Andy
I want to execute a check after the related data from the admin has been 
saved, but the default clean methods get executed before the formsets are 
saved. Where could i place my check to have access to a full version of 
what has been changed on the admin 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/0623c315-eed4-407a-9166-7fc66910adeb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django and Fullcalendar.

2018-05-01 Thread Andy Grabow
Okay, then strip your template until you understand what’s happening.



Elias Coutinho  schrieb am Mo. 30. Apr. 2018 um
22:29:

> No error, it returns a template full of cluttered tags.
>
> 2018-04-28 2:41 GMT-03:00 Andy :
>
>> What kind of error are you getting?
>>
>> --
>> 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/ALIFMqCPCz0/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/f157cd20-7ddd-4692-aa66-9ca028fb143a%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/f157cd20-7ddd-4692-aa66-9ca028fb143a%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Elias Coutinho.
> Aprender sobre alguns assuntos é fundamental.
> Aprender sobre Deus é indiscutivelmente o melhor conteúdo.
>
> --
> 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/ALIFMqCPCz0/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/CALgom8pGb9J%2BEzByYrs-fbnf4GUhHW9-R4BkQcpp_HE1bxNLZw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CALgom8pGb9J%2BEzByYrs-fbnf4GUhHW9-R4BkQcpp_HE1bxNLZw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 

Mit besten Grüßen
Andy

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


Re: django does not open html file properly

2018-05-01 Thread Andy Grabow
Like I said: setup an nginx docker and save the reports in its base folder.
Then link there from your Django app. Save yourself trouble of zipping,
downloading unzipping and manually opening the reports!

qop  schrieb am Mo. 30. Apr. 2018 um 16:07:

> You are right, it's too complicated.
> I could zip gephi's graphics and make them downloadable on my site, how
> could i do that?
> How can i create a "download button" that allows the user to download my
> zip files?
>
> Il giorno venerdì 27 aprile 2018 23:24:43 UTC+2, Andy ha scritto:
>>
>> It looks as if you see all contents of you index.html while also missing
>> all dependencies .. check the network tab of your browser to confirm this.
>> The report created by gephi is probably an html page that is soppused to
>> be opened via the browser directly or served with a webserver. Just
>> rendering the page through Django wont fix included styles sheets of needed
>> javascript tags.
>>
>> You should setup a docker nginx, mount your report into its html root
>> folder and link there from your django app.
>> What you are trying to do sounds to complicated. Dont try to push the
>> reports through Django. You might rather build a catalogue listing all the
>> reports, but for actually showing them, use an nginx docker.
>>
> --
> 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/aWDr0VYIj-4/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/265f121b-d7e2-4517-a6d9-199ca7ed6d4f%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/265f121b-d7e2-4517-a6d9-199ca7ed6d4f%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 

Mit besten Grüßen
Andy

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


Re: Django and Fullcalendar.

2018-04-27 Thread Andy
What kind of error are you getting?

-- 
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/f157cd20-7ddd-4692-aa66-9ca028fb143a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django does not open html file properly

2018-04-27 Thread Andy
It looks as if you see all contents of you index.html while also missing 
all dependencies .. check the network tab of your browser to confirm this.
The report created by gephi is probably an html page that is soppused to be 
opened via the browser directly or served with a webserver. Just rendering 
the page through Django wont fix included styles sheets of needed 
javascript tags.

You should setup a docker nginx, mount your report into its html root 
folder and link there from your django app.
What you are trying to do sounds to complicated. Dont try to push the 
reports through Django. You might rather build a catalogue listing all the 
reports, but for actually showing them, use an nginx docker.

-- 
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/7b33a09a-5ca9-4082-8773-4eac89b1c5a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


is that really not possible with the Django ORM?

2018-04-27 Thread Andy
In my 10 years playing with Django i found a few bugs, but i never had to 
fall back to a raw SQL query. Fiddling with Django for almost a full day 
now im out of ideas except of asking for help here:

I have an organizer app with days containing shifts and people working 
those shifts (M2M). There also are supervisors for each day that are 
directly stored on the day (M2M). For the user stats i want to see who has 
how many shifts. For speed reasons i WANT to handle this with only one 
query. Here is the query i started with:

assigned_to = self.shifts.filter(day_id=OuterRef('id')).order_by()
days = Day.data.filter(date__range=(start, end)).distinct().annotate(
assigned_shifts=Count(
Subquery(assigned_to.values('id'))
)).annotate(
assigned_pl=Max(Case(
When(production_managers=self, then=1),
default=0, output_field=models.IntegerField(),
distinct=True
))).annotate(
assigned_tl=Max(Case(
When(day_managers=self, then=1),
default=0, output_field=models.IntegerField(), distinct=True
))).annotate(
assigned_al=Max(Case(
When(managers=self, then=1),
default=0, output_field=models.IntegerField(), distinct=True
))).annotate(
assigned_cash=Max(Case(
When(cash_managers=self, then=1),
default=0, output_field=models.IntegerField(), distinct=True
))).order_by()


This is giving me an SQL error "more than one row returned by a subquery 
used as an expression", without the subquery i was getting false values - 
probably because the grouping didnt work out as its supposed to. Turns out 
there is a warning in the docs and a very old ticket 
(https://code.djangoproject.com/ticket/10060) warning about this exact 
scenario, but somehow i dont get the subquery to work like it should.

The final and a lil simplified SQL looks like this:

days = Day.data.raw("""
SELECT distinct
  "events_day"."id","events_day"."date",
  (select count(*) 
   from events_shift 
   left outer join events_shift_employees 
   on events_shift_employees.shift_id = events_shift.id 
   where events_shift_employees.user_id = {user_id} and 
   events_shift.day_id = events_day.id and 
   events_shift.deleted is null) AS "assigned_shifts",
  Max(CASE WHEN"events_day_production_managers"."user_id"={user_id} THEN 1 
ELSE 0 END)AS"assigned_pl",
  Max(CASE WHEN"events_day_day_managers"."user_id"={user_id} THEN 1 ELSE 0 
END)AS"assigned_tl",
  Max(CASE WHEN"events_day_managers"."user_id"={user_id} THEN 1 ELSE 0 
END)AS"assigned_al",
  max(CASE WHEN"events_day_cash_managers"."user_id"={user_id} THEN 1 ELSE 0 
END)AS"assigned_cash"
FROM"events_day"
LEFT JOIN"events_shift"ON("events_day"."id"="events_shift"."day_id")
LEFT 
JOIN"events_shift_employees"ON("events_shift"."id"="events_shift_employees"."shift_id")
LEFT 
JOIN"events_day_production_managers"ON("events_day"."id"="events_day_production_managers"."day_id")
LEFT 
JOIN"events_day_day_managers"ON("events_day"."id"="events_day_day_managers"."day_id")
LEFT 
JOIN"events_day_managers"ON("events_day"."id"="events_day_managers"."day_id")
LEFT 
JOIN"events_day_cash_managers"ON("events_day"."id"="events_day_cash_managers"."day_id")
WHERE("events_day"."deleted"IS NULL AND"events_day"."date" BETWEEN 
'{start}' AND '{end}')
GROUP BY "events_day"."id"
ORDER BY"events_day"."date"DESC
""".format(**{
'user_id': self.id,
'start': start,
'end': end
}))



I could need a lil hand here in achiving the SELECT COUNT(*) in line 4 
rather then the Count(Subquery()) Django allows me to add to the query, but 
produces an SQL error.

Im Working on Python 3.6.5, Django 2.0.3 and Postgres 10

This problem is hardcore SQL ORM stuff so THX for anyone looking into this.

-- 
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/816185ac-58eb-4f71-986c-04ac34e22e02%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Login with email address, mobile number or username.

2018-04-19 Thread Andy
Firt of all you should start with you own user model because changing it 
afterwards is not that easy like stated in the docs.
>From there you can change the username restrictions to your liking and 
implement the cell_phone field.

Then implement you own version of ModelBackend which is also checking email 
and cell phone.
In case you just want to allow email, you can also switch to that with just 
changing a setting: 
https://docs.djangoproject.com/en/2.0/topics/auth/customizing/#django.contrib.auth.models.CustomUser.USERNAME_FIELD


Am Donnerstag, 19. April 2018 13:18:02 UTC+2 schrieb lakshitha kumara:
>
> Hello Guys ,
>
> what is the best way to implement Login with email address, mobile number 
> or username. all those field save as a different field in user table. user 
> can login with any criteria that user provided to registered. its look like 
> how instagram.com does it. i need know what is the best way to implement 
> this. Username field cant include '@' sign and username should be letter, 
> number and '_' .
>
> 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/cd196388-a59e-4f02-a20e-c1bc8211a1d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


cors and images via dj-static

2018-04-19 Thread Andy
Hi, is there a way to serve media files via dj-static with the addition of 
CORS headers?


-- 
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/2df21cca-e03e-4e83-a0e6-55961af71213%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: sharing sessions

2018-03-19 Thread Andy
okay, i made it work like it already should have before my posting .. if 
only there was no typo in my secret key and askbot was not setting the 
session serializer to PickleSerializer

Works great now!

Am Montag, 19. März 2018 12:39:16 UTC+1 schrieb Andy:
>
> I want to have some sort of SingleSignOn for my application and a forum 
> based on askbot (also Django).
> I built a REST API to get the session from my application and want to 
> replicated and also get the user from inside askbot.
>
> This kind of works, but i cannot decode the session inside the forum.
> AFAIK Django uses the settings.SECRET_KEY for jobs like this. I set the 
> same key in both applications, but as soon as Django tries to validated the 
> sessions data with its hash, it will compute a wrong hash and discard the 
> data.
>
> So whats needed for 2 Django apps to actually be able to have the same 
> hashing methods?
>
> Bot applications are powerd by Django 1.11.11 and have the same secret 
> key, but it looks like im missing another ingredient. 
>

-- 
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/736ba882-1146-4a3d-bd2b-8b915f126dff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


sharing sessions

2018-03-19 Thread Andy
I want to have some sort of SingleSignOn for my application and a forum 
based on askbot (also Django).
I built a REST API to get the session from my application and want to 
replicated and also get the user from inside askbot.

This kind of works, but i cannot decode the session inside the forum.
AFAIK Django uses the settings.SECRET_KEY for jobs like this. I set the 
same key in both applications, but as soon as Django tries to validated the 
sessions data with its hash, it will compute a wrong hash and discard the 
data.

So whats needed for 2 Django apps to actually be able to have the same 
hashing methods?

Bot applications are powerd by Django 1.11.11 and have the same secret key, 
but it looks like im missing another ingredient. 

-- 
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/519efedc-e849-4a73-9376-afffa2344af3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Reverse for 'detail' with arguments '('',)' not found. 1 pattern(s) tried: ['(?P[0-9]+)/$']

2018-03-08 Thread Andy
which one of your calls to detail are failing?



or

reverse('student:detail', kwargs={'pk': self.pk})

?


if its the second one, try with args=[self.pk]


Am Donnerstag, 8. März 2018 19:48:44 UTC+1 schrieb anyi.lloyd:
>
> Yes it is named profile.
>
> ----- Reply message -
> From: "Andy Grabow" >
> To: >
> Subject: Reverse for 'detail' with arguments '('',)' not found. 1 
> pattern(s) tried: ['(?P[0-9]+)/$']
> Date: Thu, Mar 8, 2018 05:18
>
> Well, is it actually named profile inside the view? Rather than the 
> default original? Check if the name is right and your profile is named 
> profile in the template. 
>
> anyi@gmail.com  > 
> schrieb am Mi. 7. März 2018 um 20:15:
>
>> The profile already have an id. Just wanted to add to an existing profile 
>> in the db with generic view.
>>
>>
>> - Reply message -
>> From: "Andy" >
>> To: "Django users" >
>> Subject: Reverse for 'detail' with arguments '('',)' not found. 1 
>> pattern(s) tried: ['(?P[0-9]+)/$']
>> Date: Wed, Mar 7, 2018 11:08
>>
>> If you actually are inside the profile create view, the profile probably 
>> does not have an id yet and thats why the url lookup is failing. The ID 
>> will be created on first save of the object.
>>
>> Am Dienstag, 6. März 2018 00:11:53 UTC+1 schrieb anyi.lloyd:
>>>
>>> Am new to Django, please i need help here. Am trying to add a subject 
>>> into a particular id using generic CreatView, i keeping getting errors
>>> Reverse for 'detail' with arguments '('',)' not found. 1 pattern(s) 
>>> tried: ['(?P[0-9]+)/$']
>>>
>>> models.py
>>>
>>> from django.db import models
>>> from datetime import date
>>> from django.core.urlresolvers import reverse
>>> from django.shortcuts import redirect
>>>
>>>
>>> class Profile(models.Model):
>>> firstName = models.CharField(max_length=30)
>>> middleName = models.CharField(max_length=30)
>>> lastName = models.CharField(max_length=30)
>>> dob = models.DateField(blank=True, null=True)
>>> stud_id = models.CharField(max_length=5000)
>>> gender = models.CharField(max_length=10)
>>> parentsName =models.CharField(max_length=30)
>>> address = models.CharField(max_length=250)
>>> lga = models.CharField(max_length=250)
>>> Religion = models.CharField(max_length=50)
>>> email = models.EmailField(max_length=70, null=True, blank=True, 
>>> unique=True)
>>> phone = models.CharField(max_length=11, unique=True)
>>> photo = models.FileField()
>>> Comment = models.CharField(max_length=250)
>>>
>>> def get_absolute_url(self):
>>> return reverse('student:detail', kwargs={'pk': self.pk})
>>>
>>> def __str__(self):
>>> return self.firstName
>>>
>>> class Course(models.Model):
>>> profile = models.ForeignKey(Profile, on_delete=models.CASCADE, 
>>> null=True)
>>> subject = models.CharField(max_length=20)
>>> score = models.CharField(max_length=20)
>>> grade = models.CharField(max_length=20)
>>>
>>> def get_absolute_url(self,):
>>> return reverse('student:detail', kwargs={'pk': self.pk})
>>>
>>> views.py
>>>
>>> from django.views import generic
>>> from django.views.generic import View
>>> from django.views.generic.edit import CreateView, UpdateView, DeleteView
>>> from django.core.urlresolvers import reverse_lazy, reverse
>>> from django.shortcuts import render, redirect
>>> from django.contrib.auth import authenticate, login
>>> from .models import Profile, Course
>>> from .forms import UserForm
>>>
>>>
>>>
>>> #Index view
>>> class IndexView(generic.ListView):
>>> template_name = 'student/index.html'
>>> context_object_name = 'all_profile'
>>>
>>> def get_queryset(self):
>>> return Profile.objects.all()
>>>
>>> #Detail view
>>> class DetailView(generic.DetailView):
>>> model = Profile
>>> template_name = 'student/detail.html'
>>>
>>> #Add student section
>>> class ProfileCreate(generic.Cr

Re: Reverse for 'detail' with arguments '('',)' not found. 1 pattern(s) tried: ['(?P[0-9]+)/$']

2018-03-08 Thread Andy Grabow
Well, is it actually named profile inside the view? Rather than the default
original? Check if the name is right and your profile is named profile in
the template.

anyi.ll...@gmail.com  schrieb am Mi. 7. März 2018 um
20:15:

> The profile already have an id. Just wanted to add to an existing profile
> in the db with generic view.
>
>
> - Reply message -
> From: "Andy" 
> To: "Django users" 
> Subject: Reverse for 'detail' with arguments '('',)' not found. 1
> pattern(s) tried: ['(?P[0-9]+)/$']
> Date: Wed, Mar 7, 2018 11:08
>
> If you actually are inside the profile create view, the profile probably
> does not have an id yet and thats why the url lookup is failing. The ID
> will be created on first save of the object.
>
> Am Dienstag, 6. März 2018 00:11:53 UTC+1 schrieb anyi.lloyd:
>>
>> Am new to Django, please i need help here. Am trying to add a subject
>> into a particular id using generic CreatView, i keeping getting errors
>> Reverse for 'detail' with arguments '('',)' not found. 1 pattern(s)
>> tried: ['(?P[0-9]+)/$']
>>
>> models.py
>>
>> from django.db import models
>> from datetime import date
>> from django.core.urlresolvers import reverse
>> from django.shortcuts import redirect
>>
>>
>> class Profile(models.Model):
>> firstName = models.CharField(max_length=30)
>> middleName = models.CharField(max_length=30)
>> lastName = models.CharField(max_length=30)
>> dob = models.DateField(blank=True, null=True)
>> stud_id = models.CharField(max_length=5000)
>> gender = models.CharField(max_length=10)
>> parentsName =models.CharField(max_length=30)
>> address = models.CharField(max_length=250)
>> lga = models.CharField(max_length=250)
>> Religion = models.CharField(max_length=50)
>> email = models.EmailField(max_length=70, null=True, blank=True, 
>> unique=True)
>> phone = models.CharField(max_length=11, unique=True)
>> photo = models.FileField()
>> Comment = models.CharField(max_length=250)
>>
>> def get_absolute_url(self):
>> return reverse('student:detail', kwargs={'pk': self.pk})
>>
>> def __str__(self):
>> return self.firstName
>>
>> class Course(models.Model):
>> profile = models.ForeignKey(Profile, on_delete=models.CASCADE, null=True)
>> subject = models.CharField(max_length=20)
>> score = models.CharField(max_length=20)
>> grade = models.CharField(max_length=20)
>>
>> def get_absolute_url(self,):
>> return reverse('student:detail', kwargs={'pk': self.pk})
>>
>> views.py
>>
>> from django.views import generic
>> from django.views.generic import View
>> from django.views.generic.edit import CreateView, UpdateView, DeleteView
>> from django.core.urlresolvers import reverse_lazy, reverse
>> from django.shortcuts import render, redirect
>> from django.contrib.auth import authenticate, login
>> from .models import Profile, Course
>> from .forms import UserForm
>>
>>
>>
>> #Index view
>> class IndexView(generic.ListView):
>> template_name = 'student/index.html'
>> context_object_name = 'all_profile'
>>
>> def get_queryset(self):
>> return Profile.objects.all()
>>
>> #Detail view
>> class DetailView(generic.DetailView):
>> model = Profile
>> template_name = 'student/detail.html'
>>
>> #Add student section
>> class ProfileCreate(generic.CreateView):
>> model = Profile
>> fields = ['firstName', 'middleName', 'lastName', 'dob', 'gender', 
>> 'parentsName', 'address',
>>   'lga', 'Religion', 'email', 'phone', 'photo']
>>
>> #Add Subject section
>> class CourseCreate(CreateView):
>> model = Course
>> fields = ['subject', 'score', 'grade']
>>
>>
>> def get_form_kwargs(self):
>> kwargs = super(CourseCreate, self).get_form_kwargs()
>> kwargs['instance'] = Course(pk=self.kwargs['pk'])
>> return kwargs
>>
>>
>> urls.py
>>
>>
>> urlpatterns = [
>> #index url
>>

Re: Borrowing functionality from Django Admin forms

2018-03-08 Thread Andy
Take a deeper look at the *RelatedFieldWidgetWrapper 
(https://github.com/django/django/blob/1.3.2/django/contrib/admin/widgets.py#L200)*

Am Mittwoch, 7. März 2018 21:11:18 UTC+1 schrieb Justin Johnson:
>
> I have a user who saw how new objects can be created using the Admin 
> forms, and asked if I could reproduce some of that functionality.  I'm 
> still new to Django, and even newer to building forms.  I'm wondering if 
> there is a way to "borrow" elements from the Admin forms into my own forms 
> and templates.  Particularly, I would like the ability to create a new 
> related object by clicking the "+" sign next to that dropdown list on 
> another form.
>
> I have not been able to find much documentation on how the Admin forms are 
> constructed for a given Django project.  I understand the basic form 
> construction method, but I can't seem to find the equivalent workings in 
> the Admin site.  Where is the equivalent of urls.py, where the links are 
> mapped to specific Views?  Where are the equivalents of the Views, where a 
> context is created and sent to the template?
>
> I would like to get more familiar with the working code behind Django, and 
> eventually contribute to the project, so feel free to get technical.
>
> Thx.
>
>
>

-- 
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/a60deb69-3580-46f5-8f2b-eb59ef9be955%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Reverse for 'detail' with arguments '('',)' not found. 1 pattern(s) tried: ['(?P[0-9]+)/$']

2018-03-07 Thread Andy
If you actually are inside the profile create view, the profile probably 
does not have an id yet and thats why the url lookup is failing. The ID 
will be created on first save of the object.

Am Dienstag, 6. März 2018 00:11:53 UTC+1 schrieb anyi.lloyd:
>
> Am new to Django, please i need help here. Am trying to add a subject into 
> a particular id using generic CreatView, i keeping getting errors
> Reverse for 'detail' with arguments '('',)' not found. 1 pattern(s) tried: 
> ['(?P[0-9]+)/$']
>
> models.py
>
> from django.db import models
> from datetime import date
> from django.core.urlresolvers import reverse
> from django.shortcuts import redirect
>
>
> class Profile(models.Model):
> firstName = models.CharField(max_length=30)
> middleName = models.CharField(max_length=30)
> lastName = models.CharField(max_length=30)
> dob = models.DateField(blank=True, null=True)
> stud_id = models.CharField(max_length=5000)
> gender = models.CharField(max_length=10)
> parentsName =models.CharField(max_length=30)
> address = models.CharField(max_length=250)
> lga = models.CharField(max_length=250)
> Religion = models.CharField(max_length=50)
> email = models.EmailField(max_length=70, null=True, blank=True, 
> unique=True)
> phone = models.CharField(max_length=11, unique=True)
> photo = models.FileField()
> Comment = models.CharField(max_length=250)
>
> def get_absolute_url(self):
> return reverse('student:detail', kwargs={'pk': self.pk})
>
> def __str__(self):
> return self.firstName
>
> class Course(models.Model):
> profile = models.ForeignKey(Profile, on_delete=models.CASCADE, null=True)
> subject = models.CharField(max_length=20)
> score = models.CharField(max_length=20)
> grade = models.CharField(max_length=20)
>
> def get_absolute_url(self,):
> return reverse('student:detail', kwargs={'pk': self.pk})
>
> views.py
>
> from django.views import generic
> from django.views.generic import View
> from django.views.generic.edit import CreateView, UpdateView, DeleteView
> from django.core.urlresolvers import reverse_lazy, reverse
> from django.shortcuts import render, redirect
> from django.contrib.auth import authenticate, login
> from .models import Profile, Course
> from .forms import UserForm
>
>
>
> #Index view
> class IndexView(generic.ListView):
> template_name = 'student/index.html'
> context_object_name = 'all_profile'
>
> def get_queryset(self):
> return Profile.objects.all()
>
> #Detail view
> class DetailView(generic.DetailView):
> model = Profile
> template_name = 'student/detail.html'
>
> #Add student section
> class ProfileCreate(generic.CreateView):
> model = Profile
> fields = ['firstName', 'middleName', 'lastName', 'dob', 'gender', 
> 'parentsName', 'address',
>   'lga', 'Religion', 'email', 'phone', 'photo']
>
> #Add Subject section
> class CourseCreate(CreateView):
> model = Course
> fields = ['subject', 'score', 'grade']
>
>
> def get_form_kwargs(self):
> kwargs = super(CourseCreate, self).get_form_kwargs()
> kwargs['instance'] = Course(pk=self.kwargs['pk'])
> return kwargs
>
>
> urls.py
>
>
> urlpatterns = [
> #index url
> url(r'^$', views.IndexView.as_view(), name='index'),
>
> url(r'^signup/$', views.UserFormView.as_view(), name='signup'),
> #details
> url(r'^(?P[0-9]+)/$', views.DetailView.as_view(), name='detail'),
> #profile/add
> url(r'^profile/add/$', views.ProfileCreate.as_view(), name='profile-add'),
> #course/add
> url(r'^(?P[0-9]+)/course_form/$', views.CourseCreate.as_view(), 
> name='course_form'),
> #profile/pk for update
> url(r'^profile/(?P[0-9]+)/$', views.ProfileUpdate.as_view(), 
> name='profile-update'),
> #profile/pk for deleting
> url(r'^profile/(?P[0-9]+)/delete/$', views.ProfileDelete.as_view(), 
> name='profile-delete'),
> ]
>
>
>
> template
>
> {% extends 'student/base.html' %}
> {% block title %}{% endblock %}
>
> {% block body %}
>
> 
> 
> 
> 
> 
> 
> {{profile.lastName}} 
> {{profile.firstName}}
> 
> 
>
> {% if profile.photo %}
>  class="img-thumbnail" width="250px" hieght="100px">
> {% else %}
> No image to display
> {% endif %}
> 
> 
> 
>
> 
>
> 
> 
> View All
> Add New Song
> 
> 
> 
> 
> Add Subject
> 
> 
>  Add Subject
> {% if error_message %}
> {{ error_message }}
> {% end

Re: autocomplete

2018-02-27 Thread Andy
for any more complicated admin autocompletes or stuff in the frontend use 
djang-select2

Am Montag, 26. Februar 2018 18:55:15 UTC+1 schrieb Mafabi Emmanuel:
>
> how do i design an autocomplete in django 2.0
>
>
>

-- 
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/bddebd4a-0dcb-478b-ab4b-9536f77ffc81%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Seeking professional help for frontend design for a small django project

2018-02-27 Thread Andy
Whats in it for the potetial frontnd developer?
Money? Just fame?
How many pages are you talking about?


Am Dienstag, 27. Februar 2018 00:04:45 UTC+1 schrieb cjwalter:
>
> Hi everybody
>
> I’ve started a small django website which is up and running but could 
> benefit from some frontend polish (bootstrap3). As I need to launch it by 
> end of this week this is kind of time critical, but I assume for someone 
> who is specializing in this kind of work it will take a few hours only. 
>
> We shall communicate via skype with screen sharing and you will get a full 
> copy of the django project including a database dump to load it at your 
> site. Please contact me via eMail (cjwalt...@gmail.com )
>
> Best regards
>
> cj
>
>

-- 
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/b2fcda68-29c1-44b0-8c56-b9854fe6f259%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: help with the poll application." Writing your first Django app".

2018-02-23 Thread Andy
thx :)

Am Freitag, 23. Februar 2018 22:16:12 UTC+1 schrieb Haven McConnell:
>
> This is very good explaintaion 
>
> On Wednesday, February 21, 2018 at 7:17:48 AM UTC-5, Sebastian Saade wrote:
>>
>>
>> 
>>
>> Hello, I'm writing for help.
>> I'm starting to get into Django's world.
>> Testing the tutorial of the Django documentation "Writing your first 
>> application in Django" I found an error which I can not get out of when I 
>> modify polls / urls.py
>> The url of the small tutorial is 
>> https://docs.djangoproject.com/en/2.0/intro/tutorial03/
>> I share a screenshot of the error that throws me when I want to run the 
>> application.
>> the help is appreciated
>>
>>

-- 
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/e1d51fe9-d50d-4bdf-ab54-c53951a41733%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting complex query set with a many to many relationship in django

2018-02-23 Thread Andy
If you want to have Articles then get 
Article.objects.filter(section=xy).oder_by('section__order')

Am Donnerstag, 22. Februar 2018 20:47:31 UTC+1 schrieb James Farris:
>
> I am trying to *get all article objects that are part of a section* in an 
> edition that is in an issue. I am stumped, even after looking at the 
> documentation 
> 
>  
> for django 2.x
>
> I can get all editions with all of their sections that are part of an 
> issue, but I cannot figure out how to get articles that are related to a 
> section per edition.
>
> Sample code is here:
> https://codeshare.io/5vXbAD
>
> Please note I have a many to many pass through table that has extra fields 
> I am trying to get.  Specifically the "order" field.
> Here is a screenshot for proof of concept
> https://pasteboard.co/H8N2zTt.png
>
> If you are able to get all articles returned from the loop in the code 
> linked above, I will be eternally grateful :)
>
> results would be passed to a template.
>

-- 
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/57baf37b-601f-4bb3-b7f2-b66daac6147c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: template parse error

2018-02-22 Thread Andy
Are you using the defautlt django template engine or something else?
Looks correct, but please show the full template, because there might be 
errors before that point causing this error message.

Am Donnerstag, 22. Februar 2018 07:16:32 UTC+1 schrieb suabiut:
>
> Could not parse the remainder: '=="1"' from 'selected_value=="1"'
>
>
> i got the above error  when passing the select value. I have no clue what 
> i am missing. please assist 
> {%if selected_value=="1"%} 
>
>
>
>
> Cheers,
>

-- 
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/b81896d4-0ce6-443c-a2ad-7c3f75be36e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django web app reaching rest api and CORS problem

2018-02-21 Thread Andy
Why do you use a third component to have a rest api? instead of the django 
rest framework?

Since the problem is inside your custom falcon server, its not in any way 
related to django .. ask the falcon comunity here instead: 
https://gitter.im/falconry/user

Am Mittwoch, 2. November 2016 14:29:25 UTC+1 schrieb Oguz Yarimtepe:
>
> I have a django app and at the template part i have javascript function 
> calling the rest api:
>
>
> 
> http://komandor.app.gittigidiyor.net:8000/static/js/select-autofiller.js>
> ">
>
> At the js file i am filling a select box according to the returned json 
> response
>
> $('#field1').change(function(){
>
> var var1=$("#filed2").val();
> var var2=$("#field1 option:selected").text();
>
>
> url="http://www.foo.com:8080/"; + var1 + "/" + var2 + "/";
>
>
> $.get(url, function( data ) {
>   alert( "Load was performed." + data);
> });
>
>
>
> });
>
>
> The Django web app is running on www.foo.com:8000
>
>
> At the rest api side, falcon is running and i installed falcon-cors
>
>
> import falcon
>
> from wsgiref import simple_server
>
>
> from falcon_cors import CORS
>
>
> check_python()
>
> cors = CORS(allow_origins_list=settings.ALLOWED_ORIGINS)
>
> api = falcon.API(
> media_type='application/json',
> middleware=[
> # json.RequireJSON(),
> # json.JSONTranslator(),
> https.RequireHTTPS(),
> headers.BaseHeaders(),
> handle_404.WrongURL(),
> cors.middleware
> ],
> )
>
>
> ***
>
> route definitions
>
> 
>
>
> httpd = simple_server.make_server('0.0.0.0', 8080, api)
> httpd.serve_forever()
>
>
> ALLOWED_ORIGINS is a list: ['www.foo.com:8000', 'www.foo.com:8080']
>
>
> Still when i select the box and triggered the js at the Django web app, i am 
> getting 
>
>
> XMLHttpRequest cannot load http://www.foo.com:8080/var1/var2. Response to 
> preflight request doesn't pass access control check: 
>
> No 'Access-Control-Allow-Origin' header is present on the requested resource. 
> Origin 'http://www.foo.com:8000' is therefore not allowed access. The 
> response had HTTP status code 400.
>
>
> I couldn't find ow to fix it. 
>
> Any idea?
>
>

-- 
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/aa0910f6-8950-45b7-97ee-91411b97e961%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: help with the poll application." Writing your first Django app".

2018-02-21 Thread Andy
You are not using Django 2.0 and thus the path function is not existing in 
Django 1.11.
Django 2.0 can only be installed with python3, while you are trying to use 
python 2.7 for that job.

apt install python3 python3-pip
pip3 install virtualenv virtualenvwrapper
mkvirtualenv django-tutorial

Restart the tutorial from here.




Am Mittwoch, 21. Februar 2018 13:17:48 UTC+1 schrieb Sebastian Saade:
>
>
> 
>
> Hello, I'm writing for help.
> I'm starting to get into Django's world.
> Testing the tutorial of the Django documentation "Writing your first 
> application in Django" I found an error which I can not get out of when I 
> modify polls / urls.py
> The url of the small tutorial is 
> https://docs.djangoproject.com/en/2.0/intro/tutorial03/
> I share a screenshot of the error that throws me when I want to run the 
> application.
> the help is appreciated
>
>

-- 
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/d0c3e1b5-cae6-4da9-88f5-de4ee7eecf94%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how can i allow visitors to make an account and post pictures in my django website. something like this

2018-02-20 Thread Andy
Have a look at the official tutorial, give you users acces to the admin and 
have a look at the fielfield which once you created an admin for your model 
containing this field will allow anyone to upload files to your project.

Am Dienstag, 20. Februar 2018 13:21:10 UTC+1 schrieb miraj:
>
> how to give members of my website to be able to upload photos and videos
>

-- 
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/de8ef81c-135f-42d6-b26c-ed2032e70ff2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I get dynamic choices to a select widget at render time?

2018-02-20 Thread Andy
use django-select2

Am Dienstag, 20. Februar 2018 01:17:26 UTC+1 schrieb Mike Dewhirst:
>
> Here is an example of get_choices() output ... it comes from a method on 
> the Question model. 
>
>   [('A', 'A - Once?'), ('B', 'B - Twice?'), ('C', 'C - Four times?'), 
> ('D', 'D - Twelve times?'), ('E', 'E - Continously as changes are made?')] 
>
> It is available before the the answer form is instantiated ... 
>
> class AnswerSingleForm(forms.ModelForm): 
>
>  class Meta: 
>  model = Answer 
>  fields = [ 
>  'answer', 
>  'score' 
>  ] 
>
> So how do I get that set of choices into the Answer form? 
>
> I can see from the docs that the form Meta class can have a widgets 
> attribute for the 'answer' field. I think I need a ChoiceField widget so 
> I can include the choices. I tried using __init__() in the form class to 
> get the choices on board at instantiation but still couldn't get it 
> going because class Meta doesn't see 'self'. 
>
> Thanks for any help 
>
> Stumped 
>
>

-- 
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/4eaf732e-54c5-4e43-ba6e-8ef72c999c90%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: DjangoUnleashed-2.0

2018-02-20 Thread Andy
How many problems are there and how big is this section?
There is quite a gap from 1.8 to 2.0 mainly the new locations of url 
functions which are nagging you.

How can i help?


Am Dienstag, 20. Februar 2018 13:21:10 UTC+1 schrieb Midhat Šibonjić:
>
> Django 2.0 released before 2,5 months. We have some problems with code in 
> Django Unleashed book. It's for Django 1.8, when someone want to write with 
> Django 2.0 there are many problems with url section. Is there someone who 
> would like to review the book and update code? 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/e48a2ae5-3999-4eea-b57d-e18d282ede58%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Strange problem with Django

2018-02-18 Thread Andy
How did you try to run the command? It sounds that you told you computer to 
open the file instead.
You have to run that in the command shell of your OS. (Terminal on OSX or 
Powershell in Windows)

Am Samstag, 17. Februar 2018 18:48:58 UTC+1 schrieb Tet Yeap:
>
> Hi,
>
> I was trying to learn Django. I have installed Python 3.6 and Django. 
> The installation was successful. When I ran "django-admin startproject 
> mysite" to create a new project, the attached file showed up and the 
> program stop. What is wrong?
>
> Thank you.
>
> Tet Yeap
>  
>

-- 
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/b30fad7c-cdba-4699-be5f-81eff4799a3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: edit model properties in the admin

2018-02-14 Thread Andy


Am Mittwoch, 14. Februar 2018 14:45:49 UTC+1 schrieb Adler Neves:
>
> You can have an OneToOneField in the profile referencing Django's User 
> model with `related_name='profile'`, 


Well, i know this and the related entry is accessible even without 
explicitly defining the related_name. You can change defaults defining the 
related_name, tho. 
But still trying to add a UserInline to the ProfileAdmin wont work due to 
the missing FK on the user model.

 

> About the admin interface changing the model, I guess you're somehow 
> editing `models.py` files. Are you making the migrations, applying them to 
> the database and reloading the server? If you're not persisting changes 
> that way, how do you patch models in memory every startup and ensure 
> database schema is compatible with your models?
>

Just for clarification, i dont do any mysterious magic: the property works 
like this:

@property
def username(self):
return self.user.username
username.fget.short_description = "Username"

@username.setter
def username(self, username):
self.user.username = username
self.user.save()


So with everything else failing .. although i only want to be able to edit 
this one field of the actual user, it looks like i have to show a useradmin 
with a profile inline admin?
AFAIK this can only be done with a separate admin site, because there can 
only be one Admin for any model thats why i wanted to have some other 
solution. 

Maybe someone knows a better solution?
 

 

-- 
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/c3165e95-7be7-42bb-824f-fc52aed080f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: edit model properties in the admin

2018-02-14 Thread Andy
As an example i wanted to have the username editable inside the profile. 
Since the Django default user doesnt have a foreign key to profile i cant 
just use an inline admin for the user model, so my next idea was to solve 
it with properties just getting from and saving to the related user model.

Am Mittwoch, 14. Februar 2018 13:54:30 UTC+1 schrieb Gonzalo Delgado:
>
> On 14/2/18 08:05, Andy wrote: 
> > Im trying to have a custom admin that is also able to edit some model 
> > properties, but putting those properties into my fieldsets its 
> complaining 
>
> What would mean to edit a property (assuming this means an attribute 
> that isn't a model field) in your app? Where would the data go? 
>
> > Unknown field(s) (foo, bar) specified for Profile. Check 
> fields/fieldsets/exclude attributes of class ProfileAdmin. 
> > The properties work in list_display, but im missing something for the 
> edit page. 
>
>
> The Django admin will look only for Django fields in the edit forms, 
> that's why you're getting the errors. 
> Since list_display is only for showing data, it will display any 
> attribute in your model. 
>
> > Can i actually do this? So far i didnt find any hint on editing 
> properties with the admin. 
>
> What you can do is use a custom model form and add fields to it for the 
> attributes you want to be able to "edit", but you'll also need to define 
> what happens with the data either in the custom form class itself, or in 
> the ModelAdmin class by extending the change_view method. 
>
> See the documentation for details: 
>
> https://docs.djangoproject.com/en/2.0/ref/contrib/admin/#django.contrib.admin.ModelAdmin.form
>  
>
> -- 
> Gonzalo Delgado 
>

-- 
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/2c65aa7c-3695-49dd-8769-a5b940997917%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


edit model properties in the admin

2018-02-14 Thread Andy
Im trying to have a custom admin that is also able to edit some model 
properties, but putting those properties into my fieldsets its complaining

Unknown field(s) (foo, bar) specified for Profile. Check 
fields/fieldsets/exclude attributes of class ProfileAdmin.

The properties work in list_display, but im missing something for the edit page.
Can i actually do this? So far i didnt find any hint on editing properties with 
the admin.

-- 
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/cadb37cd-6ac6-43e1-8f96-dade54bd8aa1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Syntax Error when trying to migrate to Postgresql

2018-02-14 Thread Andy
Could you post a few more lines of this settings.py? Preferably the whole 
DATABASES definition.

Just in case there actually is a weird invisible character try retyping 
'postgresql', but more likely it looks as if you are using wrong quotation 
marks other than ' or ". I dont even have on my keyboard whats in your 
error message.


Am Mittwoch, 14. Februar 2018 01:17:43 UTC+1 schrieb Joe:
>
> I have installed django, Postgresql, and psycopg2 and went to migrate a 
> project to a new database I created on postgresql, This is the error 
> message I got. 
>
> Traceback (most recent call last):
>
>   File "manage.py", line 15, in 
>
> execute_from_command_line(sys.argv)
>
>   File 
> "/Users/JosephConrad/Desktop/Joetestsite/lib/python3.6/site-packages/django/core/management/__init__.py",
>  
> line 371, in execute_from_command_line
>
> utility.execute()
>
>   File 
> "/Users/JosephConrad/Desktop/Joetestsite/lib/python3.6/site-packages/django/core/management/__init__.py",
>  
> line 317, in execute
>
> settings.INSTALLED_APPS
>
>   File 
> "/Users/JosephConrad/Desktop/Joetestsite/lib/python3.6/site-packages/django/conf/__init__.py",
>  
> line 56, in __getattr__
>
> self._setup(name)
>
>   File 
> "/Users/JosephConrad/Desktop/Joetestsite/lib/python3.6/site-packages/django/conf/__init__.py",
>  
> line 43, in _setup
>
> self._wrapped = Settings(settings_module)
>
>   File 
> "/Users/JosephConrad/Desktop/Joetestsite/lib/python3.6/site-packages/django/conf/__init__.py",
>  
> line 106, in __init__
>
> mod = importlib.import_module(self.SETTINGS_MODULE)
>
>   File 
> "/Users/JosephConrad/Desktop/Joetestsite/lib/python3.6/importlib/__init__.py",
>  
> line 126, in import_module
>
> return _bootstrap._gcd_import(name[level:], package, level)
>
>   File "", line 978, in _gcd_import
>
>   File "", line 961, in _find_and_load
>
>   File "", line 950, in 
> _find_and_load_unlocked
>
>   File "", line 655, in _load_unlocked
>
>   File "", line 674, in exec_module
>
>   File "", line 781, in get_code
>
>   File "", line 741, in 
> source_to_code
>
>   File "", line 205, in 
> _call_with_frames_removed
>
>   File 
> "/Users/JosephConrad/Desktop/Joetestsite/MySite/BudgetSite/settings.py", 
> line 77
>
> ‘postgresql’: {
>
>^
>
> SyntaxError: invalid character in identifier
>
>
>
> I am able to migrate with sqllite but I can't migrate to postgresql.
>

-- 
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/4a39755e-c408-4f6f-93a2-bde83fbc2bbd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: BooleanField ignored by makemigrations Django 2.0

2018-02-13 Thread Andy
Your app is most likely not listed in installed_apps when makemigrations is 
not picking up anything.
Or its just because you named it model.py instead of models.py?
Is any other model of that app picked up by makemigrations?


Am Donnerstag, 8. Februar 2018 23:28:19 UTC+1 schrieb Gary Mumford:
>
> Hi,
> I have just installed Django 2.0 and Python 3.6.3. I am not a noobie, but 
> it has been a while since I djangoed.
>
> I have several fields in a model.py which are BooleanField type.
>
> When running makemigrations.py, these fields are being ignored and not 
> being generated into the migrations code or the migrations db. 
>
> Also, any changes are not being tracked and so my migrations are getting 
> hopelessly screwed.
>
> To see if anything made sense - I ran an inspectdb on an existing mySQL db 
> and found that even though this utility recognised the tinyInt being on the 
> db - even after changing the field type to BooleanField - no changes were 
> detected during makemigrations.
>
> Has anyone seen this before and know how to work around it 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/32c8de4c-e5c2-4979-9266-273e2d27cfa7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Travis Problem

2018-02-05 Thread Andy Grabow
Thx i will test those versions myself.

-- 
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/etPan.5a788dd7.5ce0d2ef.135%40freilandkiwis.de.
For more options, visit https://groups.google.com/d/optout.


Re: Travis Problem

2018-02-05 Thread Andy
>   File "/usr/lib/python3.5/importlib/__init__.py", line 166, in reload
> _bootstrap._exec(spec, module)
>   File "", line 607, in _exec
> AttributeError: 'NoneType' object has no attribute 'name'
>
> ==
> ERROR: test_export (django_secrets.tests.SecretTest)
> --
> Traceback (most recent call last):
>   File "/home/rodrigo/code/django-secrets/django_secrets/tests.py", line 
> 32, in test_export
> command.handle()
>   File 
> "/home/rodrigo/code/django-secrets/django_secrets/management/commands/export_secrets.py",
>  
> line 15, in handle
> print('export %s="%s"' % (key, getattr(secrets, key)))
> AttributeError: module 'secrets.secrets' has no attribute 'SECOND_SECRET'
>
> --
> Ran 3 tests in 0.004s
>
> FAILED (errors=2)
> Destroying test database for alias 'default'...
> (.env) rodrigo@enoch:~/code/django-secrets$ 
>
>
> On Mon, Feb 5, 2018 at 12:37 PM, Andy > 
> wrote:
>
>> No, the actual problem is, that the secrets modules was not reloaded 
>> correctly and thus the tested SECOND_SECRET could not be found.
>> BUT the question is, why this is happening, because testing the same 
>> thing locally (under the same python version failing at travis) works like 
>> it should.
>>
>> If you have some minutes to spare, please test it and tell me if you can 
>> reproduce the problem.
>>
>>
>>
>> Am Montag, 5. Februar 2018 16:30:21 UTC+1 schrieb Matemática A3K:
>>>
>>>
>>>
>>> On Mon, Feb 5, 2018 at 12:23 PM, Andy  wrote:
>>>
>>>> Which line number are you referring to?
>>>> i didnt notice missing  vars.
>>>>
>>>
>>> got secret from environment variable (SECOND_SECRET)
>>> E
>>> Use these lines to initialize your secrets ..
>>> export SECRET_KEY="travis"
>>> E
>>>
>>> ...
>>>
>>> ==
>>> ERROR: test_export (django_secrets.tests.SecretTest)
>>> --
>>> Traceback (most recent call last):
>>>   File 
>>> "/home/travis/build/kakulukia/django-secrets/django_secrets/tests.py", line 
>>> 32, in test_export
>>> command.handle()
>>>   File 
>>> "/home/travis/build/kakulukia/django-secrets/django_secrets/management/commands/export_secrets.py",
>>>  line 15, in handle
>>> print('export %s="%s"' % (key, getattr(secrets, key)))
>>> AttributeError: 'module' object has no attribute 'SECOND_SECRET'
>>>
>>>
>>>  
>>>
>>>>
>>>>
>>>> Am Montag, 5. Februar 2018 15:50:14 UTC+1 schrieb Matemática A3K:
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Feb 1, 2018 at 9:58 AM, Andy  wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> im trying to convince Travis to test my app:
>>>>>> https://github.com/kakulukia/django-secrets
>>>>>>
>>>>>> But its failing for all python3 versions. Because my system python 3 
>>>>>> is 3.6.4 i just installed pyenv, created a 3.6.3 (latest python 3.6 at 
>>>>>> Travis) virtualenv and ran the tests. On my local system they are 
>>>>>> working, 
>>>>>> but travis reports problems and i dont really know how to fix them when 
>>>>>> the 
>>>>>> tests are not failing locally.
>>>>>>
>>>>>> Does sombody have a clue, whats wrong here?
>>>>>>
>>>>>> Weird evough: now that i pushed a new commit (not relating python 
>>>>>> code though) two confgigurations do pass the tests:
>>>>>> https://travis-ci.org/kakulukia/django-secrets/
>>>>>>
>>>>>
>>>>> This is more like a Travis problem, according the log, the env vars 
>>>>> are not being picked by it:
>>>>> https://travis-ci.org/kakulukia/django-secrets/jobs/336123060
>>>>>
>>>>>  
>>>>>
>>>>>>
>>>>>> -- 
>>>>

Re: Travis Problem

2018-02-05 Thread Andy
No, the actual problem is, that the secrets modules was not reloaded 
correctly and thus the tested SECOND_SECRET could not be found.
BUT the question is, why this is happening, because testing the same thing 
locally (under the same python version failing at travis) works like it 
should.

If you have some minutes to spare, please test it and tell me if you can 
reproduce the problem.



Am Montag, 5. Februar 2018 16:30:21 UTC+1 schrieb Matemática A3K:
>
>
>
> On Mon, Feb 5, 2018 at 12:23 PM, Andy > 
> wrote:
>
>> Which line number are you referring to?
>> i didnt notice missing  vars.
>>
>
> got secret from environment variable (SECOND_SECRET)
> E
> Use these lines to initialize your secrets ..
> export SECRET_KEY="travis"
> E
>
> ...
>
> ==
> ERROR: test_export (django_secrets.tests.SecretTest)
> --
> Traceback (most recent call last):
>   File "/home/travis/build/kakulukia/django-secrets/django_secrets/tests.py", 
> line 32, in test_export
> command.handle()
>   File 
> "/home/travis/build/kakulukia/django-secrets/django_secrets/management/commands/export_secrets.py",
>  line 15, in handle
> print('export %s="%s"' % (key, getattr(secrets, key)))
> AttributeError: 'module' object has no attribute 'SECOND_SECRET'
>
>
>  
>
>>
>>
>> Am Montag, 5. Februar 2018 15:50:14 UTC+1 schrieb Matemática A3K:
>>>
>>>
>>>
>>> On Thu, Feb 1, 2018 at 9:58 AM, Andy  wrote:
>>>
>>>> Hi,
>>>>
>>>> im trying to convince Travis to test my app:
>>>> https://github.com/kakulukia/django-secrets
>>>>
>>>> But its failing for all python3 versions. Because my system python 3 is 
>>>> 3.6.4 i just installed pyenv, created a 3.6.3 (latest python 3.6 at 
>>>> Travis) 
>>>> virtualenv and ran the tests. On my local system they are working, but 
>>>> travis reports problems and i dont really know how to fix them when the 
>>>> tests are not failing locally.
>>>>
>>>> Does sombody have a clue, whats wrong here?
>>>>
>>>> Weird evough: now that i pushed a new commit (not relating python code 
>>>> though) two confgigurations do pass the tests:
>>>> https://travis-ci.org/kakulukia/django-secrets/
>>>>
>>>
>>> This is more like a Travis problem, according the log, the env vars are 
>>> not being picked by it:
>>> https://travis-ci.org/kakulukia/django-secrets/jobs/336123060
>>>
>>>  
>>>
>>>>
>>>> -- 
>>>> 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/01cb4387-5ad1-4d24-9ae4-42a2b83c7ab1%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/django-users/01cb4387-5ad1-4d24-9ae4-42a2b83c7ab1%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...@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/08261ca0-c0dd-4d70-9ce1-e8cb2e401059%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/08261ca0-c0dd-4d70-9ce1-e8cb2e401059%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/msgid/django-users/f71c985d-365b-46b5-858e-985025590124%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Travis Problem

2018-02-05 Thread Andy
Which line number are you referring to?
i didnt notice missing  vars.


Am Montag, 5. Februar 2018 15:50:14 UTC+1 schrieb Matemática A3K:
>
>
>
> On Thu, Feb 1, 2018 at 9:58 AM, Andy > 
> wrote:
>
>> Hi,
>>
>> im trying to convince Travis to test my app:
>> https://github.com/kakulukia/django-secrets
>>
>> But its failing for all python3 versions. Because my system python 3 is 
>> 3.6.4 i just installed pyenv, created a 3.6.3 (latest python 3.6 at Travis) 
>> virtualenv and ran the tests. On my local system they are working, but 
>> travis reports problems and i dont really know how to fix them when the 
>> tests are not failing locally.
>>
>> Does sombody have a clue, whats wrong here?
>>
>> Weird evough: now that i pushed a new commit (not relating python code 
>> though) two confgigurations do pass the tests:
>> https://travis-ci.org/kakulukia/django-secrets/
>>
>
> This is more like a Travis problem, according the log, the env vars are 
> not being picked by it:
> https://travis-ci.org/kakulukia/django-secrets/jobs/336123060
>
>  
>
>>
>> -- 
>> 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/01cb4387-5ad1-4d24-9ae4-42a2b83c7ab1%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/01cb4387-5ad1-4d24-9ae4-42a2b83c7ab1%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/msgid/django-users/08261ca0-c0dd-4d70-9ce1-e8cb2e401059%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: In the Admin, Is it possible to make filters on foreign keys usable with lots of related objects?

2018-02-02 Thread Andy
No you didn’t miss anything. He did not understand your question. 
But like I said before you can always build your own filter. Your problem is 
highly custom to your DB and model relations. You can’t expect any framework to 
already have a matching component for that. 

In my 9 years of Django development I never needed what you expect to be there. 

-- 
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/706c9c9d-9f23-43bd-98f0-e221e2be13ac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: In the Admin, Is it possible to make filters on foreign keys usable with lots of related objects?

2018-02-02 Thread Andy
You should rather use search_fields instead of filtering together with the 
sorting ability of the admin. Thats much more suited for a scenario like 
described above.
The filter is for status fields or something with just a few different 
entries, otherwise build your own filter to filter for some specific values.

-- 
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/1ffa9984-7775-49d1-bc78-6dd2de7fcf5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Optimal query for related names in onetomany or manytomany using Django Queryset

2018-02-02 Thread Andy
not that i know of

Am Freitag, 2. Februar 2018 15:28:26 UTC+1 schrieb Web Architect:
>
> Hi Andy,
>
> Thanks for your response. I was pondering on option a before posting this 
> query thinking there could be better ways in django/SQL to handle this. But 
> now I would probably go with a.
>
> Thanks.
>
> On Friday, February 2, 2018 at 7:50:53 PM UTC+5:30, Andy wrote:
>>
>> a) Maybe its an option to put the foreign key to the other model? This 
>> way you dont need to make a join to find out if there is a relation.
>>
>> b) Save the existing ralation status to model A
>>
>> c) cache the A.objects.filter(bs__isnull=False) query
>>
>> But apart from that i fear you cannot do much more, since this is just a 
>> DB and not a Django ORM question.
>>
>>
>> Am Freitag, 2. Februar 2018 14:47:45 UTC+1 schrieb Web Architect:
>>>
>>> Hi,
>>>
>>> I am trying to optimise Django queries on my ecommerce website. One of 
>>> the fundamental query is where I have no clue how to make efficient. It 
>>> could be trivial and probably been known long time back. But I am new to 
>>> Django and would appreciate any help. This is primarily for one to many or 
>>> many to many relations.
>>>
>>> Following is an example scenario:
>>> (Please pardon my syntax as I want to put across the concept and not the 
>>> exact django code unless it's really needed):
>>>
>>> Model A:
>>>
>>> class A(models.Model):
>>> # Fields of model A
>>>
>>> Model B (which is related to A with foreign key):
>>>
>>> class B(models.Model):
>>> a = models.ForeignKey('A', related_name='bs')
>>>
>>> Now I would like to find out all As for which there is atleast one b. 
>>> The only way I know is as follows:
>>>
>>> A.objects.filter(bs__isnull=False)
>>>
>>> But the above isn't an optimal way as with large of records in A and B, 
>>> the above takes lot of time. It gets more inefficient if it's a many to 
>>> many relationship.
>>>
>>> Could anyone please let me know the most efficient way to use django 
>>> queryset for the above scenario?
>>>
>>> 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/73ed5ff7-d4db-4057-a812-01c82bf08cf3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Optimal query for related names in onetomany or manytomany using Django Queryset

2018-02-02 Thread Andy
a) Maybe its an option to put the foreign key to the other model? This way 
you dont need to make a join to find out if there is a relation.

b) Save the existing ralation status to model A

c) cache the A.objects.filter(bs__isnull=False) query

But apart from that i fear you cannot do much more, since this is just a DB 
and not a Django ORM question.


Am Freitag, 2. Februar 2018 14:47:45 UTC+1 schrieb Web Architect:
>
> Hi,
>
> I am trying to optimise Django queries on my ecommerce website. One of the 
> fundamental query is where I have no clue how to make efficient. It could 
> be trivial and probably been known long time back. But I am new to Django 
> and would appreciate any help. This is primarily for one to many or many to 
> many relations.
>
> Following is an example scenario:
> (Please pardon my syntax as I want to put across the concept and not the 
> exact django code unless it's really needed):
>
> Model A:
>
> class A(models.Model):
> # Fields of model A
>
> Model B (which is related to A with foreign key):
>
> class B(models.Model):
> a = models.ForeignKey('A', related_name='bs')
>
> Now I would like to find out all As for which there is atleast one b. The 
> only way I know is as follows:
>
> A.objects.filter(bs__isnull=False)
>
> But the above isn't an optimal way as with large of records in A and B, 
> the above takes lot of time. It gets more inefficient if it's a many to 
> many relationship.
>
> Could anyone please let me know the most efficient way to use django 
> queryset for the above scenario?
>
> 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/d5fb0d86-aff8-4c97-a6d7-1d04ddf3d466%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Customizable Invoice

2018-02-02 Thread Andy
Well since your answer is no, you should take you time and learn 
Python/Dajngo before asking anyone in here to basically write that invoice 
app for you. :)

Basically Django can do what you are asking for, but i'd recommend you to 
use it only as a backend for this highly UI focused problem. Then think 
about what the frontend will be (web, app, mobile) and choose something 
that has the needed frontend components that you would like to use. 

But let me tell you this: a totally customizable invoice with that shall 
still look pretty and can be printed out in any combination of item rows 
and extra details is probably one of the hardest tasks you can think of not 
having any programming background!
Having kinda done the above i can definitely recommend the 
awesome https://github.com/Kozea/WeasyPrint library for generating PDF 
files!

But it sounds to me that you should do yourself a favour and read this 
before actually starting your 
project: https://www.twoscoopspress.com/products/two-scoops-of-django-1-11

Have fun!

 

Am Freitag, 2. Februar 2018 10:24:31 UTC+1 schrieb Rakhee Menon:
>
>
>
> No...I wanted to know if i could do it using django and if yes...how to do 
> it??
>

-- 
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/a023e7d3-8a28-40cd-917b-ae9c8673dc7a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Customizable Invoice

2018-02-02 Thread Andy
Do you have any idea in any programming language you know how to do what 
you are asking for?

-- 
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/bbce7792-6cec-4599-b10e-238516da5106%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Simple table construct?

2018-02-01 Thread Andy
You could use Djangos geo features to calculate distances.
https://docs.djangoproject.com/en/2.0/ref/contrib/gis/

Am Mittwoch, 31. Januar 2018 15:40:41 UTC+1 schrieb MikeKJ:
>
> This should be real simple but it has me scratching where to start
>
> Distance/Time between 2 place like
>
> Distance
> A   B C
> A 05  10
>
> B 50  5  
>
> C 10  5   0
>
> Time
>
>   A   B   C
> A0   12
>
> B1   01
>
> C2   1 0
>
> I want to input a start and end get the distance and time between the 2 
> selected points.
>
> I could junk the Time section and just divide by an average speed to get 
> time if that simplifies
>
> Trying to think on what the model(s) would be like to get the data in the 
> first place
>
> Be grateful for any input
>

-- 
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/42e87be2-aea3-4f32-b2e7-b9d95f796566%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Travis Problem

2018-02-01 Thread Andy
Hi,

im trying to convince Travis to test my app:
https://github.com/kakulukia/django-secrets

But its failing for all python3 versions. Because my system python 3 is 
3.6.4 i just installed pyenv, created a 3.6.3 (latest python 3.6 at Travis) 
virtualenv and ran the tests. On my local system they are working, but 
travis reports problems and i dont really know how to fix them when the 
tests are not failing locally.

Does sombody have a clue, whats wrong here?

Weird evough: now that i pushed a new commit (not relating python code 
though) two confgigurations do pass the tests:
https://travis-ci.org/kakulukia/django-secrets/

-- 
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/01cb4387-5ad1-4d24-9ae4-42a2b83c7ab1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django-vue

2018-02-01 Thread Andy
I made a project template that is already configured to use vue and a lot 
more.
https://github.com/kakulukia/django-default-project


Am Mittwoch, 31. Januar 2018 12:55:48 UTC+1 schrieb Mohammad ariyan bin 
layek:
>
> Hii guys is there any good resouce to integrate django with vue ?
>

-- 
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/f80ea528-3e04-49e4-8c13-2a39d7d35ec8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: querying multiselectcheckbox

2018-02-01 Thread Andy
Once you fixed the typo in your model name its 
Participants.objects.filter(track_events__in=['100M', 
'200M']).values_list('Full_name')

And you should use single case for model name (Participant) and lower case 
for full_name as you did with the other attributes. 

-- 
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/a31e79e1-4b35-4dba-901d-bd93a2d48068%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django 2 under python 2

2018-01-29 Thread Andy
its fixed now .. you can savely install django under python2 again :)

Am Donnerstag, 25. Januar 2018 22:39:43 UTC+1 schrieb Andy:
>
> Hi!
>
> pip inside a python2 virtualenv will try to install django 2, which aint 
> working and will fail.
> I wonder why this is happening because for instance if i install ipython 
> in that same virtualenv pip wont try to install version 6.x because its 
> marked as python3 only. It seems django 2 is missing some soft of flag that 
> is present at the ipython package and tells pip to install the old ipython 
> 5.5 rather than anythin above that.
>
> Does anyone know whats causing this?
>

-- 
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/ac9545e8-c248-4daf-8260-f67ca63a55be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how do I make django search for male or female without needing to specify an age?

2018-01-28 Thread Andy
Why do you make a POST request for displaying a list? Use GET parameters 
like its done for admin filters.
And for building an API that returns JSON Data use DjangoRestFramework and 
you will just need to define your serializer fields .. the rest is taken 
care of for you. That code above looks overly complicated!

For instance you define app_name, model_name, method_name in 
filterchain_all although its not used.
Your are sending male and female intstead of the values itself as a normal 
django form would have done it.
Dont make a list out of the qs for no reason.
And instead of doing this "if int(item.age) not in [d['display'] for d in 
final]" over and over again use a set() to not get multiple results.

BUT moreover to get all distinct ages use:
Child.objects.vales_list('age', flat=True).order_by('age')
Done in one single line by your database instead of the handwritten view!

Please have a look at the django tutorial 
(https://docs.djangoproject.com/en/2.0/intro/tutorial01/) and keep an eye 
out for how the admin filters things in a way that can be linked from the 
outside with GET parameters (you cannot linkt to a filtered list that is 
requested by a post request)

Please stop using Q() in cases where its not neccessary .. all parameters 
in a queryset do mean AND. You only need a Q for more complex stuff or an 
actual OR.
Use a class based FormView to erase even more of the handwritten code and 
secure it with the LoginRequiredMixin.
Please dont ever again use a TemplateView for dynamic content use the 
render() method like shown in the tutorial!

Once you have completed the tutorial and embraced the concepts your code 
will be about 1/10 of the above and it will save you a lot of time figuring 
out how to do things that are already taken care of by Django if only you 
knew how. :)


-- 
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/5b204908-459a-42bd-970f-c2d45e7ef3db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Get request, has PK, how do I access the PK data with in the model

2018-01-26 Thread Andy

Travis have a look the very cool and complete django tutorial which 
explaining how you query models in part2.
Once you have create the admin views, watch closely at how the list filters 
work to get an idea of what you have to do. :)

-- 
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/85a3ded4-a710-4c5a-a4a2-b592002d8773%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django 2 under python 2

2018-01-26 Thread Andy
okay after digging a little bit more yesterday i found out why this is 
happening ..

https://code.djangoproject.com/ticket/28878
its fixed in 2.0.1, but maybe they will be able to reupload 2.0

Just to be clear: i know that django 2 aint working under python2, but its 
a pain to setup cross version testing if "pip install django" under pthon2 
will just fail whereas "pip install ipython" will just install the latest 
compatible release (5.5.x) and wont even bother to download 6.x which is 
correctly marked as python3 only. So i already knew that django2 could be 
hidden from python2, just wondered why its not behaving correctly.

Just trying to install django under python2 you will notice, that pip wil 
not bother to download the fixed django 2.0.1 .. but sadly it will install 
the incompatible 2.0 and fail ..

But the django folks are at it .. until then my travis config will be a 
little bit more complicated than it has to be. :(

-- 
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/828351c7-49e0-4060-9965-4f95160cd49f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Rest Framework: Get Data from an external apis

2018-01-25 Thread Andy
you dont have to define any route when getting data from an external api, 
just use requests.get('https://api.test.com/consumers') to get your data

-- 
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/c89a6f33-66bd-4e17-9462-a37e86290a41%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: unable to save object Django (2.0)

2018-01-25 Thread Andy
what is the actual error message?

Am Dienstag, 23. Januar 2018 21:10:00 UTC+1 schrieb harsh sharma:
>
> i am trying to save the basic information about a person 
> i have created a model form for it but i am unable to save the object 
> (unable to update the database)
>
> here is my views file
>
> @login_required
> def dashboard(request):
> if request.method=="post":
> form = linkform(request.POST)
> if form.is_valid():
> try:
> notes = form.cleaned_data['note']
> link = form.cleaned_data['link']
> number = form.cleaned_data['number']
> perso = person.object.create_person(notes,link,number)
> perso.save()
> return HttpResponse('succeess')
> except:
> return HttpResponse('can not create object')
> else:
> return HttpResponse('bad form')
> else:
> form = linkform(request.POST)
> return render(request, 'dashboard.html', {'form':form})
>
>
> here is my model file :
>
> class personmanager(models.Manager):
> def create_person(self,note,link,number):
> pers = self.create(note=note,link=link,number=number)
> return pers
>
>
>
> class person(models.Model):
> notes = models.TextField()
> link = models.URLField()
> number = models.IntegerField()
> object = personmanager()
>
>

-- 
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/4fe77994-e6c3-4d28-a9ce-157bb127ad67%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django 2 under python 2

2018-01-25 Thread Andy
Hi!

pip inside a python2 virtualenv will try to install django 2, which aint 
working and will fail.
I wonder why this is happening because for instance if i install ipython in 
that same virtualenv pip wont try to install version 6.x because its marked 
as python3 only. It seems django 2 is missing some soft of flag that is 
present at the ipython package and tells pip to install the old ipython 5.5 
rather than anythin above that.

Does anyone know whats causing this?

-- 
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/eed0e673-56e9-476b-9030-b81a18c531a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


weird manager bug

2018-01-25 Thread Andy
Hi,

i have created a module for django that basically gives me shadow db with 
all deleted data and hides all that from django by the use of a custom (not 
deleted) data manager.
So far so good - this works really well, but lately i finally wrote some 
tests for this project and discovered a weird bug where the custom manager 
will not be present on the model.

This is the workaround ( custom manager definition 

 
) but if i rewrite this to the old version of data = objects = 
DataManager() it will most certainly fail under python2 and (thats the 
weirdes part) fail sometimes under python 3. Have a look at the build 
history at https://travis-ci.org/kakulukia/django-undeletable/builds (#17 - 
#40). I tried a lot of stuff until i found the solution to actually make 
the tests work.

But now id like to know what was happening? Why was that failing SOMETIMES? 
Like totally random on python3?
Does somebody have an explaination for the weird behaviour?

Im using that django-undeletable module in my projects for tha last 4 years 
now and the above problem never occured in a real code base - just those 
noew tests. I really like to understand that weird manager magic that faild 
to add the defined manager to the test model.

Wile debugging i saw that the objects DataManager was there, but not the 
deafult one name data.


-- 
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/2db875e6-5ea2-4ef7-876d-2e4e63db6e93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Filefield uploads in django admin

2017-06-06 Thread Andy Cheesman
Hi everyone

I've a problem using filefields in the admin module.I've a standard model 
which is has a FileField (which I use to upload pdfs)
When I'm in the administration console and attempt to upload a pdf, the 
filename is modified from name.pdf to name_.pdf. I would like the 
uploaded file to keep the original name!
I've looked around at CRSF issues with django and they usually suggest 
@csrf_exempt 
in the views.py, which won't work in this situation. 

I know this is information light but I didn't want to spam the list with 
lots of pointless information - If anyone has any starting points, I would 
happily provide further useful information

Yours 

Andy 


-- 
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/f68fa038-eec1-4f4d-962c-9538f6baa8c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Interfacing Django Project with Python Script

2015-07-18 Thread Andy Shapiro
For a standalone script (and django 1.7+), you'll need to add this at the 
top of your script:

import django
django.setup()

https://docs.djangoproject.com/en/1.8/ref/applications/#django.setup
https://docs.djangoproject.com/en/1.8/intro/tutorial01/#playing-with-the-api



On Friday, July 17, 2015 at 5:30:14 PM UTC-4, Gergely Polonkai wrote:
>
> I think what you really need is a custom Django management command. You 
> can take a look at the implementation of createsuperuser, it takes some 
> input and creates a user based on this info.
> On 17 Jul 2015 18:55, "Jake Rudolph" > 
> wrote:
>
>> So basically I have my Django app that takes in information from a user 
>> to make new objects, and I need to send some of that information to a 
>> separate script that performs logic and such with that information. When 
>> certain events occur I need to send information from the script to the 
>> database.
>>
>> On Friday, July 17, 2015 at 5:12:51 AM UTC-7, larry@gmail.com wrote:
>>>
>>> On Thu, Jul 16, 2015 at 7:44 PM, Jake Rudolph  
>>> wrote: 
>>> > If I have a separate Python script that I want to interact with my 
>>> Django 
>>> > project, how do I set them up to communicate? 
>>>
>>> Not 100% sure what you mean. Do you mean you want to have a standalone 
>>> python script that uses the ORM? I do this all the time. Just import 
>>> what you need. 
>>>
>>  -- 
>> 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 http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/068b19ed-fdab-430b-8ae6-01cbb92321b7%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/15e9d517-15d6-4c47-99a2-4174966180b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Bug? Infinite migrations with empty help_text and ugettext_lazy

2015-06-04 Thread Andy Gimblett
Hi Carl,

On 4 Jun 2015, at 18:05, Carl Meyer  wrote:

> That is most certainly a bug. It's not a super-high-priority bug
> (because an empty translated help_text is an odd thing to do), but it's
> a bug nonetheless and should be filed at
> https://code.djangoproject.com/newticket and fixed.
> 
> ...
> 
> Thanks for finding and reporting the bug!

Thanks for the clear reply!  I'll raise a ticket on Tuesday (which will be my 
next opportunity to do so).

Best,

-Andy

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/34C1DC1A-6658-4F7E-BB01-B6FFDBB43241%40barefootcode.com.
For more options, visit https://groups.google.com/d/optout.


Bug? Infinite migrations with empty help_text and ugettext_lazy

2015-06-04 Thread Andy Gimblett
Hi all,

I've come across something which might possibly be a Django bug, but I wanted 
to raise it here first in case I'm missing something, or this is expected 
behaviour.

There's a fuller explanation and easily runnable example here:

https://github.com/gimbo/django-ugettext_lazy_migrations

In short, given the following model (note the empty help_text string),

from django.db import models
from django.utils.translation import ugettext_lazy as _

class X(models.Model):
y = models.CharField(help_text=_(''), max_length=10)

repeated calls of "manage.py makemigrations" will, after the initial migration, 
produce an infinite series of new migrations, each of which contains an 
AlterField, but which does nothing.  The expected behaviour would be to produce 
an initial migration and then no further migrations, of course.

The problems goes away if you do any of the following:

* Remove the help_text parameter
* Use a non-empty help_text
* Don't internationalise the help_text value
* Use ugettext instead of ugettext_lazy (which, I understand, you shouldn't)

I've reproduced it on all released 1.8.x Django versions up to 1.8.2, but it 
doesn't exhibit on any 1.7.x versions I've tried.
I haven't tried any development versions.

Can anyone provide any insight?  Is this worth raising a bug over?

Thanks!

-Andy

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8D0F0BD9-998E-43E1-96B1-036960142724%40barefootcode.com.
For more options, visit https://groups.google.com/d/optout.


Re: Two Django projects with common models and business logic

2014-12-24 Thread andy
Thank you. Since it's only me that'd be using the apps do can I bypass the 
'deploy using pip' thing and somehow directly use it in my other projects?

/andy

On Wednesday, December 24, 2014 12:41:25 AM UTC+5:30, Javier Guerra wrote:
>
> On Tue, Dec 23, 2014 at 1:22 PM, andy > 
> wrote: 
> > Now, both the projects have some models and some business logic common 
> > between them. I don't want to duplicate the code and data which shall be 
> > chaotic going forward. Also, I want the models and code (business logic) 
> to 
> > be in sync (when models/code is altered). 
>
>
> encapsulate those models and code in reusable apps.  and since Django 
> apps are just Python modules, you can package and deploy them using 
> Python tools like pip. 
>
> -- 
> Javier 
>

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4448040a-6db8-4558-ac30-e559d57fce6c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Two Django projects with common models and business logic

2014-12-23 Thread andy


Hi,

I have two Django Projects that have different use cases. There are reached 
using different domains. They are hosted in two different servers. Also 
each Django project has it's own database.

Now, both the projects have some models and some business logic common 
between them. I don't want to duplicate the code and data which shall be 
chaotic going forward. Also, I want the models and code (business logic) to 
be in sync (when models/code is altered).

Can anyone guide me towards a pattern that can help me attain the required 
architecture: 2 separate projects with common models and business logic.

Thanks in advance.

/andy

P.S. This is my first post. So pardon me for breaking any forum etiquette.

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ae6f4561-bd32-463b-820e-d66c68412575%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How do I migrate models from one app to another with django 1.7 migrations?

2014-11-04 Thread Andy Kish
Hi gang,

I'm trying to refactor the apps in my project, and I can't figure out any 
clean way to migrate models with their data from one app to another. I'm 
really looking for answers to two questions:

1. Is there any canonical way to do this?

2. I've moved my models to the new app but I have them using the tables 
from the old app using Meta.db_table. How do I make migrations understand 
what's going on and not try to delete my old tables? Once migrations gets 
what's going on, how do I rename the old table so it fits the new app name 
so I no longer need Meta.db_table?

--

For question 1. I'm really surprised there isn't a good way to do this. I 
mean—this is kind of a blatant use case for a migration—moving a model from 
one app to another.

My initial thought was to use a use a three phase migration. Create new 
models, copy data over, delete old models. But I'd really rather not 'cause 
the models are all very interconnected and that seems like a recipe for a 
foreign key disaster.

What I actually went with was to move all the models over to the new app, 
and then point them at the old tables using Meta.db_table. Everything 
works, but when I run makemigrations it is confused as crap and wants to 
destroy everything, which brings me to question 2...

---

So question 2, now that I have my model code in a new app pointing at the 
old tables, how do I get the tables renamed to use canonical table names 
and let migrations know wtf is going on?

With the current situation, if I run makemigrations it does something like 
this

Migrations for 'new_app':
  0001_initial.py:
- Create model Building
...
- Add field contact to building
...
Migrations for 'old_app':
  0006_auto_delete_blah.py:
- Remove field contact from building
...
- Delete model Building

...


all of which is roughly correct, just doesn't keep my data intact. :P

My gameplan (*please *correct me if any of this is wrong) is to:

1. Fake the ('new_app', '0001_initial') migration.
2. Make a new data migration depending on ('new_app', '0001_initial') and 
the ('old_app', '0005_...') that uses AlterModelTable 
<https://docs.djangoproject.com/en/1.7/ref/migration-operations/#altermodeltable>
 to 
rename the tables to their canonical names as would normally be created by 
the 0001_initial migration.
3. Fake the ('old_app', '0006_auto_delete_blah')migration.
4. Get rid of the Meta.db_table entries so my moved models just use the 
normal table names they're supposed to.

Seems like it should get me to where I want to go.


Am I smoking crack? Is this really that hard?


Thanks!
Andy.

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/63151710-6cde-429b-9af7-09de397704cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Tutorial #5 Testing: return Poll.objects.filter( SyntaxError: 'return' outside function

2014-09-16 Thread Andy McKay
You've got a syntax error in your code, likely wherever you have
"return Poll.objects.filter(" in your code.

"Outside a function" likely means that you have not correctly indented
your code, for example if your return has no indentation. Whitespace
in Python is significant and is part of the syntax.

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOjXX8bs%2BJqNcGbpFpDOgxg8KnTy0R-x5%2BR2UXTQr36eRg7JBA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django migrations and DateTimeField defaults

2014-08-13 Thread Andy Roxby
Thanks, that's what I did.  In my humble opinion, the ValueError should be 
removed and the timezone serialized in the form UTC offset (eg: -0400).

On Tuesday, August 12, 2014 9:43:11 PM UTC-4, Collin Anderson wrote:
>
> Wow. That almost sounds like a bug, though you can however use a callable. 
> As ridiculous as it looks, it should work :).
>
> INF_TIME = datetime.max.replace(tzinfo=timezone.utc)
>
> def get_inf_time():
> return INF_TIME
>
> death = models.DateTimeField(default=get_inf_time)
>
> What you are doing seems pretty rare, though it seems maybe that error 
> message should not be recommending a naive datetime.
>
>

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5301ae6b-078b-41cb-9bda-9167b1928681%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django migrations and DateTimeField defaults

2014-08-12 Thread Andy Roxby
Hello all,
I'm new to this list so please let me know I'm overlooking any sort of e
tiquette.
I'm having problem trying to use a default value for a DateTimeField.  When 
I specify a default value WITH a timezone I receive the following error 
during './manage.py makemigrations'

ValueError: Cannot serialize datetime values with timezones. Either use a 
callable value for default or remove the timezone.

However, if I remove the timezone I receive the following warning during 
'migrate'

RuntimeWarning: DateTimeField Verification_link.redeemed received a naive 
datetime (-12-31 23:59:59.99) while time zone support is active.

I'm just a little confused, I'm crafting a work-around but I would like to 
know what the correct solution is.  Any help would be appreciated.

Code:
from datetime import datetime
from django.utils import timezone

INF_TIME=datetime.max.replace(tzinfo=timezone.utc)

class SomeModel: death = models.DateTimeField(default=INF_TIME)

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6897ba3c-c93e-4dba-8218-a6eb992a8f7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: What are the active Django e-commerce frameworks right now (2014)?

2014-04-28 Thread Andy Robinson
I second the recommendation for Stripe.

I have no need for shopping carts but suffered for years dealing with 
credit card payments for license renewals.  Many solutions were running 
into problems with foreign banks blocking payments (which the payment 
solution can't do anything about), spurious rejections and so on.  I 
discovered Stripe and had it running in literally a couple of hours, and we 
have never had an issue with an incorrectly blocked payment.   
 Business-wise, the alternatives needed months of form-filling with payment 
providers, merchant accounts, PCI-DSS certificate vendors.  It is 
ridiculously easy to get up and running with Stripe and just make an HTML 
button for each product you want to sell.


On Saturday, April 26, 2014 5:44:21 PM UTC+1, Jared Nielsen wrote:
>
> Check out Stripe. Not a framework, but very easy to implement with Django. 
>
> On Saturday, April 26, 2014 4:57:51 AM UTC-6, Brutus Schraiber wrote:
>>
>> Thanks 'somecallitblues' I will definitely take a closer look at Mezzanine 
>> and Cartridge.
>>
>> But I'm kinda baffled. Only one answer after two weeks?
>>
>> Sure webshops might not be the hot topic anymore than they where a good 
>> couple of years ago, and most people just use PHP and Magento anyway, but 
>> still?
>>
>> Was my question too long? Is this the wrong place to ask such questions?
>>
>> I know I generally should use stackoverflow etc. first, but this is not 
>> the kind of question thats welcome there...
>>
>> Any chance I get some more opinions on this? Or hints where I can get 
>> such?
>>
>

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/da185c4c-5279-4b5b-92b8-2347bc9454a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


ANN: ReportLab PLUS 3.1 - rapid PDF creation for Django sites

2014-04-28 Thread Andy Robinson
ReportLab are pleased to announce the release of the Python 3-compatible 
version of our PDF generation toolkit.   

After an extensive rewrite, our framework now runs under Pythons 2.7, 3.3 
and 3.4; and both the open source and commercial tools can be installed 
with pip and managed from requirements files.

We have been using Django ourselves for 8 years now, and our Django-powered 
solutions powers some of the biggest dynamic PDF generation solutions on 
the net.  See who ReportLab work with<http://www.reportlab.com/casestudies/>

Many of you will know the open source ReportLab PDF Toolkit.  ReportLab 
PLUS, which sits on top of it, lets you develop attractive documents very 
quickly directly from your Django solution.   
   - code PDF templates in a high level markup language, the same way you 
make your web templates
   - include professionally designed artwork and background pages with a 
single tag using our PageCather technology
   - create business and custom graphics with identical style in print and 
web using our Diagra charts


The ability to create personalised, publication quality PDF documents from 
a CMS in real time is a game-changer, opening new communication channels 
and allowing clients to streamline work and save on print.

ReportLab PLUS can be tried freely 
<http://www.reportlab.com/reportlabplus/>with a nag line, but needs an annual 
subscription before production use. We 
are happy to provide support, mentoring and a design-and-build service.  

Find out more... <http://www.reportlab.com/reportlabplus/>

Andy Robinson
CEO / Chief Architect
ReportLab

 

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/805adf45-f65e-45e8-bb69-e4e6ed24c360%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: memcached and redis

2014-03-01 Thread Andy McKay
On Sat, Mar 1, 2014 at 12:39 PM, Andreas Kuhne
wrote:

> The main difference is that you can use redis as a session cache for
> django (save the session objects to memory instead of the database), which
> I haven't found a solution for memcache yet.
>

Memcache works just fine as a session backend:

https://docs.djangoproject.com/en/dev/topics/http/sessions/#using-cached-sessions

Andy

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOjXX8aCOZXQcVkb%3Dfk%2BcJtgphAJdY%2BrUAC7aDVnMEDWFq2Vgg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Vancouver Python Day - Tickets on sale Friday

2013-10-23 Thread Andy McKay
We're pleased to announce that tickets for Vancouver Python Day will be
released on Friday, October 25 at 10AM. You can purchase tickets at
http://vanpyday.eventbrite.com/

Space is extremely limited, so we advise buying your tickets as early as
possible if you plan to attend. Thanks to our generous sponsors, tickets
will be priced very affordably.

We've also just released the list of scheduled talks. Visit
http://www.vanpyday.com/ to view the list of speakers, and to learn more
about the event.

Finally, we're really happy to announce that A Thinking Ape, OpenRoad
Communications, and Mobify have stepped up to sponsor this event. Vancouver
Python Day would not be possible without their support.

Hope to see you at the conference!

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOjXX8bBQgBcfnT75muG8ja0FJMvOfTNEpUkUzaCGWtrrnhEmQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Django Software Foundation minutes

2013-10-14 Thread Andy McKay
Just wanted to make people aware that each month the board of the Django
Software Foundation meets. The minutes of each meeting are published here:

https://www.djangoproject.com/foundation/records/

If there's anything you'd like discussed at the next board meeting, please
contact us at:

https://www.djangoproject.com/contact/foundation/

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOjXX8YiyMUT5ROusPPJNW%2BWpMZ7YFuNRZ30ccBH6WRNYz8rvw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Vancouver Python Day - Talk Proposal Deadline

2013-10-14 Thread Andy McKay
Hi Djangonauts!

We've just set the deadline for Vancouver Python Day talk proposal
submissions. All talk proposals must be submitted by *Thursday, October 17,
2013 at 23:59 Pacific Time*. See
https://github.com/andymckay/vancouver-python-day for instructions on
submitting a talk proposal. All Python-related topics are welcome --
including Django!

In case you haven't heard, *Vancouver Python Day* is a one-day mini
conference celebrating the Python Developer Community in Vancouver. It will
be held on *Saturday, November 16, 2013* at SFU Harbour Centre. Stay tuned
for another announcement soon regarding ticket availability. In the
meantime, mark your calendar!

Andy

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOjXX8a10jJiwLctOrGSOwCzNZWPN6gNe-%2BFK34tw2d2dkSvWA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Vancouver Python Day

2013-09-30 Thread Andy McKay
The Vancouver Python User Group and the Vancouver Django Meetup Group are
pleased to announce:

Vancouver Python Day
Saturday, November 16, 2013
SFU Harbour Centre

Part of Vancouver Developer Week 2013, Vancouver Python Day is a one-day
mini conference celebrating the Python Developer Community in Vancouver.

We hope to have talks covering a wide variety of Python development, from
web development to gaming to performance and optimization. To that end,
we're currently seeking talk proposals. Please visit
https://github.com/andymckay/vancouver-python-day and submit your proposal
today.

Tickets will be offered for a nominal fee; we'll be sending another
announcement before tickets go on sale. In the meantime, please mark your
calendars!

More information on Vancouver Python Day:
http://www.vanpyday.com/

More information on Vancouver Developer Week:
http://vancouver.devweek.org/

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOjXX8byc%2BVWV6Eu3m_f6ZykPdnF%3Dd7mra4BJkUjdhSy9CDX1g%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Passing variables to css file in django

2013-08-25 Thread Andy McKay
Any string can be rendered as a template. This is covered pretty well in
the docs:

https://docs.djangoproject.com/en/dev/ref/templates/api/

For example:

>>> from django.template import Context, Template
>>> t = Template("body { background-color: {{ bgcolor }} }")
>>> c = Context({'bgcolor': '#999'})
>>> t.render(context=c)
u'body { background-color: #999 }'

However, CSS is served fastest if it's static and on a CDN and not using a
template and CPU resources to render.

-- 
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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Friendship model

2013-08-08 Thread Andy McKay
On Thu, Aug 8, 2013 at 12:41 PM, Robin Lery  wrote:

> How do i create a Friendship model? Please guide me.
>

You would need to provide more detail to get much help. The tutorial covers
how to make models:

https://docs.djangoproject.com/en/dev/intro/tutorial01/

-- 
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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




  1   2   3   4   5   6   7   >