Re: request to post UnboundLocalError

2022-10-24 Thread Yusuf Olamilekan muktar
Hello,

The variable 'contact' on line 27 is messing with python as the model name
'contact' is not being recognized but instead, the variable is being
recognized.
I'd advise you to change the variable name. i.e.
contact = contact()
to
contact_var = contact(...)
contact_var.save()



[image: Mailtrack]

Sender
notified by
Mailtrack

10/24/22,
09:04:18 AM

On Sun, Oct 23, 2022 at 8:22 PM Deepak kumar  wrote:

> please check to pdf and send to my email dk9284...@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/ce32825e-f275-4735-af27-6626e19f60ban%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/CAKvf1-pLy-jzv438t%2BOPiJV8UiomS3N2COi3s7Otgszu261LrQ%40mail.gmail.com.


Re: request to post UnboundLocalError

2022-10-23 Thread Jitendra kumar Patra
Declare the contact variable before the return statement

On Mon, 24 Oct, 2022, 00:52 Deepak kumar,  wrote:

> please check to pdf and send to my email dk9284...@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/ce32825e-f275-4735-af27-6626e19f60ban%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/CAOAROfmd65WqGZVtGh2MPsa0q1G5rC9BAP%2BnL%3DSNgROR9%3DaMww%40mail.gmail.com.


Re: Request for guidance of using Social-auth-app django

2020-12-09 Thread Shahprogrammer
Check this out
https://github.com/omab/django-social-auth

On Wednesday, 9 December 2020 at 19:49:50 UTC+5:30 
professional...@gmail.com wrote:

> Dear All 
>
> Can anyone help for implementing social-auth-app-django package for social 
> authenication of facebook, google and apple ID. 
>
> Its very urgent...
>
> Looking forward for earliest response...
>
> Regards
>
> Atif Usman
>

-- 
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/98bd37e2-63ab-4d62-813e-a83131fac6bcn%40googlegroups.com.


Re: Request for admins

2020-10-14 Thread Damanjeet Singh
I agree with you.

On Sun, 11 Oct 2020, 21:14 o1bigtenor,  wrote:

> Greetings
>
> The list volume seems to have attracted those that purport to offer
> help or services.
>
> Is it possible that the volume of this has reached a point where there
> is a separate list for just that.
> That would be a separate subscription to a list where if one wanted to
> either use or offer services one was free to do so. The second part of
> that would be that if one overtly did the same on the 'users' list one
> would be either punted or at the very least put on controlled listing.
>
> This request is stemming from the 40 or 50 emails polluted by a listee
> who seems to think that attaching his business card or better its
> written equivalent to every thread is going to get him business. Mine
> - - - - never - - - - I don't do business that way.
>
> Hoping that this request isn't too far off topic!
>
> Regards
>
> --
> 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/CAPpdf59qjGznmqJTbpHe6c8t0_GoTn6O8bs6agggPA6Zbx8EMQ%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/CAGLHGi6PnAvLP4YyCmvuyGoawx%3D7mER4sXkb0spGXvaY6i669g%40mail.gmail.com.


Re: Request for admins

2020-10-12 Thread Kasper Laudrup

On 12/10/2020 14.52, Theresa Taye wrote:
I agree with you, only that adding him to spam is not enough because I 
noticed reasonable mails from people that he replies to also go to the 
spam box.




Since the asshole in question is using a gmail account, I think the 
correct thing to do is to report the abuse to Google:


https://support.google.com/mail/contact/abuse

I have done just that, maybe if others will do the same we can at least 
hope to get the losers account closed.


It probably doesn't make much difference, but it's better than nothing I 
guess.


Kind regards,

Kasper Laudrup

--
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/48eed9c9-3ebd-b786-f839-6af776991c77%40stacktrace.dk.


Re: Request for admins

2020-10-12 Thread Theresa Taye
I agree with you, only that adding him to spam is not enough because I
noticed reasonable mails from people that he replies to also go to the spam
box.
On Oct 11, 2020 21:14, "o1bigtenor"  wrote:

> Greetings
>
> The list volume seems to have attracted those that purport to offer
> help or services.
>
> Is it possible that the volume of this has reached a point where there
> is a separate list for just that.
> That would be a separate subscription to a list where if one wanted to
> either use or offer services one was free to do so. The second part of
> that would be that if one overtly did the same on the 'users' list one
> would be either punted or at the very least put on controlled listing.
>
> This request is stemming from the 40 or 50 emails polluted by a listee
> who seems to think that attaching his business card or better its
> written equivalent to every thread is going to get him business. Mine
> - - - - never - - - - I don't do business that way.
>
> Hoping that this request isn't too far off topic!
>
> Regards
>
> --
> 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/CAPpdf59qjGznmqJTbpHe6c8t0_GoTn6O8bs6agggPA6Zbx8EMQ%
> 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/CAENBRfO43MZWrdYP_uRSXeYnxW%2BZfi%3DbbJvh%2BjeFT%2BaBkf3EvA%40mail.gmail.com.


Re: Request for admins

2020-10-11 Thread o1bigtenor
On Sun, Oct 11, 2020 at 3:20 PM Agnese Camellini
 wrote:
>
> I full aree with you. This is spamming!
>

I agree and that address is listed as spam for my mail system.
As I thought about it there are legitimate offers and requests for service so
didn't want to preclude those - - - that is what prompted the idea of
a separate
list although its going to make work for an admin - - -  :-( !!

Regards

-- 
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/CAPpdf59KA27xORFB1SktUTN0pCA3oFWWqHd1j1mbGE%2Bij9wKnw%40mail.gmail.com.


Re: Request for admins

2020-10-11 Thread Agnese Camellini
I full aree with you. This is spamming!

Il Dom 11 Ott 2020, 22:14 o1bigtenor  ha scritto:

> Greetings
>
> The list volume seems to have attracted those that purport to offer
> help or services.
>
> Is it possible that the volume of this has reached a point where there
> is a separate list for just that.
> That would be a separate subscription to a list where if one wanted to
> either use or offer services one was free to do so. The second part of
> that would be that if one overtly did the same on the 'users' list one
> would be either punted or at the very least put on controlled listing.
>
> This request is stemming from the 40 or 50 emails polluted by a listee
> who seems to think that attaching his business card or better its
> written equivalent to every thread is going to get him business. Mine
> - - - - never - - - - I don't do business that way.
>
> Hoping that this request isn't too far off topic!
>
> Regards
>
> --
> 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/CAPpdf59qjGznmqJTbpHe6c8t0_GoTn6O8bs6agggPA6Zbx8EMQ%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/CACXuh-RnZj-ejb5hzpMrf9%3DRUte%3Dks15pUHXZJ3DxrzngtarnQ%40mail.gmail.com.


Re: Request to be added to the Django organisation on GitHub

2020-04-08 Thread Nwaobi Daniel
Thanks

On Wed, Apr 8, 2020, 5:36 PM Dylan Reinhold  wrote:

> If you are looking to contribute to django please see :
> https://docs.djangoproject.com/en/dev/internals/contributing/
>
> If you just want to use it and code with it, see
> https://www.djangoproject.com/start/
>
> Regards,
> Dylan
>
> On Wed, Apr 8, 2020 at 9:08 AM Nwaobi Daniel 
> wrote:
>
>> Hi! Goodday,
>>
>> I would love to be part of the django organisation on GitHub, if it's
>> possible though. My username is CrazyChickenDev on github and i would
>> really appreciate it if my request is considered.
>>
>> 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/a40e98a6-d60a-4760-b103-e8a469cbe6ee%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/CAHtg44DdESYcjowhSgnVaFPjLCCzUqcyYDxZ_RetDg%2BK%3D%3D7T6g%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/CANMiDf9icOWGoAGNue5Cw562vD%2Bj%2Bz0twqufOrtR2aW-uLJizQ%40mail.gmail.com.


Re: Request to be added to the Django organisation on GitHub

2020-04-08 Thread Dylan Reinhold
If you are looking to contribute to django please see :
https://docs.djangoproject.com/en/dev/internals/contributing/

If you just want to use it and code with it, see
https://www.djangoproject.com/start/

Regards,
Dylan

On Wed, Apr 8, 2020 at 9:08 AM Nwaobi Daniel  wrote:

> Hi! Goodday,
>
> I would love to be part of the django organisation on GitHub, if it's
> possible though. My username is CrazyChickenDev on github and i would
> really appreciate it if my request is considered.
>
> 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/a40e98a6-d60a-4760-b103-e8a469cbe6ee%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/CAHtg44DdESYcjowhSgnVaFPjLCCzUqcyYDxZ_RetDg%2BK%3D%3D7T6g%40mail.gmail.com.


Re: Request to disallow using django name in third party django packages name

2020-02-20 Thread אורי
It's very useful that packages that use Django also include "django" in
their names. I don't think there is any reason to disallow it.

בתאריך יום ה׳, 20 בפבר׳ 2020, 14:23, מאת Abhilash Nair ‏:

> Hi everyone,
>
> I am new to Django. Whenever I try to search for way to implement certain
> ideas using django, most of the results are of using the third party django
> apps. As of now I am not interested in using the third party django apps.
> For example I was try implement rest api using django alone. Most of the
> google search results where of using DRF(django rest framework). I tried to
> implement otp based authentication. Again most of the google search results
> are django-otp-official package. Similarly I was looking to implement token
> based authentication. Again most of the results are using DRF. I understand
> these third party apps are providing many of the thing I want. But problem
> is I don't want to use them and want to implement using just Django. And
> resources for that are available but they get hidden in the avalanche of
> these third party django packages dominating all the search results. My
> request  is to disallow third party packages to contain django in their
> package name. Guys let me know your thoughts.
>
> Thanks and Regards
> AB Nair
>
> --
> 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/b31e5d32-1a7d-4000-9bff-36b97410cabf%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/CABD5YeE0jFLqA%3D-wR0J6FkdYrwKAwo4j6QnmY%3DhEOoUe8fXBfQ%40mail.gmail.com.


Re: Request to disallow using django name in third party django packages name

2020-02-20 Thread Omkar Parab
All the third party apps are open source. Codes are available on github.
You can create your own. Just like you, they've also created, and kept
public.

On Thu, Feb 20, 2020, 6:57 PM 'Artem Vasin' via Django users <
django-users@googlegroups.com> wrote:

> Hi!
>
> *Tl;dr no I don’t think so, actually it’s very useful.*
>
> IMHO, you are barking at the wrong tree. As I see it, and I think many
> would agree with me, using third-party libraries instead of implementing
> your own, are the way to go in Django and Python and open-source community
> in general. It gives you advantages of not wasting your time writing
> something that already exists from scratch and focus more of business-logic
> of your project instead of technical things like organising auth or
> request-response handling (something for which we using Django in first
> place).
>
> Why it may be fun and educational to write something like your own auth
> system or rest-api from scratch and probably you should really at least try
> something like that when you learning Django or any other framework, you
> probably should not do so, when developing application which is more then
> study project. Using third-party apps not only saves your time, but
> provides you with some advantages over something written from scratch. For
> example you talking about authentication. Are you sure that your
> self-written library is really secure? Is it tested better than result of
> work and debugging of several people (or in case of DRF baby people) over
> the course of multiple years? Will it work with different versions of
> python or Django, which you can be forced to use in other projects or you
> should write another version if you will need to use older python or
> Django? Will someone help you with problem in your library or they simple
> say 'You should have used  be to take what you write in one project and use in another? Etc.
>
> As I see it, modern day programming is not about writing from scratch and
> more about knowing which libraries you can use and when and how use them. I
> think that most of programmers, using Django for serious projects actually
> very happy every time when they can use third-party library to add some
> functionality in project.
>
> Now about third-party-app naming. Actually I think that in contrary to
> your position all third-party Django apps’ names *should* start with
> *django-. *
> *Firstly*, it really helps in finding third-party apps in google, and as
> I say earlier using third-party libraries instead of writing everything
> from scratch is python way as I see it.
> *Secondly* it helps differentiating Django apps from other libraries in
> PyPI, GitHub or others list of libraries. For example we have app^ which
> allows authorise Django user through ldap. If we call it simply auth-ldap
> it may be named the same is some more general ldap auth library in PyPI and
> we could not publish it here. Naming it Django-auth-ldap decreases chance
> of this collision.
> *Thirdly*, this naming implies that this library designed to work only in
> concert with django. Many of Django third-party app would not work without
> Django core packages, or such a small part of them will be useful, so
> including this app in your project will bring a lot of overhead.
> *And lastly*, this naming helps you understand what this package is when
> you see it somewhere in *requirements.txt *or in *pip freeze* output.
>
> Now to address your problem about trying to write something from scratch
> and finding only third-party libraries. If you writing something like auth
> system in production system may be it’s real better to use already existing
> and tested third-party library. But if you want to write something from
> scratch to deeper your understanding of Django or programming in general,
> that’s actually a wonderful idea, wish more of my colleagues do something
> like that in their free time. So how to do it, when google only wants to
> show you third-party libraries?
>
> Try to add words like *«from scratch» *or* «without third-party apps» *in
> your search query. There is plenty of posts in internet where someone
> writes about how to implement something without adding new dependencies.
>
> And why do you think, that third-party apps is useless when writing
> something from scratch? Actually no one forbids you to open GitHub of
> third-party app doing something that you trying to write and read it’s
> code. Most of big de-facto-standart libraries, like DRF is actually well
> written and you even can get something from their sources, of which you
> didn’t even think. You can even try to contact authors and ask them, why
> they did something the way it is. I think that you can learn something new
> that way.
>
> So no, I don’t think that *django- *prefix is as big problem as you
> trying to make it. Actually, I think that when you start write something
> meant to work in production and solve someone problems you will be very
> glad for that 

Re: Request to disallow using django name in third party django packages name

2020-02-20 Thread 'Artem Vasin' via Django users
Hi!

Tl;dr no I don’t think so, actually it’s very useful.

IMHO, you are barking at the wrong tree. As I see it, and I think many would 
agree with me, using third-party libraries instead of implementing your own, 
are the way to go in Django and Python and open-source community in general. It 
gives you advantages of not wasting your time writing something that already 
exists from scratch and focus more of business-logic of your project instead of 
technical things like organising auth or request-response handling (something 
for which we using Django in first place).

Why it may be fun and educational to write something like your own auth system 
or rest-api from scratch and probably you should really at least try something 
like that when you learning Django or any other framework, you probably should 
not do so, when developing application which is more then study project. Using 
third-party apps not only saves your time, but provides you with some 
advantages over something written from scratch. For example you talking about 
authentication. Are you sure that your self-written library is really secure? 
Is it tested better than result of work and debugging of several people (or in 
case of DRF baby people) over the course of multiple years? Will it work with 
different versions of python or Django, which you can be forced to use in other 
projects or you should write another version if you will need to use older 
python or Django? Will someone help you with problem in your library or they 
simple say 'You should have used  20 февр. 2020 г., в 09:35, Abhilash Nair  написал(а):
> 
> Hi everyone,
> 
> I am new to Django. Whenever I try to search for way to implement certain 
> ideas using django, most of the results are of using the third party django 
> apps. As of now I am not interested in using the third party django apps. For 
> example I was try implement rest api using django alone. Most of the google 
> search results where of using DRF(django rest framework). I tried to 
> implement otp based authentication. Again most of the google search results 
> are django-otp-official package. Similarly I was looking to implement token 
> based authentication. Again most of the results are using DRF. I understand 
> these third party apps are providing many of the thing I want. But problem is 
> I don't want to use them and want to implement using just Django. And 
> resources for that are available but they get hidden in the avalanche of 
> these third party django packages dominating all the search results. My 
> request  is to disallow third party packages to contain django in their 
> package name. Guys let me know your thoughts.
> 
> Thanks and Regards
> AB Nair
> 
> 
> -- 
> 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/b31e5d32-1a7d-4000-9bff-36b97410cabf%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/5DA146E1-AABC-42E7-8341-9D03867BD7E3%40me.com.


Re: Request for an internship

2020-01-09 Thread neha somani
Can u pl send me your detailed CV

On Thu, 9 Jan 2020, 9:48 am Bryan Maxx,  wrote:

> I'm looking for an internship in the field of ICT,IT,MEDICINE, and
> PHYSICS. Incase you can offer or know of one, kindly inform me. 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/CAKHMJxqsoiEBApTE9vi65SDifZpU_vw%2BAz7j1EjzCGovJp8zUw%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/CA%2BjbrPBXBagS51%2BpConB1_ta7pfif659Stac%3Doec4f83pEG3pA%40mail.gmail.com.


Re: Request

2019-11-16 Thread Integr@te System
Hi Guy,

Plz see community with people for help in specific problem by sharing
knowledges or contract with selected person for your project then get help
here.

On Sat, Nov 16, 2019, 19:27 Motaz Hejaze  wrote:

> Search man
>
> On Sat, 16 Nov 2019, 1:39 pm Tosin Ayoola,  wrote:
>
>> Hey guy, need a little help on developing a school management system
>> project, can I get a github repo link,  to get little help
>>
>> --
>> 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/CAHLKn72828L84ELxosumJ2UxcujJrNmwfbe-wNJkroN_uZiR%2Bg%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/CAHV4E-cCm9KqDYAjfz%3DwY-ntuE_BNKgOfy1KdP6RLP106t1UpA%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/CAP5HUWq_ZPEO23hjtRucrDuJdeV5y3SEp1RVtLLfpDZEaoi_QQ%40mail.gmail.com.


Re: Request

2019-11-16 Thread Motaz Hejaze
Search man

On Sat, 16 Nov 2019, 1:39 pm Tosin Ayoola,  wrote:

> Hey guy, need a little help on developing a school management system
> project, can I get a github repo link,  to get little help
>
> --
> 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/CAHLKn72828L84ELxosumJ2UxcujJrNmwfbe-wNJkroN_uZiR%2Bg%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/CAHV4E-cCm9KqDYAjfz%3DwY-ntuE_BNKgOfy1KdP6RLP106t1UpA%40mail.gmail.com.


Re: Request to provide the details of how to integrate django app with selenium chrome web driver

2019-10-02 Thread Dilipkumar Noone
Hi,

Can some one please share where to place a chrome driver [.exe] file in a
django project which launches a webpage to perform click operations using
selenium.

Please share any document or videos for the same,

Regards,
N.Dilip kumar.

On Wed, Oct 2, 2019 at 3:15 PM Dilipkumar Noone  wrote:

> Dear Deep L Sukhwani,
>
> The below statement clarifies my doubt.
>
> 
> Here, your Django app is running on a different process and you are
> triggering selenium job separately.
>
> 
>
> Thanks & Regards.
> N.Dilip Kumar.
>
> On Wed, Oct 2, 2019 at 10:23 AM Deep Sukhwani 
> wrote:
>
>> Still not clear on what is the automation task. From your original
>> questions:
>>
>> 1.Under one tab ,provide a button name "ApplyGSP"
>>> 2.click on "ApplyGSP" button should open a form ,which required below
>>> input from the user.
>>>
>>>*a)*model_no* b)*model_name *c)*os_version *d)*requested_time *e)*
>>> user *f)from_sas_url g) to_sas_url etc.*
>>>
>>> *3.*once the user submitted the FORM with all the fields from step2,
>>> your app should open a browser with the user specified URL from 
>>> f)*from_sas_url
>>> field* in step2.
>>> 4.Perform few click operations using selenium webdriver.
>>>
>>5.copy the list of records from f) to g)
>>
>> These indicate that you want to perform a particular task using selenium.
>>
>> What is the other task you are trying to run simultaneously for which you
>> want to run the selenium job using celery.delay()?
>>
>> My full understanding is:
>>
>>- You will develop a Django application that meets the
>>above requirements
>>- That Django application will certainly be in running state (only
>>then you will be able to perform visual automation on it)
>>- You will then run a selenium job on the above running Django
>>application.
>>- Here, your Django app is running on a different process and you are
>>triggering selenium job separately.
>>- If on the other hand, the only reason you want to run a Django app
>>is to do the selenium task and then shutdown the Django app altogether, 
>> you
>>can put the whole thing in a single bash script which essentially:
>>   - Starts your Django application using gunicorn or direct call to
>>   runserver or whichever way you want it to run
>>   - Checks that the Django application is up and running
>>   - Triggers the Selenium flow
>>   - If selenium flow returns exit 0 - gets out and shuts down the
>>   Django application
>>
>> Is the above correct expectation correct?
>>
>> --
>> Regards
>> Deep L Sukhwani
>>
>> ᐧ
>>
>> On Tue, 1 Oct 2019 at 23:08, Dilipkumar Noone  wrote:
>>
>>> Hi,
>>>
>>> If i use selenium webdriver regular way in my django app, will it not
>>> cause time consuming to perform the automation task on chrome webdriver ?
>>> So to save the time , can i launch browser and perform automation task
>>> using celery delay() method.
>>>
>>> Regards,
>>> N.Dilip Kumar.
>>>
>>> On Tuesday, October 1, 2019 at 4:13:51 AM UTC+5:30, Deep Sukhwani wrote:

 What exactly do you want to use celery for?

 Using selenium webdriver the regular way should suffice here.
 Regarding copying from one field and pasting into another, you might be
 able to work with .get_text() method in selenium to read text from one
 field, store it in a variable and then .send_keys() to write that text into
 another field.

 *Note: This is a good question for selenium community and you should
 consider posting it there or on Stack overflow with selenium webdriver tag*

 On Mon, Sep 30, 2019, 21:29 Dilipkumar Noone  wrote:

>
>
> On Monday, September 30, 2019 at 9:22:16 PM UTC+5:30, Dilipkumar Noone
> wrote:
>>
>> I am new to Django.
>>
>> I  have a requirement to develop a django application with the
>> requirement as stated below:
>>
>> 1.Under one tab ,provide a button name "ApplyGSP"
>> 2.click on "ApplyGSP" button should open a form ,which required below
>> input from the user.
>>
>>*a)*model_no* b)*model_name *c)*os_version *d)*requested_time *e)*user
>> *f)from_sas_url g) to_sas_url etc.*
>>
>> *3.*once the user submitted the FORM with all the fields from step2,
>> your app should open a browser with the user specified URL from 
>> f)*from_sas_url
>> field* in step2.
>> 4.Perform few click operations using selenium webdriver.
>>
>5.copy the list of records from f) to g)
>
> Please provide your suggestion how to perform this task in a better
> way.
>
> can i use celery application and launch the browser and perform the
> click 

Re: Request to provide the details of how to integrate django app with selenium chrome web driver

2019-10-02 Thread Dilipkumar Noone
Dear Deep L Sukhwani,

The below statement clarifies my doubt.

Here, your Django app is running on a different process and you are
triggering selenium job separately.


Thanks & Regards.
N.Dilip Kumar.

On Wed, Oct 2, 2019 at 10:23 AM Deep Sukhwani 
wrote:

> Still not clear on what is the automation task. From your original
> questions:
>
> 1.Under one tab ,provide a button name "ApplyGSP"
>> 2.click on "ApplyGSP" button should open a form ,which required below
>> input from the user.
>>
>>*a)*model_no* b)*model_name *c)*os_version *d)*requested_time *e)*
>> user *f)from_sas_url g) to_sas_url etc.*
>>
>> *3.*once the user submitted the FORM with all the fields from step2,
>> your app should open a browser with the user specified URL from 
>> f)*from_sas_url
>> field* in step2.
>> 4.Perform few click operations using selenium webdriver.
>>
>5.copy the list of records from f) to g)
>
> These indicate that you want to perform a particular task using selenium.
>
> What is the other task you are trying to run simultaneously for which you
> want to run the selenium job using celery.delay()?
>
> My full understanding is:
>
>- You will develop a Django application that meets the
>above requirements
>- That Django application will certainly be in running state (only
>then you will be able to perform visual automation on it)
>- You will then run a selenium job on the above running Django
>application.
>- Here, your Django app is running on a different process and you are
>triggering selenium job separately.
>- If on the other hand, the only reason you want to run a Django app
>is to do the selenium task and then shutdown the Django app altogether, you
>can put the whole thing in a single bash script which essentially:
>   - Starts your Django application using gunicorn or direct call to
>   runserver or whichever way you want it to run
>   - Checks that the Django application is up and running
>   - Triggers the Selenium flow
>   - If selenium flow returns exit 0 - gets out and shuts down the
>   Django application
>
> Is the above correct expectation correct?
>
> --
> Regards
> Deep L Sukhwani
>
> ᐧ
>
> On Tue, 1 Oct 2019 at 23:08, Dilipkumar Noone  wrote:
>
>> Hi,
>>
>> If i use selenium webdriver regular way in my django app, will it not
>> cause time consuming to perform the automation task on chrome webdriver ?
>> So to save the time , can i launch browser and perform automation task
>> using celery delay() method.
>>
>> Regards,
>> N.Dilip Kumar.
>>
>> On Tuesday, October 1, 2019 at 4:13:51 AM UTC+5:30, Deep Sukhwani wrote:
>>>
>>> What exactly do you want to use celery for?
>>>
>>> Using selenium webdriver the regular way should suffice here.
>>> Regarding copying from one field and pasting into another, you might be
>>> able to work with .get_text() method in selenium to read text from one
>>> field, store it in a variable and then .send_keys() to write that text into
>>> another field.
>>>
>>> *Note: This is a good question for selenium community and you should
>>> consider posting it there or on Stack overflow with selenium webdriver tag*
>>>
>>> On Mon, Sep 30, 2019, 21:29 Dilipkumar Noone  wrote:
>>>


 On Monday, September 30, 2019 at 9:22:16 PM UTC+5:30, Dilipkumar Noone
 wrote:
>
> I am new to Django.
>
> I  have a requirement to develop a django application with the
> requirement as stated below:
>
> 1.Under one tab ,provide a button name "ApplyGSP"
> 2.click on "ApplyGSP" button should open a form ,which required below
> input from the user.
>
>*a)*model_no* b)*model_name *c)*os_version *d)*requested_time *e)*user
> *f)from_sas_url g) to_sas_url etc.*
>
> *3.*once the user submitted the FORM with all the fields from step2,
> your app should open a browser with the user specified URL from 
> f)*from_sas_url
> field* in step2.
> 4.Perform few click operations using selenium webdriver.
>
5.copy the list of records from f) to g)

 Please provide your suggestion how to perform this task in a better way.

 can i use celery application and launch the browser and perform the
 click operations using selenium webdriver ?
 Is there any better way please suggest me.

 Regards,
 N.Dilip Kumar.

>
>
>
>
 --
 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...@googlegroups.com.
 To view this discussion on the web visit
 

Re: Request to provide the details of how to integrate django app with selenium chrome web driver

2019-10-01 Thread Deep Sukhwani
Still not clear on what is the automation task. From your original
questions:

1.Under one tab ,provide a button name "ApplyGSP"
> 2.click on "ApplyGSP" button should open a form ,which required below
> input from the user.
>
>*a)*model_no* b)*model_name *c)*os_version *d)*requested_time *e)*user 
> *f)from_sas_url
> g) to_sas_url etc.*
>
> *3.*once the user submitted the FORM with all the fields from step2, your
> app should open a browser with the user specified URL from f)*from_sas_url
> field* in step2.
> 4.Perform few click operations using selenium webdriver.
>
   5.copy the list of records from f) to g)

These indicate that you want to perform a particular task using selenium.

What is the other task you are trying to run simultaneously for which you
want to run the selenium job using celery.delay()?

My full understanding is:

   - You will develop a Django application that meets the above requirements
   - That Django application will certainly be in running state (only then
   you will be able to perform visual automation on it)
   - You will then run a selenium job on the above running Django
   application.
   - Here, your Django app is running on a different process and you are
   triggering selenium job separately.
   - If on the other hand, the only reason you want to run a Django app is
   to do the selenium task and then shutdown the Django app altogether, you
   can put the whole thing in a single bash script which essentially:
  - Starts your Django application using gunicorn or direct call to
  runserver or whichever way you want it to run
  - Checks that the Django application is up and running
  - Triggers the Selenium flow
  - If selenium flow returns exit 0 - gets out and shuts down the
  Django application

Is the above correct expectation correct?

--
Regards
Deep L Sukhwani

ᐧ

On Tue, 1 Oct 2019 at 23:08, Dilipkumar Noone  wrote:

> Hi,
>
> If i use selenium webdriver regular way in my django app, will it not
> cause time consuming to perform the automation task on chrome webdriver ?
> So to save the time , can i launch browser and perform automation task
> using celery delay() method.
>
> Regards,
> N.Dilip Kumar.
>
> On Tuesday, October 1, 2019 at 4:13:51 AM UTC+5:30, Deep Sukhwani wrote:
>>
>> What exactly do you want to use celery for?
>>
>> Using selenium webdriver the regular way should suffice here.
>> Regarding copying from one field and pasting into another, you might be
>> able to work with .get_text() method in selenium to read text from one
>> field, store it in a variable and then .send_keys() to write that text into
>> another field.
>>
>> *Note: This is a good question for selenium community and you should
>> consider posting it there or on Stack overflow with selenium webdriver tag*
>>
>> On Mon, Sep 30, 2019, 21:29 Dilipkumar Noone  wrote:
>>
>>>
>>>
>>> On Monday, September 30, 2019 at 9:22:16 PM UTC+5:30, Dilipkumar Noone
>>> wrote:

 I am new to Django.

 I  have a requirement to develop a django application with the
 requirement as stated below:

 1.Under one tab ,provide a button name "ApplyGSP"
 2.click on "ApplyGSP" button should open a form ,which required below
 input from the user.

*a)*model_no* b)*model_name *c)*os_version *d)*requested_time *e)*user
 *f)from_sas_url g) to_sas_url etc.*

 *3.*once the user submitted the FORM with all the fields from step2,
 your app should open a browser with the user specified URL from 
 f)*from_sas_url
 field* in step2.
 4.Perform few click operations using selenium webdriver.

>>>5.copy the list of records from f) to g)
>>>
>>> Please provide your suggestion how to perform this task in a better way.
>>>
>>> can i use celery application and launch the browser and perform the
>>> click operations using selenium webdriver ?
>>> Is there any better way please suggest me.
>>>
>>> Regards,
>>> N.Dilip Kumar.
>>>




>>> --
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/87eaa9b9-eccb-4f7c-87b3-3a6a2d6ee8b7%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/3292dd2d-b5b7-4b65-8d67-8b3276e4f94f%40googlegroups.com
> 

Re: Request to provide the details of how to integrate django app with selenium chrome web driver

2019-10-01 Thread Dilipkumar Noone
Hi,

If i use selenium webdriver regular way in my django app, will it not cause 
time consuming to perform the automation task on chrome webdriver ?
So to save the time , can i launch browser and perform automation task 
using celery delay() method.

Regards,
N.Dilip Kumar.

On Tuesday, October 1, 2019 at 4:13:51 AM UTC+5:30, Deep Sukhwani wrote:
>
> What exactly do you want to use celery for?
>
> Using selenium webdriver the regular way should suffice here.
> Regarding copying from one field and pasting into another, you might be 
> able to work with .get_text() method in selenium to read text from one 
> field, store it in a variable and then .send_keys() to write that text into 
> another field.
>
> *Note: This is a good question for selenium community and you should 
> consider posting it there or on Stack overflow with selenium webdriver tag*
>
> On Mon, Sep 30, 2019, 21:29 Dilipkumar Noone  > wrote:
>
>>
>>
>> On Monday, September 30, 2019 at 9:22:16 PM UTC+5:30, Dilipkumar Noone 
>> wrote:
>>>
>>> I am new to Django.
>>>
>>> I  have a requirement to develop a django application with the 
>>> requirement as stated below:
>>>
>>> 1.Under one tab ,provide a button name "ApplyGSP"
>>> 2.click on "ApplyGSP" button should open a form ,which required below 
>>> input from the user.
>>>
>>>*a)*model_no* b)*model_name *c)*os_version *d)*requested_time *e)*user 
>>> *f)from_sas_url g) to_sas_url etc.*
>>>
>>> *3.*once the user submitted the FORM with all the fields from step2, 
>>> your app should open a browser with the user specified URL from 
>>> f)*from_sas_url 
>>> field* in step2.
>>> 4.Perform few click operations using selenium webdriver.
>>>
>>5.copy the list of records from f) to g)
>>
>> Please provide your suggestion how to perform this task in a better way.
>>
>> can i use celery application and launch the browser and perform the click 
>> operations using selenium webdriver ?
>> Is there any better way please suggest me.
>>
>> Regards,
>> N.Dilip Kumar.   
>>
>>>
>>>
>>>  
>>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/87eaa9b9-eccb-4f7c-87b3-3a6a2d6ee8b7%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/3292dd2d-b5b7-4b65-8d67-8b3276e4f94f%40googlegroups.com.


Re: Request to provide the details of how to integrate django app with selenium chrome web driver

2019-09-30 Thread Deep Sukhwani
What exactly do you want to use celery for?

Using selenium webdriver the regular way should suffice here.
Regarding copying from one field and pasting into another, you might be
able to work with .get_text() method in selenium to read text from one
field, store it in a variable and then .send_keys() to write that text into
another field.

*Note: This is a good question for selenium community and you should
consider posting it there or on Stack overflow with selenium webdriver tag*

On Mon, Sep 30, 2019, 21:29 Dilipkumar Noone  wrote:

>
>
> On Monday, September 30, 2019 at 9:22:16 PM UTC+5:30, Dilipkumar Noone
> wrote:
>>
>> I am new to Django.
>>
>> I  have a requirement to develop a django application with the
>> requirement as stated below:
>>
>> 1.Under one tab ,provide a button name "ApplyGSP"
>> 2.click on "ApplyGSP" button should open a form ,which required below
>> input from the user.
>>
>>*a)*model_no* b)*model_name *c)*os_version *d)*requested_time *e)*user
>> *f)from_sas_url g) to_sas_url etc.*
>>
>> *3.*once the user submitted the FORM with all the fields from step2,
>> your app should open a browser with the user specified URL from 
>> f)*from_sas_url
>> field* in step2.
>> 4.Perform few click operations using selenium webdriver.
>>
>5.copy the list of records from f) to g)
>
> Please provide your suggestion how to perform this task in a better way.
>
> can i use celery application and launch the browser and perform the click
> operations using selenium webdriver ?
> Is there any better way please suggest me.
>
> Regards,
> N.Dilip Kumar.
>
>>
>>
>>
>>
> --
> 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/87eaa9b9-eccb-4f7c-87b3-3a6a2d6ee8b7%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/CAEMqiPc%3D2z5-LZNAKSAmrhOWB%3DV_mJhA2R2%2BzMRzt9CTjs5OOw%40mail.gmail.com.


Re: Request to provide the details of how to integrate django app with selenium chrome web driver

2019-09-30 Thread Dilipkumar Noone


On Monday, September 30, 2019 at 9:22:16 PM UTC+5:30, Dilipkumar Noone 
wrote:
>
> I am new to Django.
>
> I  have a requirement to develop a django application with the requirement 
> as stated below:
>
> 1.Under one tab ,provide a button name "ApplyGSP"
> 2.click on "ApplyGSP" button should open a form ,which required below 
> input from the user.
>
>*a)*model_no* b)*model_name *c)*os_version *d)*requested_time *e)*user 
> *f)from_sas_url 
> g) to_sas_url etc.*
>
> *3.*once the user submitted the FORM with all the fields from step2, your 
> app should open a browser with the user specified URL from f)*from_sas_url 
> field* in step2.
> 4.Perform few click operations using selenium webdriver.
>
   5.copy the list of records from f) to g)

Please provide your suggestion how to perform this task in a better way.

can i use celery application and launch the browser and perform the click 
operations using selenium webdriver ?
Is there any better way please suggest me.

Regards,
N.Dilip Kumar.   

>
>
>  
>

-- 
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/87eaa9b9-eccb-4f7c-87b3-3a6a2d6ee8b7%40googlegroups.com.


Re: request module

2019-09-24 Thread dandu sreenivasulu
Thanks Deep, i will raise on stackoverflow...


On Tue, Sep 24, 2019 at 9:39 AM Deep Sukhwani 
wrote:

> The right place for this would be "requests" community -
> https://2.python-requests.org/en/master/community/support/#e-mail
>
> The best immediate course of action would be to post a question on
> stackoverflow.com and tag the question with *python-requests*
>
> --
> Regards
> Deep L Sukhwani
>
>
> On Mon, 23 Sep 2019 at 18:11, dandu sreenivasulu 
> wrote:
>
>> Hi All,
>>  can someone please help on below request
>>
>> url = 'http://abc.com/'
>> response = requests.get(url)# 
>> url1 = response.url # http://xyz.com --> when we access abc.com url it
>> will redirect to xyz.com url and there we have to entere username and
>> password
>> print(url1) #xyz.com
>> print(response.url) #xyz.com
>> post_data = {
>> 'User Name': 'sr...@gmail.com',
>> 'Password': 'srinu123',
>> 'action':'btnLogin'
>> }
>> with requests.Session() as s:
>> r = s.post(url1, data=post_data)
>> r = s.post(url1, auth=HTTPBasicAuth('sr...@gmail.com', 'srinu123'))
>> print(response.status_code) # 200
>> print(response.text) # error //
>>
>> questions:
>> 1) what attributes i have to take from text filed ?
>>
>> User Id:
>> Passwor:
>>
>>
>>
>> --
>> 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/406a807c-9979-42c6-b061-9a12d66cd65b%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/CAEMqiPd9XEK3H76tgJKw%2BdiUyPFBGHBLygqZ1FCwXY4xhmFgoQ%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/CAAZQr5vOPM%3DYssGQw6s36KyZZkLZABx1BQkOEbrEu90i9zD-SA%40mail.gmail.com.


Re: request module

2019-09-23 Thread Deep Sukhwani
The right place for this would be "requests" community -
https://2.python-requests.org/en/master/community/support/#e-mail

The best immediate course of action would be to post a question on
stackoverflow.com and tag the question with *python-requests*

--
Regards
Deep L Sukhwani


On Mon, 23 Sep 2019 at 18:11, dandu sreenivasulu 
wrote:

> Hi All,
>  can someone please help on below request
>
> url = 'http://abc.com/'
> response = requests.get(url)# 
> url1 = response.url # http://xyz.com --> when we access abc.com url it
> will redirect to xyz.com url and there we have to entere username and
> password
> print(url1) #xyz.com
> print(response.url) #xyz.com
> post_data = {
> 'User Name': 'sr...@gmail.com',
> 'Password': 'srinu123',
> 'action':'btnLogin'
> }
> with requests.Session() as s:
> r = s.post(url1, data=post_data)
> r = s.post(url1, auth=HTTPBasicAuth('sr...@gmail.com', 'srinu123'))
> print(response.status_code) # 200
> print(response.text) # error //
>
> questions:
> 1) what attributes i have to take from text filed ?
>
> User Id:
> Passwor:
>
>
>
> --
> 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/406a807c-9979-42c6-b061-9a12d66cd65b%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/CAEMqiPd9XEK3H76tgJKw%2BdiUyPFBGHBLygqZ1FCwXY4xhmFgoQ%40mail.gmail.com.


Re: request for advice

2019-08-11 Thread Gil Obradors
For starting sqlite is enought! And better if you havn t got skills about
sysadmin and postgresql


Postgresql have more benkmarch, you can search posts in google

But is not good idea buy a bus to carry 2 people.  ( my opinion )

El dg., 11 d’ag. 2019, 18:51, ajoeiam  va escriure:

> Greetings
>
> Just beginning the odyssey of learning not only Django but also Python (3)
> for use in construction a web application.
> (Working on Debian testing but may be moving to stable if necessary.)
>
> Looking for advice on the application framework.
>
> Application proposed design is like this:
>
> application does not reside on the user's computer
>
> although the application isn't resident on the user's computer any data
> resulting for the application does reside on the user's computer
>
>
> database of items is present at the application host
>
> list of perhaps a couple thousand items with information on each item in
> up to 100 different 'features'
>
> user can add items for use in the application to the database but said
> information is stored on the user's system (NOT in the main repository)
>
>
> database items are assembled to produce a resultant 'package' (sorry not
> trying to pun!)
>
> any such packages developed (and their composition) are stored on the
> user's computer
>
>
>
> My initial thinking is to use various forms (created in perhaps
> LibreOffice Base or others) on a web application where  Django provides the
> glue between the web browser,
> Postgresql and the application.
>
>
> In searching for development ideas I am finding that SQLite is also
> perhaps usable for use in the fashion that I am presently proposing to use
> Postgresql.
>
>
> Is there a better fit between my application between Postgresql or SQLite?
>
> (Further questions would be cheerfully entertained!)
>
> TIA
>
>
>
>
>
>
>
>
>
>
>
> --
> 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/402b3ed4-b08f-49b8-8f57-952eac6d0d7b%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/CAK-JoTR-uftH%2Bc4nzj9Ysc3XJE2cF1joq_wg5aFOF6MGMWz6sw%40mail.gmail.com.


Re: Request & Response >> Device send HTTP request to web server

2019-03-19 Thread Sabuhi Shukurov
I was wondering if you have pdf version I have been looking but 
unfortunately not found the one free .

On Tuesday, 19 March 2019 03:05:42 UTC+4, Mohan Goud wrote:
>
> Unit 9 of IoT by Vijay madisetti is completely related to that
>
> On Tue 19 Mar, 2019, 2:43 AM Sabuhi Shukurov   wrote:
>
>> Hello!
>>
>> I need your help and assistance in my project. Currently we are 
>> developing project on   the device, which is on arduino written on C low 
>> level, it is really difficult to handle do many things, we want to keep it 
>> as simple as we can, everything will rely on to the our web app(Django). 
>> device suppose to send request in each minute and get response to each 
>> request. data comes in each minuet as str, we need to parse the data and 
>> send response to take actions. Is there any example of it?  or anything 
>> would help me to work on this project? I would definitely appreciate your 
>> help. Thanks in advance!
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@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/f38ff183-bcc0-4d45-a5d2-be10633af021%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

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


Re: Request & Response >> Device send HTTP request to web server

2019-03-19 Thread Sabuhi Shukurov
thank you! you let me find the book


On Tuesday, 19 March 2019 03:05:42 UTC+4, Mohan Goud wrote:
>
> Unit 9 of IoT by Vijay madisetti is completely related to that
>
> On Tue 19 Mar, 2019, 2:43 AM Sabuhi Shukurov   wrote:
>
>> Hello!
>>
>> I need your help and assistance in my project. Currently we are 
>> developing project on   the device, which is on arduino written on C low 
>> level, it is really difficult to handle do many things, we want to keep it 
>> as simple as we can, everything will rely on to the our web app(Django). 
>> device suppose to send request in each minute and get response to each 
>> request. data comes in each minuet as str, we need to parse the data and 
>> send response to take actions. Is there any example of it?  or anything 
>> would help me to work on this project? I would definitely appreciate your 
>> help. Thanks in advance!
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@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/f38ff183-bcc0-4d45-a5d2-be10633af021%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

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


Re: Request & Response >> Device send HTTP request to web server

2019-03-18 Thread Mohan Goud
Unit 9 of IoT by Vijay madisetti is completely related to that

On Tue 19 Mar, 2019, 2:43 AM Sabuhi Shukurov  Hello!
>
> I need your help and assistance in my project. Currently we are developing
> project on   the device, which is on arduino written on C low level, it is
> really difficult to handle do many things, we want to keep it as simple as
> we can, everything will rely on to the our web app(Django). device suppose
> to send request in each minute and get response to each request. data comes
> in each minuet as str, we need to parse the data and send response to take
> actions. Is there any example of it?  or anything would help me to work on
> this project? I would definitely appreciate your help. Thanks in advance!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f38ff183-bcc0-4d45-a5d2-be10633af021%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Request Timed Out When Generating Huge Data

2018-04-02 Thread tango ward
I tried loading the site locally to see how long will it take to load a
record of 1800 students. It took about a minute and a half locally. The
request timed out problem occurs when I try to generate a CSV report and
PDF. Both result to timed out even locally.

On Tue, Apr 3, 2018 at 8:12 AM, tango ward  wrote:

> Hi,
>
> SLR.
>
> At the moment, the largest number of students we have is 2000 in one
> campus. I haven't played around with the code but when I check it we're
> using a get_queryset function to get the data and filter it using Q. Then
> display it using get_context_data
>
> Code:
>
> class FinancialReportView(ApplicantReportMixin, ListView):
> template_name = 'education/dashboard/reports/financial_report.html'
> paginate_by = 50
>
> def get_queryset(self):
>
> student_filter = self.request.GET.get('student_filter', '')
>
> filter_date = self.request.GET.get('date', '')
> if not filter_date and not student_filter:
> return Recipient.objects.none()
>
> if student_filter in ['None', None]:
> student_filter = ''
> recipients = self.get_recipients()
> recipients = recipients.filter(enrolled=1)
> recipients = recipients.filter(enrollmentinfo__isnull=False)
>
> campus = self.request.GET.get('campus', '')
> if campus:
> recipients = recipients.filter(department__school=campus)
> year_level = self.request.GET.get('year_level', '')
>
> if year_level:
> recipients = recipients.filter(year_level=year_level)
>
> if student_filter and not student_filter == 'None':
> recipients = recipients.filter(
> Q(first_name__icontains=student_filter) |
> Q(last_name__icontains=student_filter) |
> Q(student_id__icontains=student_filter))
> recipients = recipients.select_related('department', 'program')
> return recipients
>
> def get_context_data(self, **kwargs):
> context = super(FinancialReportView, self).get_context_data(**
> kwargs)
>
> filter_form = FinancialReportFilterForm(
> data=self.request.GET,
> school_manager=self.request.user.schoolmanager,
> )
> output = []
> recipients = self.get_queryset()
>
> filter_date = self.request.GET.get('date', '')
> if filter_date in ['None', None]:
> filter_date = ''
> if filter_date:
> filter_date = dateutil.parser.parse(filter_date).date()
> page = self.request.GET.get('page', 1)
>
> for ctr, recipient in enumerate(recipients):
> total_amount = 0
> enrollment_info = recipient.get_current_enrollment_info()
> if enrollment_info:
> if filter_date:
> invoices = enrollment_info.
> philsmileinvoice_set.filter(
> due_date__lte=filter_date)
> else:
> invoices = enrollment_info.philsmileinvoice_set.all()
>
> for invoice in invoices:
> total_amount += invoice.get_remaining_balance()
>
> output.append([ctr, recipient, total_amount])
>
> if self.paginate_by:
> paginator = Paginator(output, self.paginate_by)
> try:
> output = paginator.page(page)
> except PageNotAnInteger:
> output = paginator.page(1)
> except EmptyPage:
> output = paginator.page(paginator.num_pages)
> context.update({
> 'paginator': paginator
> })
>
> context.update({
> 'outputs': output,
> 'form': filter_form,
> 'school_system': self.request.user.
> schoolmanager.school_system,
> })
> return context
>
>
>
>
> On Mon, Apr 2, 2018 at 1:54 PM, Babatunde Akinyanmi 
> wrote:
>
>> Hi,
>> How many records are we talking about? What code are you using to fetch
>> the records? In other words, add more information so that it's easier to
>> troubleshoot
>>
>> On Mon, 2 Apr 2018, 02:27 tango ward,  wrote:
>>
>>>
>>> Good day,
>>>
>>> I need suggestions on how to approach this problem.
>>>
>>> I am working on a task that needs to generate the list students per
>>> school. When the school has larger number of students, I am getting a
>>> request timed out error. I can filter the school per campus to lessen the
>>> number of students but the performance in displaying the list of students
>>> is still taking too long.
>>>
>>>
>>> Thanks,
>>> Jarvis
>>>
>>> --
>>> 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 

Re: Request Timed Out When Generating Huge Data

2018-04-02 Thread tango ward
Hi,

SLR.

At the moment, the largest number of students we have is 2000 in one
campus. I haven't played around with the code but when I check it we're
using a get_queryset function to get the data and filter it using Q. Then
display it using get_context_data

Code:

class FinancialReportView(ApplicantReportMixin, ListView):
template_name = 'education/dashboard/reports/financial_report.html'
paginate_by = 50

def get_queryset(self):

student_filter = self.request.GET.get('student_filter', '')

filter_date = self.request.GET.get('date', '')
if not filter_date and not student_filter:
return Recipient.objects.none()

if student_filter in ['None', None]:
student_filter = ''
recipients = self.get_recipients()
recipients = recipients.filter(enrolled=1)
recipients = recipients.filter(enrollmentinfo__isnull=False)

campus = self.request.GET.get('campus', '')
if campus:
recipients = recipients.filter(department__school=campus)
year_level = self.request.GET.get('year_level', '')

if year_level:
recipients = recipients.filter(year_level=year_level)

if student_filter and not student_filter == 'None':
recipients = recipients.filter(
Q(first_name__icontains=student_filter) |
Q(last_name__icontains=student_filter) |
Q(student_id__icontains=student_filter))
recipients = recipients.select_related('department', 'program')
return recipients

def get_context_data(self, **kwargs):
context = super(FinancialReportView,
self).get_context_data(**kwargs)

filter_form = FinancialReportFilterForm(
data=self.request.GET,
school_manager=self.request.user.schoolmanager,
)
output = []
recipients = self.get_queryset()

filter_date = self.request.GET.get('date', '')
if filter_date in ['None', None]:
filter_date = ''
if filter_date:
filter_date = dateutil.parser.parse(filter_date).date()
page = self.request.GET.get('page', 1)

for ctr, recipient in enumerate(recipients):
total_amount = 0
enrollment_info = recipient.get_current_enrollment_info()
if enrollment_info:
if filter_date:
invoices = enrollment_info.philsmileinvoice_set.filter(
due_date__lte=filter_date)
else:
invoices = enrollment_info.philsmileinvoice_set.all()

for invoice in invoices:
total_amount += invoice.get_remaining_balance()

output.append([ctr, recipient, total_amount])

if self.paginate_by:
paginator = Paginator(output, self.paginate_by)
try:
output = paginator.page(page)
except PageNotAnInteger:
output = paginator.page(1)
except EmptyPage:
output = paginator.page(paginator.num_pages)
context.update({
'paginator': paginator
})

context.update({
'outputs': output,
'form': filter_form,
'school_system': self.request.user.schoolmanager.school_system,
})
return context




On Mon, Apr 2, 2018 at 1:54 PM, Babatunde Akinyanmi 
wrote:

> Hi,
> How many records are we talking about? What code are you using to fetch
> the records? In other words, add more information so that it's easier to
> troubleshoot
>
> On Mon, 2 Apr 2018, 02:27 tango ward,  wrote:
>
>>
>> Good day,
>>
>> I need suggestions on how to approach this problem.
>>
>> I am working on a task that needs to generate the list students per
>> school. When the school has larger number of students, I am getting a
>> request timed out error. I can filter the school per campus to lessen the
>> number of students but the performance in displaying the list of students
>> is still taking too long.
>>
>>
>> Thanks,
>> Jarvis
>>
>> --
>> 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/CAA6wQLKn98Yq9JrbQQLVncm2pkEUz
>> aCYm_un0zZFMXQC8ewzrg%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed 

Re: Request Timed Out When Generating Huge Data

2018-04-01 Thread Babatunde Akinyanmi
Hi,
How many records are we talking about? What code are you using to fetch the
records? In other words, add more information so that it's easier to
troubleshoot

On Mon, 2 Apr 2018, 02:27 tango ward,  wrote:

>
> Good day,
>
> I need suggestions on how to approach this problem.
>
> I am working on a task that needs to generate the list students per
> school. When the school has larger number of students, I am getting a
> request timed out error. I can filter the school per campus to lessen the
> number of students but the performance in displaying the list of students
> is still taking too long.
>
>
> Thanks,
> Jarvis
>
> --
> 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/CAA6wQLKn98Yq9JrbQQLVncm2pkEUzaCYm_un0zZFMXQC8ewzrg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Request for advice on refactoring a big Django project

2017-03-07 Thread bobhaugen
> But don't be dismayed if no one responds. 

I'm not at all dismayed, and knew it was a shot in the dark, but might as 
well try for somebody who likes to discuss Django refactoring, or might be 
interested in the stuff we are building. And thanks again for the responses 
to my question about why no responses. 

On Monday, March 6, 2017 at 10:10:53 AM UTC-6, mark wrote:
>
> I echo Vijay's comment. Lists like this are really great for very specific 
> questions and short code segments or error message that a more experienced 
> person can answer off the top of their head. Your question is very broad 
> and requires a large time commitment from the reader to respond. With that 
> said, there is nothing wrong with posting your question as you may get 
> someone who has some free time to dive in and try to help. Or someone who 
> has done a lot of refactoring and can give you some pointers. But don't be 
> dismayed if no one responds. 
>
> You could also rephrase your question to be more like "I am in the process 
> of refactoring a large project. What recommendations would you make as far 
> as how to tackle this project? We built the project using Django x.x.x, so 
> where would you recommend we start with this project." More along the lines 
> of best practices for refactoring django projects, or what has the reader 
> learned after refactoring django projects. This question does not require 
> the reader to dive into your code, but to relate what they know about the 
> topic. Easier and much less time consuming for the reader.
>
> You could also offer to pay someone to help kick start your project, and 
> then if someone responds, take the discussion offline.
>
> As you refactor the project and run into issues, be sure to post those 
> very specific questions and short code segments/error message to the list. 
> The folks here are very friendly, extremely knowledgeable, and very willing 
> to help as long as you make it super easy for them to help you figure out 
> the answer to a specific question.
>
> God luck!
>
> Mark. 
>
> On Mon, Mar 6, 2017 at 5:13 AM, Vijay Khemlani  > wrote:
>
>> Also, this type mailing lists are usually for specific questions about
>> the framework
>>
>> "How do I make this particular query with the ORM"
>> "Why isn't this variable getting rendered in the template"
>>
>> etc
>>
>> Your question is kinda broad
>>
>> On 3/6/17, Bob Haugen  wrote:
>> > Antonis, thank you very much for the feedback! You are absolutely
>> > correct! I apologize to you and the list, and will strive to follow
>> > your suggestions in the future.
>> >
>> > I suspect, however, that the very long explanation that would have
>> > been required to avoid the links would have been offputting, too. This
>> > might be a request that was just inappropriate for this list.
>> >
>> > As for now, we're charging happily ahead.
>> >
>> > On Mon, Mar 6, 2017 at 5:45 AM, Antonis Christofides
>> >  wrote:
>> >> Hi,
>> >>
>> >> I, like many people, am busy. I will generally not spend too much time 
>> on
>> >> the messages of this list. I delete most of them after only reading the
>> >> subject line. If I do choose to read the body, I expect to understand
>> >> what
>> >> it is about after a few seconds of reading. But all I can see in your
>> >> original message is that you have a big Django project that needs
>> >> refactoring, and several links with the code and your discussions about
>> >> them. Essentially the message I'm getting is "I can't tell you what I
>> >> want
>> >> in this email message, but if you click on these links and study them 
>> for
>> >> about half an hour, you'll get it".
>> >>
>> >> Likewise, it would have been way better to include your original 
>> message
>> >> in
>> >> the reply. In order to find your original message I had to dig in my
>> >> Trash
>> >> folder. I would normally not do that, and I would have ignored your 
>> reply
>> >> as
>> >> well. It just happens that I'm travelling and I'm quite relaxed.
>> >>
>> >> Bottom line: you need to make it very easy for me to help you, and I
>> >> believe
>> >> the same goes for other people as well.
>> >>
>> >> Regards,
>> >>
>> >> Antonis
>> >>
>> >> Antonis Christofides
>> >> http://djangodeployment.com
>> >>
>> >> On 03/06/2017 12:36 PM, bobhaugen wrote:
>> >>
>> >> I was disappointed to get no response on this topic, and would be
>> >> grateful
>> >> for any feedback on why that might have been.
>> >>
>> >> Too big? Big ball of mud? Stupid project? ? (I have very little
>> >> touchiness...)
>> >>
>> >> I hope people did not think we wanted to get them to do all or even 
>> very
>> >> much work for us. We are charging ahead here:
>> >> https://github.com/django-rea
>> >>
>> >> We did find, and are using, some delicious advice from Marty Alchin:
>> >> http://martyalchin.com/2008/jan/10/simple-plugin-framework/
>> >> And upgrading to the latest version of django, 

Re: Request for advice on refactoring a big Django project

2017-03-06 Thread Mark Phillips
I echo Vijay's comment. Lists like this are really great for very specific
questions and short code segments or error message that a more experienced
person can answer off the top of their head. Your question is very broad
and requires a large time commitment from the reader to respond. With that
said, there is nothing wrong with posting your question as you may get
someone who has some free time to dive in and try to help. Or someone who
has done a lot of refactoring and can give you some pointers. But don't be
dismayed if no one responds.

You could also rephrase your question to be more like "I am in the process
of refactoring a large project. What recommendations would you make as far
as how to tackle this project? We built the project using Django x.x.x, so
where would you recommend we start with this project." More along the lines
of best practices for refactoring django projects, or what has the reader
learned after refactoring django projects. This question does not require
the reader to dive into your code, but to relate what they know about the
topic. Easier and much less time consuming for the reader.

You could also offer to pay someone to help kick start your project, and
then if someone responds, take the discussion offline.

As you refactor the project and run into issues, be sure to post those very
specific questions and short code segments/error message to the list. The
folks here are very friendly, extremely knowledgeable, and very willing to
help as long as you make it super easy for them to help you figure out the
answer to a specific question.

God luck!

Mark.

On Mon, Mar 6, 2017 at 5:13 AM, Vijay Khemlani  wrote:

> Also, this type mailing lists are usually for specific questions about
> the framework
>
> "How do I make this particular query with the ORM"
> "Why isn't this variable getting rendered in the template"
>
> etc
>
> Your question is kinda broad
>
> On 3/6/17, Bob Haugen  wrote:
> > Antonis, thank you very much for the feedback! You are absolutely
> > correct! I apologize to you and the list, and will strive to follow
> > your suggestions in the future.
> >
> > I suspect, however, that the very long explanation that would have
> > been required to avoid the links would have been offputting, too. This
> > might be a request that was just inappropriate for this list.
> >
> > As for now, we're charging happily ahead.
> >
> > On Mon, Mar 6, 2017 at 5:45 AM, Antonis Christofides
> >  wrote:
> >> Hi,
> >>
> >> I, like many people, am busy. I will generally not spend too much time
> on
> >> the messages of this list. I delete most of them after only reading the
> >> subject line. If I do choose to read the body, I expect to understand
> >> what
> >> it is about after a few seconds of reading. But all I can see in your
> >> original message is that you have a big Django project that needs
> >> refactoring, and several links with the code and your discussions about
> >> them. Essentially the message I'm getting is "I can't tell you what I
> >> want
> >> in this email message, but if you click on these links and study them
> for
> >> about half an hour, you'll get it".
> >>
> >> Likewise, it would have been way better to include your original message
> >> in
> >> the reply. In order to find your original message I had to dig in my
> >> Trash
> >> folder. I would normally not do that, and I would have ignored your
> reply
> >> as
> >> well. It just happens that I'm travelling and I'm quite relaxed.
> >>
> >> Bottom line: you need to make it very easy for me to help you, and I
> >> believe
> >> the same goes for other people as well.
> >>
> >> Regards,
> >>
> >> Antonis
> >>
> >> Antonis Christofides
> >> http://djangodeployment.com
> >>
> >> On 03/06/2017 12:36 PM, bobhaugen wrote:
> >>
> >> I was disappointed to get no response on this topic, and would be
> >> grateful
> >> for any feedback on why that might have been.
> >>
> >> Too big? Big ball of mud? Stupid project? ? (I have very little
> >> touchiness...)
> >>
> >> I hope people did not think we wanted to get them to do all or even very
> >> much work for us. We are charging ahead here:
> >> https://github.com/django-rea
> >>
> >> We did find, and are using, some delicious advice from Marty Alchin:
> >> http://martyalchin.com/2008/jan/10/simple-plugin-framework/
> >> And upgrading to the latest version of django, changing to class-based
> >> views, and breaking up both models and views into several files.
> >>
> >> Next: a bunch of abstract base classes.
> >>
> >> After that: more API work and a mobile app to use 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 

Re: Request for advice on refactoring a big Django project

2017-03-06 Thread Vijay Khemlani
Also, this type mailing lists are usually for specific questions about
the framework

"How do I make this particular query with the ORM"
"Why isn't this variable getting rendered in the template"

etc

Your question is kinda broad

On 3/6/17, Bob Haugen  wrote:
> Antonis, thank you very much for the feedback! You are absolutely
> correct! I apologize to you and the list, and will strive to follow
> your suggestions in the future.
>
> I suspect, however, that the very long explanation that would have
> been required to avoid the links would have been offputting, too. This
> might be a request that was just inappropriate for this list.
>
> As for now, we're charging happily ahead.
>
> On Mon, Mar 6, 2017 at 5:45 AM, Antonis Christofides
>  wrote:
>> Hi,
>>
>> I, like many people, am busy. I will generally not spend too much time on
>> the messages of this list. I delete most of them after only reading the
>> subject line. If I do choose to read the body, I expect to understand
>> what
>> it is about after a few seconds of reading. But all I can see in your
>> original message is that you have a big Django project that needs
>> refactoring, and several links with the code and your discussions about
>> them. Essentially the message I'm getting is "I can't tell you what I
>> want
>> in this email message, but if you click on these links and study them for
>> about half an hour, you'll get it".
>>
>> Likewise, it would have been way better to include your original message
>> in
>> the reply. In order to find your original message I had to dig in my
>> Trash
>> folder. I would normally not do that, and I would have ignored your reply
>> as
>> well. It just happens that I'm travelling and I'm quite relaxed.
>>
>> Bottom line: you need to make it very easy for me to help you, and I
>> believe
>> the same goes for other people as well.
>>
>> Regards,
>>
>> Antonis
>>
>> Antonis Christofides
>> http://djangodeployment.com
>>
>> On 03/06/2017 12:36 PM, bobhaugen wrote:
>>
>> I was disappointed to get no response on this topic, and would be
>> grateful
>> for any feedback on why that might have been.
>>
>> Too big? Big ball of mud? Stupid project? ? (I have very little
>> touchiness...)
>>
>> I hope people did not think we wanted to get them to do all or even very
>> much work for us. We are charging ahead here:
>> https://github.com/django-rea
>>
>> We did find, and are using, some delicious advice from Marty Alchin:
>> http://martyalchin.com/2008/jan/10/simple-plugin-framework/
>> And upgrading to the latest version of django, changing to class-based
>> views, and breaking up both models and views into several files.
>>
>> Next: a bunch of abstract base classes.
>>
>> After that: more API work and a mobile app to use 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/a3e12fd2-fc27-447a-a5f5-e394c3d67cff%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Django users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/django-users/9OU0TfwcmTQ/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/4d7559f1-e3a2-64f0-d6b3-60c902e17921%40djangodeployment.com.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CA%2BSvw0WRHpTUUV1RceS8MWuRjGQ3JyJqZ%3DCKdKGSLYV8%2BQma2g%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>

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

Re: Request for advice on refactoring a big Django project

2017-03-06 Thread Bob Haugen
Antonis, thank you very much for the feedback! You are absolutely
correct! I apologize to you and the list, and will strive to follow
your suggestions in the future.

I suspect, however, that the very long explanation that would have
been required to avoid the links would have been offputting, too. This
might be a request that was just inappropriate for this list.

As for now, we're charging happily ahead.

On Mon, Mar 6, 2017 at 5:45 AM, Antonis Christofides
 wrote:
> Hi,
>
> I, like many people, am busy. I will generally not spend too much time on
> the messages of this list. I delete most of them after only reading the
> subject line. If I do choose to read the body, I expect to understand what
> it is about after a few seconds of reading. But all I can see in your
> original message is that you have a big Django project that needs
> refactoring, and several links with the code and your discussions about
> them. Essentially the message I'm getting is "I can't tell you what I want
> in this email message, but if you click on these links and study them for
> about half an hour, you'll get it".
>
> Likewise, it would have been way better to include your original message in
> the reply. In order to find your original message I had to dig in my Trash
> folder. I would normally not do that, and I would have ignored your reply as
> well. It just happens that I'm travelling and I'm quite relaxed.
>
> Bottom line: you need to make it very easy for me to help you, and I believe
> the same goes for other people as well.
>
> Regards,
>
> Antonis
>
> Antonis Christofides
> http://djangodeployment.com
>
> On 03/06/2017 12:36 PM, bobhaugen wrote:
>
> I was disappointed to get no response on this topic, and would be grateful
> for any feedback on why that might have been.
>
> Too big? Big ball of mud? Stupid project? ? (I have very little
> touchiness...)
>
> I hope people did not think we wanted to get them to do all or even very
> much work for us. We are charging ahead here:
> https://github.com/django-rea
>
> We did find, and are using, some delicious advice from Marty Alchin:
> http://martyalchin.com/2008/jan/10/simple-plugin-framework/
> And upgrading to the latest version of django, changing to class-based
> views, and breaking up both models and views into several files.
>
> Next: a bunch of abstract base classes.
>
> After that: more API work and a mobile app to use 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/a3e12fd2-fc27-447a-a5f5-e394c3d67cff%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/9OU0TfwcmTQ/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/4d7559f1-e3a2-64f0-d6b3-60c902e17921%40djangodeployment.com.
> For more options, visit https://groups.google.com/d/optout.

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


Re: Request for advice on refactoring a big Django project

2017-03-06 Thread Vinicius Assef
+1

On 6 March 2017 at 08:45, Antonis Christofides
 wrote:
> Hi,
>
> I, like many people, am busy. I will generally not spend too much time on
> the messages of this list. I delete most of them after only reading the
> subject line. If I do choose to read the body, I expect to understand what
> it is about after a few seconds of reading. But all I can see in your
> original message is that you have a big Django project that needs
> refactoring, and several links with the code and your discussions about
> them. Essentially the message I'm getting is "I can't tell you what I want
> in this email message, but if you click on these links and study them for
> about half an hour, you'll get it".
>
> Likewise, it would have been way better to include your original message in
> the reply. In order to find your original message I had to dig in my Trash
> folder. I would normally not do that, and I would have ignored your reply as
> well. It just happens that I'm travelling and I'm quite relaxed.
>
> Bottom line: you need to make it very easy for me to help you, and I believe
> the same goes for other people as well.
>
> Regards,
>
> Antonis
>
> Antonis Christofides
> http://djangodeployment.com
>
> On 03/06/2017 12:36 PM, bobhaugen wrote:
>
> I was disappointed to get no response on this topic, and would be grateful
> for any feedback on why that might have been.
>
> Too big? Big ball of mud? Stupid project? ? (I have very little
> touchiness...)
>
> I hope people did not think we wanted to get them to do all or even very
> much work for us. We are charging ahead here:
> https://github.com/django-rea
>
> We did find, and are using, some delicious advice from Marty Alchin:
> http://martyalchin.com/2008/jan/10/simple-plugin-framework/
> And upgrading to the latest version of django, changing to class-based
> views, and breaking up both models and views into several files.
>
> Next: a bunch of abstract base classes.
>
> After that: more API work and a mobile app to use 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/a3e12fd2-fc27-447a-a5f5-e394c3d67cff%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4d7559f1-e3a2-64f0-d6b3-60c902e17921%40djangodeployment.com.
>
> For more options, visit https://groups.google.com/d/optout.

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


Re: Request for advice on refactoring a big Django project

2017-03-06 Thread Antonis Christofides
Hi,

I, like many people, am busy. I will generally not spend too much time on the
messages of this list. I delete most of them after only reading the subject
line. If I do choose to read the body, I expect to understand what it is about
after a few seconds of reading. But all I can see in your original message is
that you have a big Django project that needs refactoring, and several links
with the code and your discussions about them. Essentially the message I'm
getting is "I can't tell you what I want in this email message, but if you click
on these links and study them for about half an hour, you'll get it".

Likewise, it would have been way better to include your original message in the
reply. In order to find your original message I had to dig in my Trash folder. I
would normally not do that, and I would have ignored your reply as well. It just
happens that I'm travelling and I'm quite relaxed.

Bottom line: you need to make it very easy for me to help you, and I believe the
same goes for other people as well.

Regards,

Antonis

Antonis Christofides
http://djangodeployment.com

On 03/06/2017 12:36 PM, bobhaugen wrote:
> I was disappointed to get no response on this topic, and would be grateful for
> any feedback on why that might have been.
>
> Too big? Big ball of mud? Stupid project? ? (I have very little 
> touchiness...)
>
> I hope people did not think we wanted to get them to do all or even very much
> work for us. We are charging ahead here:
> https://github.com/django-rea
>
> We did find, and are using, some delicious advice from Marty Alchin:
> http://martyalchin.com/2008/jan/10/simple-plugin-framework/
> And upgrading to the latest version of django, changing to class-based views,
> and breaking up both models and views into several files.
>
> Next: a bunch of abstract base classes.
>
> After that: more API work and a mobile app to use 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/a3e12fd2-fc27-447a-a5f5-e394c3d67cff%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.

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


Re: Request for advice on refactoring a big Django project

2017-03-06 Thread bobhaugen
I was disappointed to get no response on this topic, and would be grateful 
for any feedback on why that might have been.

Too big? Big ball of mud? Stupid project? ? (I have very little 
touchiness...)

I hope people did not think we wanted to get them to do all or even very 
much work for us. We are charging ahead here:
https://github.com/django-rea

We did find, and are using, some delicious advice from Marty Alchin:
http://martyalchin.com/2008/jan/10/simple-plugin-framework/
And upgrading to the latest version of django, changing to class-based 
views, and breaking up both models and views into several files.

Next: a bunch of abstract base classes.

After that: more API work and a mobile app to use 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/a3e12fd2-fc27-447a-a5f5-e394c3d67cff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: request

2016-11-27 Thread Mike Dewhirst

Here is a good place to start ...

https://www.djangoproject.com/

then continue here ...

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

Welcome

On 28/11/2016 9:03 AM, Bhanu jamwal wrote:

i am new to it please let me know the aims and steps
regards
Bhanu
--
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/6803a7f6-a91d-4a1f-a79e-c0b0e16c1dca%40googlegroups.com 
.

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


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


Re: request

2016-11-27 Thread ludovic coues
What are you trying to do ?

2016-11-27 23:03 GMT+01:00 Bhanu jamwal :
> i am new to it please let me know the aims and steps
> regards
> Bhanu
>
> --
> 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/6803a7f6-a91d-4a1f-a79e-c0b0e16c1dca%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Coues Ludovic
+336 148 743 42

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


Re: request user

2016-04-20 Thread Avraham Serour
if you can get the request object you can get the current user with
request.user


On Mon, Apr 18, 2016 at 9:38 PM, Elias Coutinho 
wrote:

> Good afternoon people,
>
> I am using django material, LayoutMixin
>
> My view is:
>
> class NewProfissoesPessoaView (LoginRequiredMixin, LayoutMixin,
>  extra_views.NamedFormsetsMixin,
>  extra_views.CreateWithInlinesView):
>title = "New Job"
>model = ProfissoesPessoa
>
> print ( 'come on line 334')
>
> layout = Layout (
>Row ( 'person', 'profession', 'rating'),
># Fieldset ( 'Address'
># Row (Span7 ( 'address'), Span5 ( 'zipcode'))
># Row (Span5 ( 'city'), Span2 ( 'state'), Span5 ( 'country')))
>Inline ( 'Qualifications Profession', ItemInline)
>)
>
> def form_valid (self, form):
>print ( 'come on line 343')
>profession = self.object.save (commit = False)
>profissao.pessoa = request.user
>profissao.save ()
>
> def get_success_url (self):
>return self.object.get_absolute_url ()
>
>
>
> If you look has form_valid function, I'm trying to get my registration can
> be done without having to manually enter the logged in user.
>
> A View only enter if you login, but when loading the template it does not
> meet the user field. (This field wanted to hide)
>
> As I am using django materials needed to create the forms.py
>
> Can someone help me? All he wanted was to save without informing the user
> logged in, he seve be added without the intervention of anyone.
>
> --
> 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/d5d3b9d5-dba6-4361-999c-e0467ad69a3a%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Request works with sqlite not with Postgres

2016-04-04 Thread Simon Charette
Hi Tazo,

I just submitted a patch that correctly resolves the `output_field` of `Avg`
over non-numeric fields.

If it gets merged you shouldn't have to worry about passing an explicit
`output_field=DurationField()` in Django 1.10.

Simon

Le lundi 4 avril 2016 09:46:53 UTC-4, Tazo Gil a écrit :
>
> Without your help, I would not get the solution. Maybe the doc (
> https://docs.djangoproject.com/en/1.9/ref/models/querysets/#avg) should 
> be more precise about this case.
> Merci beaucoup
>
>
> Le lundi 4 avril 2016 05:35:14 UTC+2, Simon Charette a écrit :
>>
>> Hi Tazo,
>>
>> The default `output_field` of the `Avg` aggregate is a `FloatField`[1] 
>> hence
>> the error raised here. In the case of SQLite, `DurationField`s are stored 
>> as
>> large integers of microseconds[2] and the result returned by the database 
>> is
>> already a float making `float(value)` a no-op in `convert_value()`[3].
>>
>> Since Django 1.9 it's possible to specify the `output_field` of an `Avg`
>> expression as documented[4].
>>
>> In your case you want to do the following:
>>
>> Questionnaire.objects.filter(
>> site_id=1
>> ).annotate(
>>moyenne=Avg('chrono__temps', output_field=DurationField())
>> ).values('title','moyenne')
>>
>> Au plaisir,
>> Simon
>>
>> [1] 
>> https://github.com/django/django/blob/fdf5cd3429369954e8deb764d9f30f6374581613/django/db/models/aggregates.py#L45
>> [2] 
>> https://docs.djangoproject.com/en/1.9/ref/models/fields/#durationfield
>> [3] 
>> https://github.com/django/django/blob/master/django/db/models/expressions.py#L282-L283
>> [4] 
>> https://docs.djangoproject.com/en/1.9/ref/models/querysets/#django.db.models.Avg
>>  
>> 
>>
>> Le samedi 2 avril 2016 13:08:20 UTC-4, Tazo Gil a écrit :
>>>
>>> Hello,
>>>
>>> The following request works in my dev django project (sqlite) by not in 
>>> production with postgres 
>>>
>>> out: >>> 
>>> Questionnaire.objects.filter(site_id=1).annotate(moyenne=Avg('chrono__temps')).values('title','moyenne')
>>>
>>> The errors : 
>>>
>>>  out: Traceback (most recent call last):
>>>  out:   File "", line 1, in 
>>>  out:   File 
>>> "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/query.py",
>>>  
>>> line 234, in __repr__
>>>  out: data = list(self[:REPR_OUTPUT_SIZE + 1])
>>>  out:   File 
>>> "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/query.py",
>>>  
>>> line 258, in __iter__
>>>  out: self._fetch_all()
>>>  out:   File 
>>> "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/query.py",
>>>  
>>> line 1074, in _fetch_all
>>>  out: self._result_cache = list(self.iterator())
>>>  out:   File 
>>> "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/query.py",
>>>  
>>> line 112, in __iter__
>>>  out: for row in compiler.results_iter():
>>>  out:   File 
>>> "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py",
>>>  
>>> line 808, in results_iter
>>>  out: row = self.apply_converters(row, converters)
>>>  out:   File 
>>> "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py",
>>>  
>>> line 792, in apply_converters
>>>  out: value = converter(value, expression, self.connection, 
>>> self.query.context)
>>>  out:   File 
>>> "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/expressions.py",
>>>  
>>> line 283, in convert_value
>>>  out: return float(value)
>>>  out: TypeError: float() argument must be a string or a number
>>>
>>> Thank you for your help.
>>>
>>

-- 
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/2ff650cc-feea-4f83-aba0-4e6407464bed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Request works with sqlite not with Postgres

2016-04-04 Thread Tazo Gil
Without your help, I would not get the solution. Maybe the doc 
(https://docs.djangoproject.com/en/1.9/ref/models/querysets/#avg) should be 
more precise about this case.
Merci beaucoup


Le lundi 4 avril 2016 05:35:14 UTC+2, Simon Charette a écrit :
>
> Hi Tazo,
>
> The default `output_field` of the `Avg` aggregate is a `FloatField`[1] 
> hence
> the error raised here. In the case of SQLite, `DurationField`s are stored 
> as
> large integers of microseconds[2] and the result returned by the database 
> is
> already a float making `float(value)` a no-op in `convert_value()`[3].
>
> Since Django 1.9 it's possible to specify the `output_field` of an `Avg`
> expression as documented[4].
>
> In your case you want to do the following:
>
> Questionnaire.objects.filter(
> site_id=1
> ).annotate(
>moyenne=Avg('chrono__temps', output_field=DurationField())
> ).values('title','moyenne')
>
> Au plaisir,
> Simon
>
> [1] 
> https://github.com/django/django/blob/fdf5cd3429369954e8deb764d9f30f6374581613/django/db/models/aggregates.py#L45
> [2] https://docs.djangoproject.com/en/1.9/ref/models/fields/#durationfield
> [3] 
> https://github.com/django/django/blob/master/django/db/models/expressions.py#L282-L283
> [4] 
> https://docs.djangoproject.com/en/1.9/ref/models/querysets/#django.db.models.Avg
>  
> 
>
> Le samedi 2 avril 2016 13:08:20 UTC-4, Tazo Gil a écrit :
>>
>> Hello,
>>
>> The following request works in my dev django project (sqlite) by not in 
>> production with postgres 
>>
>> out: >>> 
>> Questionnaire.objects.filter(site_id=1).annotate(moyenne=Avg('chrono__temps')).values('title','moyenne')
>>
>> The errors : 
>>
>>  out: Traceback (most recent call last):
>>  out:   File "", line 1, in 
>>  out:   File 
>> "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/query.py",
>>  
>> line 234, in __repr__
>>  out: data = list(self[:REPR_OUTPUT_SIZE + 1])
>>  out:   File 
>> "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/query.py",
>>  
>> line 258, in __iter__
>>  out: self._fetch_all()
>>  out:   File 
>> "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/query.py",
>>  
>> line 1074, in _fetch_all
>>  out: self._result_cache = list(self.iterator())
>>  out:   File 
>> "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/query.py",
>>  
>> line 112, in __iter__
>>  out: for row in compiler.results_iter():
>>  out:   File 
>> "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py",
>>  
>> line 808, in results_iter
>>  out: row = self.apply_converters(row, converters)
>>  out:   File 
>> "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py",
>>  
>> line 792, in apply_converters
>>  out: value = converter(value, expression, self.connection, 
>> self.query.context)
>>  out:   File 
>> "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/expressions.py",
>>  
>> line 283, in convert_value
>>  out: return float(value)
>>  out: TypeError: float() argument must be a string or a number
>>
>> Thank you for your help.
>>
>

-- 
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/0cb386ec-cd8f-4a88-a28d-715efa1c7613%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Request works with sqlite not with Postgres

2016-04-03 Thread Simon Charette
Hi Tazo,

The default `output_field` of the `Avg` aggregate is a `FloatField`[1] hence
the error raised here. In the case of SQLite, `DurationField`s are stored as
large integers of microseconds[2] and the result returned by the database is
already a float making `float(value)` a no-op in `convert_value()`[3].

Since Django 1.9 it's possible to specify the `output_field` of an `Avg`
expression as documented[4].

In your case you want to do the following:

Questionnaire.objects.filter(
site_id=1
).annotate(
   moyenne=Avg('chrono__temps', output_field=DurationField())
).values('title','moyenne')

Au plaisir,
Simon

[1] 
https://github.com/django/django/blob/fdf5cd3429369954e8deb764d9f30f6374581613/django/db/models/aggregates.py#L45
[2] https://docs.djangoproject.com/en/1.9/ref/models/fields/#durationfield
[3] 
https://github.com/django/django/blob/master/django/db/models/expressions.py#L282-L283
[4] 
https://docs.djangoproject.com/en/1.9/ref/models/querysets/#django.db.models.Avg

Le samedi 2 avril 2016 13:08:20 UTC-4, Tazo Gil a écrit :
>
> Hello,
>
> The following request works in my dev django project (sqlite) by not in 
> production with postgres 
>
> out: >>> 
> Questionnaire.objects.filter(site_id=1).annotate(moyenne=Avg('chrono__temps')).values('title','moyenne')
>
> The errors : 
>
>  out: Traceback (most recent call last):
>  out:   File "", line 1, in 
>  out:   File 
> "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/query.py",
>  
> line 234, in __repr__
>  out: data = list(self[:REPR_OUTPUT_SIZE + 1])
>  out:   File 
> "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/query.py",
>  
> line 258, in __iter__
>  out: self._fetch_all()
>  out:   File 
> "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/query.py",
>  
> line 1074, in _fetch_all
>  out: self._result_cache = list(self.iterator())
>  out:   File 
> "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/query.py",
>  
> line 112, in __iter__
>  out: for row in compiler.results_iter():
>  out:   File 
> "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py",
>  
> line 808, in results_iter
>  out: row = self.apply_converters(row, converters)
>  out:   File 
> "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py",
>  
> line 792, in apply_converters
>  out: value = converter(value, expression, self.connection, 
> self.query.context)
>  out:   File 
> "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/expressions.py",
>  
> line 283, in convert_value
>  out: return float(value)
>  out: TypeError: float() argument must be a string or a number
>
> Thank you for your help.
>

-- 
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/ca32cc36-2f88-4c24-9a77-011ff4741fc4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Request works with sqlite not with Postgres

2016-04-02 Thread Tazo Gil

I forgot to precise the type of the  field Chrono.temps: 
temps = models.DurationField(null=True)

Le samedi 2 avril 2016 19:08:20 UTC+2, Tazo Gil a écrit :
>
> Hello,
>
> The following request works in my dev django project (sqlite) by not in 
> production with postgres 
>
> out: >>> 
> Questionnaire.objects.filter(site_id=1).annotate(moyenne=Avg('chrono__temps')).values('title','moyenne')
>
> The errors : 
>
>  out: Traceback (most recent call last):
>  out:   File "", line 1, in 
>  out:   File 
> "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/query.py",
>  
> line 234, in __repr__
>  out: data = list(self[:REPR_OUTPUT_SIZE + 1])
>  out:   File 
> "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/query.py",
>  
> line 258, in __iter__
>  out: self._fetch_all()
>  out:   File 
> "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/query.py",
>  
> line 1074, in _fetch_all
>  out: self._result_cache = list(self.iterator())
>  out:   File 
> "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/query.py",
>  
> line 112, in __iter__
>  out: for row in compiler.results_iter():
>  out:   File 
> "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py",
>  
> line 808, in results_iter
>  out: row = self.apply_converters(row, converters)
>  out:   File 
> "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py",
>  
> line 792, in apply_converters
>  out: value = converter(value, expression, self.connection, 
> self.query.context)
>  out:   File 
> "/home/mimi/.virtualenvs/atmav2/local/lib/python2.7/site-packages/django/db/models/expressions.py",
>  
> line 283, in convert_value
>  out: return float(value)
>  out: TypeError: float() argument must be a string or a number
>
> Thank you for your help.
>

-- 
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/2aa47b20-408b-474e-baca-c15b3c0dcfe1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [REQUEST] Please list all the deprecations in the changelogs.

2015-10-12 Thread Vasiliy Korol
Xavier, thank you!
My bad, I missed it. Sorry for the fuss, it was my fault.
Consider the question closed.

понедельник, 12 октября 2015 г., 15:21:22 UTC+2 пользователь Xavier Ordoquy 
написал:
>
> Hi Vasiliy, 
>
> > Le 12 oct. 2015 à 14:53, Vasiliy Korol  
> a écrit : 
> > 
> > Hi. 
> > I find it useful to turn DeprecationWarnings into exeptions on the 
> development server in order to ease the future transition to the next 
> Django LTS release. 
> > After migrating to Django 1.8.5, we received some unexpected exceptions 
> on the devel server, related to the recently deprecated features (like the 
> 'context_instance' kwarg in render_to_response() ). 
> > Could the developers please mention ALL the new deprecations in the 
> changelog for every minor version release? It would be very convenient to 
> know about these before upgrading. 
>
> Isn’t it mentioned  here: 
>
> https://docs.djangoproject.com/en/1.8/releases/1.8/#dictionary-and-context-instance-arguments-of-rendering-functions
>  
> ? 
>
> It says it’s removed in 1.10 which translates into a DeprecationWarning in 
> 1.8 
>
> Regards, 
> Xavier, 
> Linovia. 
>
>

-- 
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/71805239-93c6-4bf4-a3cf-1ae8794e9801%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [REQUEST] Please list all the deprecations in the changelogs.

2015-10-12 Thread Xavier Ordoquy
Hi Vasiliy,

> Le 12 oct. 2015 à 14:53, Vasiliy Korol  a écrit :
> 
> Hi.
> I find it useful to turn DeprecationWarnings into exeptions on the 
> development server in order to ease the future transition to the next Django 
> LTS release.
> After migrating to Django 1.8.5, we received some unexpected exceptions on 
> the devel server, related to the recently deprecated features (like the 
> 'context_instance' kwarg in render_to_response() ).
> Could the developers please mention ALL the new deprecations in the changelog 
> for every minor version release? It would be very convenient to know about 
> these before upgrading.

Isn’t it mentioned  here:
https://docs.djangoproject.com/en/1.8/releases/1.8/#dictionary-and-context-instance-arguments-of-rendering-functions
 ?

It says it’s removed in 1.10 which translates into a DeprecationWarning in 1.8

Regards,
Xavier,
Linovia.

-- 
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/9C687207-F2F4-446D-B84D-AA9202B6A363%40linovia.com.
For more options, visit https://groups.google.com/d/optout.


Re: [REQUEST] Please list all the deprecations in the changelogs.

2015-10-12 Thread Avraham Serour
could you contribute the list you made so it can be added to the release
notes, it is never too late to add them even for past releases

On Mon, Oct 12, 2015 at 3:53 PM, Vasiliy Korol 
wrote:

> Hi.
> I find it useful to turn DeprecationWarnings into exeptions on the
> development server in order to ease the future transition to the next
> Django LTS release.
> After migrating to Django 1.8.5, we received some unexpected exceptions on
> the devel server, related to the recently deprecated features (like the
> 'context_instance' kwarg in render_to_response() ).
> Could the developers please mention ALL the new deprecations in the
> changelog for every minor version release? It would be very convenient to
> know about these before upgrading.
>
> --
> 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/b325ef63-26da-47b6-8fe0-1544f2da06ab%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/CAFWa6tKmJqCzWWjbjYPAEDaMvw9qzdk%2BsHtGda_8gVJLmzY_qQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Request for comments on a new Open Source Paas platform for Django

2013-03-05 Thread Bruno Girin


On Tuesday, March 5, 2013 7:56:37 PM UTC, Dave Murphy wrote:
>
> On Tuesday, March 5, 2013 7:03:36 PM UTC, Bruno Girin wrote:
>>
>> So I'd much rather have the charm auto-generate part of the config in a 
>> sensible way and then tell people: if you use Juju, don't provide those 
>> settings in your config, the charm will do it.
>>
>
> ...and if they do? How is this any different to the code not handling 
> environment variables correctly?
>
> People are going to need to adapt their project to the charm no matter 
> what approach you take.
>

True. My point here is that if you ask people to adapt their project to 
work in Juju, it's easier for them and less error prone to say "don't 
provide this bit" than say "provide this bit in this particular way".

I quite like Christopher's suggestion of calling a python function from 
settings.py too. 

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Request for comments on a new Open Source Paas platform for Django

2013-03-05 Thread Dave Murphy
On Tuesday, March 5, 2013 7:03:36 PM UTC, Bruno Girin wrote:
>
> So I'd much rather have the charm auto-generate part of the config in a 
> sensible way and then tell people: if you use Juju, don't provide those 
> settings in your config, the charm will do it.
>

...and if they do? How is this any different to the code not handling 
environment variables correctly?

People are going to need to adapt their project to the charm no matter what 
approach you take.

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Request for comments on a new Open Source Paas platform for Django

2013-03-05 Thread Christopher Glass
For what it's worth, "other PaaS solutions" solve this by letting people
call a python function from settings.py

I think it's a good solution.
On Mar 5, 2013 8:04 PM, "Bruno Girin"  wrote:

>
>
> On Tuesday, 5 March 2013 13:35:41 UTC, Dave Murphy wrote:
>>
>> On Tuesday, March 5, 2013 1:17:13 PM UTC, Michael wrote:
>>>
>>> Are there other better options that wouldn't force people to change
>>> their code to use the charm?
>>>
>>
>> For the charm to be of sufficient value, it needs to be opinionated,
>> otherwise it's going to suffer from trying to work out-of-the-box for
>> everyone.
>>
>
> True but using environment variables only moves the problem somewhere
> else: it means that you still need to auto-generate the part of the startup
> script that sets the environment variables. Besides, as said above, it
> would force django app developers to explicitly use those environment
> variables and if they forget one of misspell it, the danger is that it
> would fail silently. Then the risk is that it's hard to debug because
> you're hunting setting values in two places: the django settings and the
> startup scripts that sets the environment variables.
>
> So I'd much rather have the charm auto-generate part of the config in a
> sensible way and then tell people: if you use Juju, don't provide those
> settings in your config, the charm will do it.
>
> Bruno
>
> --
> 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/979lJojyxs0/unsubscribe?hl=en
> .
> 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 http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Request for comments on a new Open Source Paas platform for Django

2013-03-05 Thread Bruno Girin


On Tuesday, 5 March 2013 13:35:41 UTC, Dave Murphy wrote:
>
> On Tuesday, March 5, 2013 1:17:13 PM UTC, Michael wrote:
>>
>> Are there other better options that wouldn't force people to change their 
>> code to use the charm?
>>
>
> For the charm to be of sufficient value, it needs to be opinionated, 
> otherwise it's going to suffer from trying to work out-of-the-box for 
> everyone.
>

True but using environment variables only moves the problem somewhere else: 
it means that you still need to auto-generate the part of the startup 
script that sets the environment variables. Besides, as said above, it 
would force django app developers to explicitly use those environment 
variables and if they forget one of misspell it, the danger is that it 
would fail silently. Then the risk is that it's hard to debug because 
you're hunting setting values in two places: the django settings and the 
startup scripts that sets the environment variables.

So I'd much rather have the charm auto-generate part of the config in a 
sensible way and then tell people: if you use Juju, don't provide those 
settings in your config, the charm will do it.

Bruno

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Request for comments on a new Open Source Paas platform for Django

2013-03-05 Thread Dave Murphy
On Tuesday, March 5, 2013 1:17:13 PM UTC, Michael wrote:
>
> Are there other better options that wouldn't force people to change their 
> code to use the charm?
>

For the charm to be of sufficient value, it needs to be opinionated, 
otherwise it's going to suffer from trying to work out-of-the-box for 
everyone.

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Request for comments on a new Open Source Paas platform for Django

2013-03-05 Thread Michael Nelson
On Tue, Mar 5, 2013 at 1:55 PM, Dave Murphy  wrote:

> On Sunday, March 3, 2013 4:45:56 PM UTC, Bruno Girin wrote:
>
>> Patrick solved that problem by separating different config elements in
>> different files but this implies that juju'ised applications would need to
>> follow the same structure. Is that a good idea?
>
>
> If you're aiming for a PaaS-style charm for Django, then trying to emulate
> The Twelve-Factor App [1] and it's opinions on configuration [2] would be a
> good starting point. Basically, if there are things specific to the
> environment then they should be in environment variables, not in generated
> or modified config files.
>
>

+1 - but Django doesn't support env vars overriding settings out of the box
(although configglue does enable this) which means forcing people using the
charm to update their settings (rather than just encouraging good
practise). That said, it might be a small (and worthwhile) thing to ask of
people wanting to use the charm. (ie. to use this charm, your settings need
to read the following env vars...) If not, writing a local_settings.py that
overrides the required settings from the env may work:

local_settings.py:
{{{
import os
from userproject.settings import *

LANGUAGE_CODE = os.environ['DJANGO_LANGUAGE_CODE']
...
}}}

Are there other better options that wouldn't force people to change their
code to use the charm?

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Request for comments on a new Open Source Paas platform for Django

2013-03-05 Thread Dave Murphy
On Sunday, March 3, 2013 4:45:56 PM UTC, Bruno Girin wrote:

> Patrick solved that problem by separating different config elements in 
> different files but this implies that juju'ised applications would need to 
> follow the same structure. Is that a good idea?


If you're aiming for a PaaS-style charm for Django, then trying to emulate 
The Twelve-Factor App [1] and it's opinions on configuration [2] would be a 
good starting point. Basically, if there are things specific to the 
environment then they should be in environment variables, not in generated 
or modified config files.

 

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Request for comments on a new Open Source Paas platform for Django

2013-03-05 Thread Michael
On Sunday, 3 March 2013 17:45:56 UTC+1, Bruno Girin wrote:

> The main stumbling block at the moment and for which we could do with 
> Django expertise is about the structure of the settings files. Some 
> settings are application specific and should be left alone by Juju, others 
> are environment specific and should be generated by Juju (database config 
> for instance). Patrick solved that problem by separating different config 
> elements in different files but this implies that juju'ised applications 
> would need to follow the same structure. Is that a good idea?
>
>
I had a go at something similar a while back [1] (well, a very cut-down 
version of what you guys are attempting), and for that I used configglue's 
in-built support for local settings that override the project settings [2], 
but I'm assuming in this case we'd not want to force juju'ised projects to 
use configglue either.

I've not tried this on any production app, or thought about it more than 
the example below - perhaps others can say the obvious issues they see - 
but one idea that comes to mind is just reversing how people normally split 
up their settings files, something like:

{{{
$ django-admin startproject test_settings
$ cd test_settings/
$ echo 'from django.conf import settings;print("Debug is: %s. LangCode is: 
%s" % (settings.DEBUG, settings.LANGUAGE_CODE))' | ./manage.py shell --plain

(prints "Debug is: True. LangCode is: en-us")

$ echo -e "from test_settings.settings import *\nDEBUG = False" > 
local_settings.py
$ echo 'from django.conf import settings;print("Debug is: %s. LangCode is: 
%s" % (settings.DEBUG, settings.LANGUAGE_CODE))' | ./manage.py shell 
--plain --settings=local_settings

(prints "Debug is: False. LangCode is: en-us")
}}}

-Michael

[1] 
http://micknelson.wordpress.com/2011/11/22/a-generic-juju-charm-for-django-apps/
[2] 
http://bazaar.launchpad.net/~michael.nelson/charms/oneiric/apache-django-wsgi/trunk/view/head:/hooks/manifests/database_settings.pp

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Request for comments on a new Open Source Paas platform for Django

2013-03-03 Thread Bruno Girin
Hi Chris,

I've been working with Patrick on this charm and I implemented a simple 
version of support for private repositories. It basically creates a .netrc 
file with the user name and password for the correct machine. It's not 
ideal but it did enable me to get code from a private github repo. We need 
something more robust in the long term but it's a start.

Regarding the concept of running gunicorn on a different machine, this will 
not be necessary going forward. v2.0 of Juju is meant to support 
co-location where you could have different services on the same machine (in 
practice this is already supported in the jitsu package). However, 
Patrick's idea is to ensure that you can use any WSGI server, whether 
Apache or gunicorn without having to force one or the other.

Everything else you suggest is definitely in the pipe. The main stumbling 
block at the moment and for which we could do with Django expertise is 
about the structure of the settings files. Some settings are application 
specific and should be left alone by Juju, others are environment specific 
and should be generated by Juju (database config for instance). Patrick 
solved that problem by separating different config elements in different 
files but this implies that juju'ised applications would need to follow the 
same structure. Is that a good idea?

Cheers,

Bruno

On Saturday, 2 March 2013 20:14:19 UTC, Christopher Glass wrote:
>
> Hi Patrick,
>
> Great to hear you're interested in writing a Django charm for juju! I have 
> toyed around with the idea, but never got around to implementing something 
> good.
> I started looking at the current Django charm a little while ago, and 
> while it works to some extend I think we could make really great things 
> happen with a little work.
>
> As far as feedback for your point goes, here are a few points and 
> suggestion I'd like to add to the discussion:
>
> - Most of the Django websites will likely live in private git/bzr/whatever 
> repositories, and so in the workflow you outlined, you need to somehow push 
> the *private identifier* to the running juju instance. In the "standard" 
> scenario that means pushing your private ssh key to the instance, so it can 
> git clone from a private repository on github... I think it's safe to say 
> that most people will at least frown at the idea :)
> Maybe we should instead make this a "push" process?
>
> - It seems a little strange to me to run gunicorn on another machine. Most 
> of the Django project I have encountered run Django with gunicorn on the 
> webservers themselves (add gunicorn to INSTALLED_APPS and then "manage.py 
> run_gunicorn"). Perhaps we should be a little more opinionated about things 
> and for the sake of scaling simplicity deploy nginx or apache locally too 
> (wither with a charm subordinate or at install), so that we can 
> load-balance to all of the servers easily with any frontend (that means all 
> webservers would serve static files, which might not be optimal, but we can 
> refine that later).
>
> - We should absolutely define a cache relation (redis or memcached).
>
> Theses points would make the whole workflow look like the following (the 
> juju syntax might be a little wrong, but please bear with me :) )
>
>   juju bootstrap
>
>   juju deploy --config my_django_conf.yaml cs:django_server my_django_site
>   juju deploy cs:postgresql # or mysql,mongodb, etc
>   juju deploy cs:memcached # or redis if that's still popular
>   juju deploy cs:haproxy
>
>   juju add-relation my_django_site postgresql
>   juju add-relation my_django_site memcached
>   juju add-relation my_django_site haproxy # strictly speaking that's 
> optional if you have only one django machine
>
>   juju expose haproxy
>
>   # when needed (I hope we all need it someday!)
>   juju add-unit my_django_site
>   juju add-unit memcached
>   juju add-unit postgresql
>
> So now we would have a running django server with no code.
> But if it's a push process, we can implement many of the config changes as 
> git hooks, which makes the workflow continue with:
>
>   cd my-django-site
>   git init . # If that's not done already of course
>   git add .
>   git commit -m "produciton push yay!"
>   git remote add production 
> git+ssh://my_django_site/some_configurable_url.git
>   git push production master # or of course whatever branch you put in the 
> config.yaml
>
> Of course, that requires a non-trivial amount of git triggers to be 
> written, and we should put some requirements.pip.txt file and 
> requirements.apt.txt or whatever in the project tree, but I think that's 
> acceptable.
> The whole thing basically follows what many PaaS providers already do, so 
> I guess most Django developers with some sites in production probably are 
> familiar with the workflow. 
>
> This would just add the juju coolness to it :)
>
> Hope this fuels the discussion,
>
> - Chris
>
> On Friday, March 1, 2013 8:13:36 PM UTC+1, Patrick wrote:
>>
>> Hi,
>>
>> I'm building a 

Re: Request for comments on a new Open Source Paas platform for Django

2013-03-02 Thread Christopher Glass
Hi Patrick,

Great to hear you're interested in writing a Django charm for juju! I have 
toyed around with the idea, but never got around to implementing something 
good.
I started looking at the current Django charm a little while ago, and while 
it works to some extend I think we could make really great things happen 
with a little work.

As far as feedback for your point goes, here are a few points and 
suggestion I'd like to add to the discussion:

- Most of the Django websites will likely live in private git/bzr/whatever 
repositories, and so in the workflow you outlined, you need to somehow push 
the *private identifier* to the running juju instance. In the "standard" 
scenario that means pushing your private ssh key to the instance, so it can 
git clone from a private repository on github... I think it's safe to say 
that most people will at least frown at the idea :)
Maybe we should instead make this a "push" process?

- It seems a little strange to me to run gunicorn on another machine. Most 
of the Django project I have encountered run Django with gunicorn on the 
webservers themselves (add gunicorn to INSTALLED_APPS and then "manage.py 
run_gunicorn"). Perhaps we should be a little more opinionated about things 
and for the sake of scaling simplicity deploy nginx or apache locally too 
(wither with a charm subordinate or at install), so that we can 
load-balance to all of the servers easily with any frontend (that means all 
webservers would serve static files, which might not be optimal, but we can 
refine that later).

- We should absolutely define a cache relation (redis or memcached).

Theses points would make the whole workflow look like the following (the 
juju syntax might be a little wrong, but please bear with me :) )

  juju bootstrap

  juju deploy --config my_django_conf.yaml cs:django_server my_django_site
  juju deploy cs:postgresql # or mysql,mongodb, etc
  juju deploy cs:memcached # or redis if that's still popular
  juju deploy cs:haproxy

  juju add-relation my_django_site postgresql
  juju add-relation my_django_site memcached
  juju add-relation my_django_site haproxy # strictly speaking that's 
optional if you have only one django machine

  juju expose haproxy

  # when needed (I hope we all need it someday!)
  juju add-unit my_django_site
  juju add-unit memcached
  juju add-unit postgresql

So now we would have a running django server with no code.
But if it's a push process, we can implement many of the config changes as 
git hooks, which makes the workflow continue with:

  cd my-django-site
  git init . # If that's not done already of course
  git add .
  git commit -m "produciton push yay!"
  git remote add production 
git+ssh://my_django_site/some_configurable_url.git
  git push production master # or of course whatever branch you put in the 
config.yaml

Of course, that requires a non-trivial amount of git triggers to be 
written, and we should put some requirements.pip.txt file and 
requirements.apt.txt or whatever in the project tree, but I think that's 
acceptable.
The whole thing basically follows what many PaaS providers already do, so I 
guess most Django developers with some sites in production probably are 
familiar with the workflow. 

This would just add the juju coolness to it :)

Hope this fuels the discussion,

- Chris

On Friday, March 1, 2013 8:13:36 PM UTC+1, Patrick wrote:
>
> Hi,
>
> I'm building a Juju based Open Source Paas platform for Django and
> I need your help because it is a hard task to make a PAAS system
> that is flexible enough to deploy any projects and at the same time
> simple to use.
>
> For the ones that don't know Juju, it's a service orchestration software
> compatible with LXC (local), EC2, HPCloud, OpenStack and Baremetal/Maas
> developed by Canonical (the company that makes Ubuntu).
>
> Check out the web site for more details: https://juju.ubuntu.com/
>
> So quickly, here's how it would works:
>
> After installing Juju and configuring it with for your favourite cloud 
> provider you
> will need to create a configuration file in the YAML format named 
> my_django_conf.yaml
> in this example::
>
>   my_django_site:
>   vcs: git
>   repos_url: https://github.com/my_username/my_site.git 
>   site_secret_key: abcdefgh123456789
>   use_virtualenv: True
>
> Then you will need these commands to bootstrap and launch all the servers::
>
>   juju bootstrap
>
>   juju deploy --config my_django_conf.yaml my_django_site
>   juju deploy postgresql # or mysql,mongodb, etc
>   juju deploy gunicorn # Or mod_wsgi, etc
>
>   juju add-relation my_django_site postgresql
>   juju add-relation my_django_site gunicorn
>
>   juju expose gunicorn # Open the tcp port in the firewall
>
> You will end up with 3 servers running. One will be the controller
> and one for each service (django and the database). 
> Gunicorn will be a special charm that will be installed on your Django 
> server.
> After that, adding a new Django node would be 

Re: Request for inspiration on business system

2012-11-21 Thread Lachlan Musicman
On Thursday, November 22, 2012, Peter Edström wrote:

> *Lachlan Musicman:*
> You recommend using virtualenv. Why and in what scenarios? If I understand
> it correctly, virtualenv sets up a virtual python environment galvanically
> isolated from the rest of the system and I see how this let you go crazy
> and experiment without risking anything. Is this the main reason why people
> use it or are there other reasons?
>

People have already said it, but the stability is definitely a factor. I
run Ubuntu, so Django isn't always installed the way I want it to be. Plus,
other considerations come into force - I remember at one stage (maybe
still) the ppa for the e-reader software calibre had a dependency on
django, which would often mean there were two djangos installed - this can
be confusing.

Virtualenv (and virtualenvwrapper) keeps everything tightly contained, and
that's handy. Also, once you are using pip inside virtualenv, you have the
same advantages - everything you install inside the VE with pip will be
contained.

And to repeat again what others have said, it makes re-deployment a lot
easier.



> *Issam Outassourt*:
> Thanks for the summary of the major components of Django. I've read about
> models, views, templates et c and played around with them some, but it's
> very easy to get stuck on details and forget the big picture. The
> methodology you describe seems quite simple and straight-forward and I
> guess it all comes down to what I guess is your (and Lachlan's) point: get
> busy and learn on the way.
>

Yeah, I read the docs a dozen times before I started - and it didn't help
nearly so much as just starting (on a non tutorial project). Note that I
still read the docs (they are comprehensive and excellent) daily, depending
on needs.


> Thank you for the replies.
>

No hassles - that's what we are here for!


-- 
...we look at the present day through a rear-view mirror. This is something
Marshall McLuhan said back in the Sixties, when the world was in the grip
of authentic-seeming future narratives. He said, “We look at the present
through a rear-view mirror. We march backwards into the future.”

http://www.warrenellis.com/?p=14314

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Request for inspiration on business system

2012-11-21 Thread Tom Evans
On Wed, Nov 21, 2012 at 5:23 PM, Issam Outassourt
 wrote:
> Well, I do not totally agree with your point.
> The problem with virtual environments such as these is that you have trouble
> sometimes figuring out what actually happens behind the scripts that are
> used to initialize your environment. Thus comes a natural habit that I
> personally developed which is to say, whatever external tool that you need a
> specific version for, get the latter version and install it within a
> directory that would look like something of this kind /external/django/bin/
> And add that directory to your Django project path in your settings.py
> This has the advantage to let you know when you deploy your app, which are
> the real specifics that you need to install back again on your development
> server.
>
> Did that help ?
> Again, it's my personal opinion. Be careful to choose what suits you.

virtualenv doesn't actually do any 'magic behind the scenes', it
simply changes your $PATH so that the correct python interpreter is
found, and hence uses the correct 'site-packages' folder inside your
virtualenv.

I personally think manually manipulating sys.path inside your
settings, or inside your wsgi file, is much more troublesome.

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Request for inspiration on business system

2012-11-21 Thread Issam Outassourt
Well, I do not totally agree with your point.
The problem with virtual environments such as these is that you have
trouble sometimes figuring out what actually happens behind the scripts
that are used to initialize your environment. Thus comes a natural habit
that I personally developed which is to say, whatever external tool that
you need a specific version for, get the latter version and install it
within a directory that would look like something of this kind
/external/django/bin/
And add that directory to your Django project path in your settings.py
This has the advantage to let you know when you deploy your app, which are
the real specifics that you need to install back again on your development
server.

Did that help ?
Again, it's my personal opinion. Be careful to choose what suits you.

--
Issam Outassourt
Le 21 nov. 2012 16:39, "Javier Guerra Giraldez"  a
écrit :

> On Wed, Nov 21, 2012 at 10:11 AM, Peter Edström 
> wrote:
> > You recommend using virtualenv. Why and in what scenarios?
>
> always.
>
> each and every time i haven't used it, i've regretted it later.  it
> not only lets you experiment  but also in deployment you're guaranteed
> a stable environment.  Also it makes it quite easy to reproduce the
> deployed environment in your desktop long time afterwards, when you've
> already forgotten how it was development before the latest and
> greatest versions of everything.
>
> --
> Javier
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Request for inspiration on business system

2012-11-21 Thread Javier Guerra Giraldez
On Wed, Nov 21, 2012 at 10:11 AM, Peter Edström  wrote:
> You recommend using virtualenv. Why and in what scenarios?

always.

each and every time i haven't used it, i've regretted it later.  it
not only lets you experiment  but also in deployment you're guaranteed
a stable environment.  Also it makes it quite easy to reproduce the
deployed environment in your desktop long time afterwards, when you've
already forgotten how it was development before the latest and
greatest versions of everything.

--
Javier

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Request for inspiration on business system

2012-11-21 Thread Peter Edström
*Lachlan Musicman:*
You recommend using virtualenv. Why and in what scenarios? If I understand 
it correctly, virtualenv sets up a virtual python environment galvanically 
isolated from the rest of the system and I see how this let you go crazy 
and experiment without risking anything. Is this the main reason why people 
use it or are there other reasons?

*Issam Outassourt*:
Thanks for the summary of the major components of Django. I've read about 
models, views, templates et c and played around with them some, but it's 
very easy to get stuck on details and forget the big picture. The 
methodology you describe seems quite simple and straight-forward and I 
guess it all comes down to what I guess is your (and Lachlan's) point: get 
busy and learn on the way.


Thank you for the replies.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/PFT9grzptvUJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Request for inspiration on business system

2012-11-20 Thread Lachlan Musicman
On Wed, Nov 21, 2012 at 8:37 AM, Peter Edström  wrote:
> Hello,

Hi!

> A company's internal business database system pretty much, and nothing new
> under the sun. Perhaps accompanied by an external website further on.
> Now on to the questions.
>
> Do you think Django would be suitable for this?

Yep!

> Do you have some spontaneous ideas and/or pre-made code snippets that could
> be handy (like a calendar)?

1. Do the tutorial.
2. Set up using virtualenv (for compartmentalising), pip (for
installing) and South (because you will need it as your models
change).
3. djangosnippets.org is a good place to start, and to get ideas.

> How would you structure the project;
> Everything in one app, or how would you split them? One for employee
> interface, one for admin interface (perhaps use the built-in admin system),
> one for external website? Is this bad design?

I would put everything in one app - it's seems small enough that this
will suffice. Too much fragmentation will just cause headaches. I
believe that others will disagree with me on this.

> I would like to design is such that it will be easy to expand, e.g. with
> statistics on hours worked, integration with invoice system, database
> accessible by Android app... or whatever. But being new to Django I'm
> not really comfortable with basic design principles.
>
> Any input is appreciated and of course I'm reading up in Django Book,
> watching YouTube videos and exploring code as much as I can.

Just get started - that's the best way to learn. The number of times I
got halfway through implementing something and then discovered that
there was already a django goody waiting to make life easier for me
(slugify, get_absolute_url, SortedDict, actions...) - but I had to
know what to ask for first. I think jumping in is especially important
if you are new to Django.

Cheers
L.



>
> Thank you.
> Best regards,
> Peter
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/geK-jXEjDQEJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.



--
...we look at the present day through a rear-view mirror. This is
something Marshall McLuhan said back in the Sixties, when the world
was in the grip of authentic-seeming future narratives. He said, “We
look at the present through a rear-view mirror. We march backwards
into the future.”

http://www.warrenellis.com/?p=14314

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Request for comments - django-cutemodel (model logging and field change auditing)

2012-09-13 Thread Cal Leeming [Simplicity Media Ltd]
On Thu, Sep 13, 2012 at 9:42 AM, Derek  wrote:

> Cal
>
> Great post; I think you summed up my feelings about django-reversion as
> well, although articulated extremely clearly.
>
> If CuteModel (where does that name come from??)
>

Cute was the first word that came to my head, thought it sounded catchy

can address the issue of reverting a change to a record (or, even better,
> all changes made at one time to a record), then I think it will be a great
> alternative option for many folk.
>

Yeah after the last few posts, I realised there were a few structural
changes that needed to be made - one of those being that field changes need
to be grouped by a Revision() object, so you can revert the entire revision
or just bits from it.

I also figured that the API needs to expose data to the original save()
method call, such as the revision object, so they can integrate this into
their existing application (for example, if they have 3 models that get
saved in 1 form save, they might want to take all 3 IDs, then create an
extra revision layer that lets them revert them all in one go - rather than
try and normalize this, exposing the revision object would give the user
enough control)


>
> Cheers,
> Derek
>
>
> On Tuesday, 11 September 2012 21:11:06 UTC+2, Cal Leeming [Simplicity
> Media Ltd] wrote:
>
>> Thanks for letting me know about django-reversion, it has made for
>> interesting reading.
>>
>> From what I can see there are two big differences between them;
>>
>> * CuteModel is designed with performance/scalability in mind (as some of
>> our projects are tipping into the 700+mil row count and rising)
>> * CuteModel is designed to be as simple and easy as possible - where as
>> django-reversion left me feeling a bit confused.
>>
>> Looking at django-reversion, it certainly looks close to cutemodel, but
>> there are a few differences;
>>
>> * Changes are serialized into the database, this adds a significant extra
>> size and CPU overhead (Version.serialized_data)
>> * Object references are stored as a TextField, this is not good for
>> performance (Version.object_id)
>> * Creates a new serialized object every time a row is added - this is
>> really really not good for performance(*.VERSION_ADD)
>> * Requires an additional model for every model you have if you want to
>> store custom meta data (cutemodel only requires 1)
>> * Uses signal rather than overriding the subclass - although this is
>> probably a better approach - thoughts anyone??
>> * In some ways the API is quite nice, but in others it seems a bit clunky.
>> * Requires you to create initial revisions dump - again, not good if you
>> have a lot of rows
>>
>> That being said - there are definitely some good points from that app,
>> and a lot of features that would be great for CuteModel, such as;
>>
>> * Grouping together field changes into a 'revision'
>> * Better low level API support
>> * Ability to revert a change
>>
>> I'm certainly going to add those into the todos list - thanks for your
>> feedback!
>>
>> Cal
>>
>> On Tue, Sep 11, 2012 at 2:46 PM, jondykeman  wrote:
>>
>>> Hello,
>>>
>>> I am in a very similar situation. I would in an environment that deals
>>> with sensitive data collection. Everything has to be two-factor
>>> authenticated, in the secure server zone etc. As part of this we need
>>> logging of every action ever taken, by whom, when, and what the changes
>>> were.
>>>
>>> At first I implemented my own custom solution which was less than ideal,
>>> but it worked. That was a model of creating a new record for each field any
>>> time there was a change to the value, but via a lot of manual checking
>>> code.
>>>
>>> I am not starting to migrate to a slicker solution. I am taking
>>> advantage of django-reversion.
>>>
>>> https://github.com/etianen/**django-reversion
>>>
>>> This provides row level auditing out of the box, and then you just need
>>> to take advantage of the pre_commit_signal to track field changes as well.
>>>
>>> @receiver(reversion.pre_**revision_commit)
>>> def it_worked(sender, **kwargs):
>>> currentVersion = kwargs.pop('versions')[0].**field_dict
>>> pastVersion = reversion.get_for_object(**kwargs.pop('instances')[0])[0]*
>>> *.field_dict
>>>  changes = set(currentVersion.items()) - set(pastVersion.items())
>>> changedVars = []
>>> for var in changes:
>>>  changedVars.append(var[0])
>>> comment = "Changed: %s" % ", ".join(changedVars)
>>> revision = kwargs.pop('revision')
>>>  revision.comment = comment
>>> revision.save()
>>> kwargs['revision'] = revision
>>>
>>> Rather than the string tracking which fields I am going to switch to a
>>> dict of changed or not for each variable.
>>>
>>> I will check out cutemodel for sure and let you know.
>>>
>>> Thanks,
>>>
>>> JD
>>>
>>>
>>> On Tuesday, September 11, 2012 3:46:54 AM UTC-6, Cal Leeming [Simplicity
>>> Media Ltd] wrote:



 On Mon, Sep 10, 2012 at 11:07 PM, 

Re: Request for comments - django-cutemodel (model logging and field change auditing)

2012-09-13 Thread Derek
Cal

Great post; I think you summed up my feelings about django-reversion as 
well, although articulated extremely clearly.

If CuteModel (where does that name come from??) can address the issue of 
reverting a change to a record (or, even better, all changes made at one 
time to a record), then I think it will be a great alternative option for 
many folk.

Cheers,
Derek

On Tuesday, 11 September 2012 21:11:06 UTC+2, Cal Leeming [Simplicity Media 
Ltd] wrote:
>
> Thanks for letting me know about django-reversion, it has made for 
> interesting reading.
>
> From what I can see there are two big differences between them;
>
> * CuteModel is designed with performance/scalability in mind (as some of 
> our projects are tipping into the 700+mil row count and rising)
> * CuteModel is designed to be as simple and easy as possible - where as 
> django-reversion left me feeling a bit confused.
>
> Looking at django-reversion, it certainly looks close to cutemodel, but 
> there are a few differences;
>
> * Changes are serialized into the database, this adds a significant extra 
> size and CPU overhead (Version.serialized_data)
> * Object references are stored as a TextField, this is not good for 
> performance (Version.object_id)
> * Creates a new serialized object every time a row is added - this is 
> really really not good for performance(*.VERSION_ADD)
> * Requires an additional model for every model you have if you want to 
> store custom meta data (cutemodel only requires 1)
> * Uses signal rather than overriding the subclass - although this is 
> probably a better approach - thoughts anyone??
> * In some ways the API is quite nice, but in others it seems a bit clunky.
> * Requires you to create initial revisions dump - again, not good if you 
> have a lot of rows
>
> That being said - there are definitely some good points from that app, and 
> a lot of features that would be great for CuteModel, such as;
>
> * Grouping together field changes into a 'revision'
> * Better low level API support
> * Ability to revert a change
>
> I'm certainly going to add those into the todos list - thanks for your 
> feedback!
>
> Cal
>
> On Tue, Sep 11, 2012 at 2:46 PM, jondykeman  > wrote:
>
>> Hello,
>>
>> I am in a very similar situation. I would in an environment that deals 
>> with sensitive data collection. Everything has to be two-factor 
>> authenticated, in the secure server zone etc. As part of this we need 
>> logging of every action ever taken, by whom, when, and what the changes 
>> were.
>>
>> At first I implemented my own custom solution which was less than ideal, 
>> but it worked. That was a model of creating a new record for each field any 
>> time there was a change to the value, but via a lot of manual checking 
>> code. 
>>
>> I am not starting to migrate to a slicker solution. I am taking advantage 
>> of django-reversion.
>>
>> https://github.com/etianen/django-reversion
>>
>> This provides row level auditing out of the box, and then you just need 
>> to take advantage of the pre_commit_signal to track field changes as well.
>>
>> @receiver(reversion.pre_revision_commit)
>> def it_worked(sender, **kwargs):
>> currentVersion = kwargs.pop('versions')[0].field_dict
>> pastVersion = 
>> reversion.get_for_object(kwargs.pop('instances')[0])[0].field_dict
>>  changes = set(currentVersion.items()) - set(pastVersion.items())
>> changedVars = []
>> for var in changes:
>>  changedVars.append(var[0])
>> comment = "Changed: %s" % ", ".join(changedVars)
>> revision = kwargs.pop('revision')
>>  revision.comment = comment
>> revision.save()
>> kwargs['revision'] = revision
>>
>> Rather than the string tracking which fields I am going to switch to a 
>> dict of changed or not for each variable.
>>
>> I will check out cutemodel for sure and let you know.
>>
>> Thanks,
>>
>> JD
>>
>>
>> On Tuesday, September 11, 2012 3:46:54 AM UTC-6, Cal Leeming [Simplicity 
>> Media Ltd] wrote:
>>>
>>>
>>>
>>> On Mon, Sep 10, 2012 at 11:07 PM, Kurt Pruhs  wrote:
>>>
 Hey Cal,

 This looks like a great tool. I know I've implemented code like this in 
 another project. I was planning on doing a field change audit module for 
 an 
 application I'm currently working on. I will definitely look at 
 django-cutemodel and see if it works for what I need, and how I can 
 contribute. 
 My current project is a time clock system for human resources to manage 
 hourly workers. We need field change auditing for security, we need the 
 ability to produce reports from it, and ability to restore from audit 
 history (in case of record tampering). 
>>>
>>>
>>> I think django-cutemodel would be a pretty good fit for this 
>>> requirement, although it doesn't yet have any sort of administration 
>>> interface to produce reports, and the documentation isn't exactly great.
>>>
>>> Restore from audit history functionality is something we need for 
>>> ourselves too, so I've 

Re: Request for comments - django-cutemodel (model logging and field change auditing)

2012-09-11 Thread Cal Leeming [Simplicity Media Ltd]
Thanks for letting me know about django-reversion, it has made for
interesting reading.

>From what I can see there are two big differences between them;

* CuteModel is designed with performance/scalability in mind (as some of
our projects are tipping into the 700+mil row count and rising)
* CuteModel is designed to be as simple and easy as possible - where as
django-reversion left me feeling a bit confused.

Looking at django-reversion, it certainly looks close to cutemodel, but
there are a few differences;

* Changes are serialized into the database, this adds a significant extra
size and CPU overhead (Version.serialized_data)
* Object references are stored as a TextField, this is not good for
performance (Version.object_id)
* Creates a new serialized object every time a row is added - this is
really really not good for performance(*.VERSION_ADD)
* Requires an additional model for every model you have if you want to
store custom meta data (cutemodel only requires 1)
* Uses signal rather than overriding the subclass - although this is
probably a better approach - thoughts anyone??
* In some ways the API is quite nice, but in others it seems a bit clunky.
* Requires you to create initial revisions dump - again, not good if you
have a lot of rows

That being said - there are definitely some good points from that app, and
a lot of features that would be great for CuteModel, such as;

* Grouping together field changes into a 'revision'
* Better low level API support
* Ability to revert a change

I'm certainly going to add those into the todos list - thanks for your
feedback!

Cal

On Tue, Sep 11, 2012 at 2:46 PM, jondykeman  wrote:

> Hello,
>
> I am in a very similar situation. I would in an environment that deals
> with sensitive data collection. Everything has to be two-factor
> authenticated, in the secure server zone etc. As part of this we need
> logging of every action ever taken, by whom, when, and what the changes
> were.
>
> At first I implemented my own custom solution which was less than ideal,
> but it worked. That was a model of creating a new record for each field any
> time there was a change to the value, but via a lot of manual checking
> code.
>
> I am not starting to migrate to a slicker solution. I am taking advantage
> of django-reversion.
>
> https://github.com/etianen/django-reversion
>
> This provides row level auditing out of the box, and then you just need to
> take advantage of the pre_commit_signal to track field changes as well.
>
> @receiver(reversion.pre_revision_commit)
> def it_worked(sender, **kwargs):
> currentVersion = kwargs.pop('versions')[0].field_dict
> pastVersion =
> reversion.get_for_object(kwargs.pop('instances')[0])[0].field_dict
> changes = set(currentVersion.items()) - set(pastVersion.items())
> changedVars = []
> for var in changes:
> changedVars.append(var[0])
> comment = "Changed: %s" % ", ".join(changedVars)
> revision = kwargs.pop('revision')
> revision.comment = comment
> revision.save()
> kwargs['revision'] = revision
>
> Rather than the string tracking which fields I am going to switch to a
> dict of changed or not for each variable.
>
> I will check out cutemodel for sure and let you know.
>
> Thanks,
>
> JD
>
>
> On Tuesday, September 11, 2012 3:46:54 AM UTC-6, Cal Leeming [Simplicity
> Media Ltd] wrote:
>>
>>
>>
>> On Mon, Sep 10, 2012 at 11:07 PM, Kurt Pruhs  wrote:
>>
>>> Hey Cal,
>>>
>>> This looks like a great tool. I know I've implemented code like this in
>>> another project. I was planning on doing a field change audit module for an
>>> application I'm currently working on. I will definitely look at
>>> django-cutemodel and see if it works for what I need, and how I can
>>> contribute.
>>> My current project is a time clock system for human resources to manage
>>> hourly workers. We need field change auditing for security, we need the
>>> ability to produce reports from it, and ability to restore from audit
>>> history (in case of record tampering).
>>
>>
>> I think django-cutemodel would be a pretty good fit for this requirement,
>> although it doesn't yet have any sort of administration interface to
>> produce reports, and the documentation isn't exactly great.
>>
>> Restore from audit history functionality is something we need for
>> ourselves too, so I've raised an issue (will prob fix that sometime this
>> week);
>> https://github.com/foxx/**django-cutemodel/issues/1
>>
>> We also need to have the ability to bind the Django User objects together
>> with the event/field change - but some of our clients don't use the Django
>> built-in user/auth stuff - so I need to have a little think about how to
>> satisfy both.
>> https://github.com/foxx/**django-cutemodel/issues/2
>>
>> Basically, all actions are logged and nothing is deleted or over-written.
>>> When changes are made, the original record is 

Re: Request for comments - django-cutemodel (model logging and field change auditing)

2012-09-11 Thread jondykeman
Hello,

I am in a very similar situation. I would in an environment that deals with 
sensitive data collection. Everything has to be two-factor authenticated, 
in the secure server zone etc. As part of this we need logging of every 
action ever taken, by whom, when, and what the changes were.

At first I implemented my own custom solution which was less than ideal, 
but it worked. That was a model of creating a new record for each field any 
time there was a change to the value, but via a lot of manual checking 
code. 

I am not starting to migrate to a slicker solution. I am taking advantage 
of django-reversion.

https://github.com/etianen/django-reversion

This provides row level auditing out of the box, and then you just need to 
take advantage of the pre_commit_signal to track field changes as well.

@receiver(reversion.pre_revision_commit)
def it_worked(sender, **kwargs):
currentVersion = kwargs.pop('versions')[0].field_dict
pastVersion = 
reversion.get_for_object(kwargs.pop('instances')[0])[0].field_dict
changes = set(currentVersion.items()) - set(pastVersion.items())
changedVars = []
for var in changes:
changedVars.append(var[0])
comment = "Changed: %s" % ", ".join(changedVars)
revision = kwargs.pop('revision')
revision.comment = comment
revision.save()
kwargs['revision'] = revision

Rather than the string tracking which fields I am going to switch to a dict 
of changed or not for each variable.

I will check out cutemodel for sure and let you know.

Thanks,

JD


On Tuesday, September 11, 2012 3:46:54 AM UTC-6, Cal Leeming [Simplicity 
Media Ltd] wrote:
>
>
>
> On Mon, Sep 10, 2012 at 11:07 PM, Kurt Pruhs  > wrote:
>
>> Hey Cal,
>>
>> This looks like a great tool. I know I've implemented code like this in 
>> another project. I was planning on doing a field change audit module for an 
>> application I'm currently working on. I will definitely look at 
>> django-cutemodel and see if it works for what I need, and how I can 
>> contribute. 
>> My current project is a time clock system for human resources to manage 
>> hourly workers. We need field change auditing for security, we need the 
>> ability to produce reports from it, and ability to restore from audit 
>> history (in case of record tampering). 
>
>
> I think django-cutemodel would be a pretty good fit for this requirement, 
> although it doesn't yet have any sort of administration interface to 
> produce reports, and the documentation isn't exactly great.
>
> Restore from audit history functionality is something we need for 
> ourselves too, so I've raised an issue (will prob fix that sometime this 
> week);
> https://github.com/foxx/django-cutemodel/issues/1 
>
> We also need to have the ability to bind the Django User objects together 
> with the event/field change - but some of our clients don't use the Django 
> built-in user/auth stuff - so I need to have a little think about how to 
> satisfy both.
> https://github.com/foxx/django-cutemodel/issues/2 
>
> Basically, all actions are logged and nothing is deleted or over-written. 
>> When changes are made, the original record is marked as a parent archive. 
>> The modified record is a dup of the parent, but with the changes. 
>>
>
> The approach of duplicating the row individually could work in some cases, 
> but if there was any unique index constraints then I'm guessing the rows 
> would have to be moved into a different table. If this were the case, you'd 
> need twice the amount of tables, which in itself may be undesirable, plus 
> another which stores the change relationships, plus any changes would have 
> to be done twice.
>
> Instead, django-cutemodel doesn't require a sub-table for every model, and 
> the tables don't need to be modified if one of your models changes - it has 
> the following;
>
> - table map (stores unique table names) - allows for super fast lookup 
> instead of full text scan
> - model map (stores unique model + app + db names) - allows for super fast 
> lookup instead of full text scan
> - fieldchange (stores fieldname+old/new value, target model+pk, and 
> timestamp)
> - event (stores event message, log level, target model+pk and timestamp)
>
>
>> Anyway, I'm rambling. If you would like to chat about this let me know. I 
>> will update this group, or contact you when I start working on the change 
>> audit code
>>
>
> Sure thing, if you think of any additional changes please feel free to 
> fire them over (it'd be great to see others using this in the wild!)
>  
>
>>
>> Kurt Pruhs
>> Utah State University
>> Programing & Design Team
>>
>>
>>
>>
>> On Monday, September 10, 2012 1:43:17 PM UTC-6, Cal Leeming [Simplicity 
>> Media Ltd] wrote:
>>>
>>> Hi guys,
>>>
>>> We have just released a new module that allows for lightweight/easy 
>>> relational event logging and auditing field changes.
>>>
>>> Our use case was to satisfy four main requirements;
>>>
>>> * Log events directly from models, whilst keeping a relational link to 
>>> the row 

Re: Request for comments - django-cutemodel (model logging and field change auditing)

2012-09-11 Thread Cal Leeming [Simplicity Media Ltd]
On Mon, Sep 10, 2012 at 11:07 PM, Kurt Pruhs  wrote:

> Hey Cal,
>
> This looks like a great tool. I know I've implemented code like this in
> another project. I was planning on doing a field change audit module for an
> application I'm currently working on. I will definitely look at
> django-cutemodel and see if it works for what I need, and how I can
> contribute.
> My current project is a time clock system for human resources to manage
> hourly workers. We need field change auditing for security, we need the
> ability to produce reports from it, and ability to restore from audit
> history (in case of record tampering).


I think django-cutemodel would be a pretty good fit for this requirement,
although it doesn't yet have any sort of administration interface to
produce reports, and the documentation isn't exactly great.

Restore from audit history functionality is something we need for ourselves
too, so I've raised an issue (will prob fix that sometime this week);
https://github.com/foxx/django-cutemodel/issues/1

We also need to have the ability to bind the Django User objects together
with the event/field change - but some of our clients don't use the Django
built-in user/auth stuff - so I need to have a little think about how to
satisfy both.
https://github.com/foxx/django-cutemodel/issues/2

Basically, all actions are logged and nothing is deleted or over-written.
> When changes are made, the original record is marked as a parent archive.
> The modified record is a dup of the parent, but with the changes.
>

The approach of duplicating the row individually could work in some cases,
but if there was any unique index constraints then I'm guessing the rows
would have to be moved into a different table. If this were the case, you'd
need twice the amount of tables, which in itself may be undesirable, plus
another which stores the change relationships, plus any changes would have
to be done twice.

Instead, django-cutemodel doesn't require a sub-table for every model, and
the tables don't need to be modified if one of your models changes - it has
the following;

- table map (stores unique table names) - allows for super fast lookup
instead of full text scan
- model map (stores unique model + app + db names) - allows for super fast
lookup instead of full text scan
- fieldchange (stores fieldname+old/new value, target model+pk, and
timestamp)
- event (stores event message, log level, target model+pk and timestamp)


> Anyway, I'm rambling. If you would like to chat about this let me know. I
> will update this group, or contact you when I start working on the change
> audit code
>

Sure thing, if you think of any additional changes please feel free to fire
them over (it'd be great to see others using this in the wild!)


>
> Kurt Pruhs
> Utah State University
> Programing & Design Team
>
>
>
>
> On Monday, September 10, 2012 1:43:17 PM UTC-6, Cal Leeming [Simplicity
> Media Ltd] wrote:
>>
>> Hi guys,
>>
>> We have just released a new module that allows for lightweight/easy
>> relational event logging and auditing field changes.
>>
>> Our use case was to satisfy four main requirements;
>>
>> * Log events directly from models, whilst keeping a relational link to
>> the row that triggered the event
>> * Keep track of field changes (storing the old/new value).
>> * Provide a scalable/easy to use API that allowed access to this
>> information
>> * Ensure module was a drop-in replacement (only change required is to
>> subclass CuteModel)
>>
>> The code itself has been dragged out of our existing projects, cleaned up
>> slightly, and released as open source.
>>
>> Full documentation and source code has been made available here:
>> https://github.com/foxx/**django-cutemodel
>>
>> Particular care has been made to ensure the code is able to scale up to
>> many millions of rows, and we have not yet had any issues.
>>
>> In future, we'd love to add some extra features and do a bit more tidy up
>> - so any testing/feedback/features suggestions/comments would be
>> appreciated.
>>
>> Cheers
>>
>> Cal
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/OQzlNQjqtbYJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Request for comments - django-cutemodel (model logging and field change auditing)

2012-09-10 Thread Kurt Pruhs
Hey Cal,

This looks like a great tool. I know I've implemented code like this in 
another project. I was planning on doing a field change audit module for an 
application I'm currently working on. I will definitely look at 
django-cutemodel and see if it works for what I need, and how I can 
contribute. 
My current project is a time clock system for human resources to manage 
hourly workers. We need field change auditing for security, we need the 
ability to produce reports from it, and ability to restore from audit 
history (in case of record tampering). Basically, all actions are logged 
and nothing is deleted or over-written. When changes are made, the original 
record is marked as a parent archive. The modified record is a dup of the 
parent, but with the changes. 

Anyway, I'm rambling. If you would like to chat about this let me know. I 
will update this group, or contact you when I start working on the change 
audit code

Kurt Pruhs
Utah State University
Programing & Design Team



On Monday, September 10, 2012 1:43:17 PM UTC-6, Cal Leeming [Simplicity 
Media Ltd] wrote:
>
> Hi guys,
>
> We have just released a new module that allows for lightweight/easy 
> relational event logging and auditing field changes.
>
> Our use case was to satisfy four main requirements;
>
> * Log events directly from models, whilst keeping a relational link to the 
> row that triggered the event
> * Keep track of field changes (storing the old/new value).
> * Provide a scalable/easy to use API that allowed access to this 
> information
> * Ensure module was a drop-in replacement (only change required is to 
> subclass CuteModel)
>
> The code itself has been dragged out of our existing projects, cleaned up 
> slightly, and released as open source.
>
> Full documentation and source code has been made available here:
> https://github.com/foxx/django-cutemodel 
>
> Particular care has been made to ensure the code is able to scale up to 
> many millions of rows, and we have not yet had any issues.
>
> In future, we'd love to add some extra features and do a bit more tidy up 
> - so any testing/feedback/features suggestions/comments would be 
> appreciated.
>
> Cheers
>
> Cal
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/OQzlNQjqtbYJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Request Context problem

2012-02-20 Thread Roald
On 20 feb, 00:03, Reinout van Rees  wrote:
> On 19-02-12 14:16, dummyman dummyman wrote:
>
> The solution is simple: just add a {{ csrf_token }} somewhere in your
> form. That ought to do it.

A typo there, Reinout ;-). You meant:

{% csrf_token %}

Cheers, Roald

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Request Context problem

2012-02-19 Thread Reinout van Rees

On 19-02-12 14:16, dummyman dummyman wrote:

I am getting the following eror on posting the form

CSRF verification failed. Request aborted.

Reason given for failure:
 CSRF token missing or incorrect.


It is already on the first go into your view that Django complains about 
a missing CSRF token. It won't even hit your "else add csrf token" code.


The solution is simple: just add a {{ csrf_token }} somewhere in your 
form. That ought to do it.



Reinout

--
Reinout van Reeshttp://reinout.vanrees.org/
rein...@vanrees.org http://www.nelen-schuurmans.nl/
"If you're not sure what to do, make something. -- Paul Graham"

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Request for new user account via email Django

2011-08-05 Thread Sheogora
There was a different problem actually,
RequestContext(request) was never called

I removed that line and put it in the above return.
Worked fine :)
thank you for the effort tho

On Aug 4, 5:58 pm, Shawn Milochik  wrote:
> In your view you should be instantiating the form with the data from
> request.POST instead of reading the values directly.
>
> Also, you mention that you get a 403 error when you post your name and
> password, but the form and template you pasted don't include password,
> so I suspect the error is coming from elsewhere.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Request for new user account via email Django

2011-08-04 Thread Shawn Milochik
In your view you should be instantiating the form with the data from 
request.POST instead of reading the values directly.


Also, you mention that you get a 403 error when you post your name and 
password, but the form and template you pasted don't include password, 
so I suspect the error is coming from elsewhere.



--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Request and null value

2011-06-06 Thread Masklinn
On 2011-06-06, at 07:36 , Constantine wrote:
> Hi, a have a problem, but may be this is expected behaviour:
> 
> on client side i'm post:
> $.post("my url",{myvar:null}...)
> 
> but on server side:
> request.POST becomes {myvar:u'null'}
> 
> null deserialized to string. So, do i need to report a bug in tracker?
Nope, this is normal behavior: the javascript value `null`, when converted to a 
string, becomes the string `"null"`. String conversion is exactly that $.post 
does with its POSTdata in the normal case of application/x-www-form-urlencoded. 
So Django gets a string in its POST value. Nothing to see here.

The alternative is to avoid using `application/x-www-form-urlencoded`, and 
instead use a JSON-encoded POST body. That's significantly more work on both 
sides, but it will allow you to send complete (typed) JSON data to your server.

On the JS side, you'll have to call $.ajax directly (rather than just $.post) 
using the following options:

$.ajax({
type: 'POST',
url: your-endpoint,
// This sets the POST body directly, to a JSON-encoded data structure
data: JSON.stringify(your_javascript_payload),
// jquery tries to convert your POST body through post-processing, tell 
it to leave your POST data as-is
processData: false,
// your callbacks
});

On the Django side, you will not be able to use request.POST. Instead, you'll 
have to go through `HttpRequest.raw_post_data` or to use HttpRequest as a file:

data = json.loads(request)
or
data = json.loads(request.raw_post_data)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Request and null value

2011-06-06 Thread Constantine
Thanks, i've workaround this with empty string.
I was surprised when saw raw_post_data which looks very similar to GET
string. I confused this behaviour with JSON parser.

On 6 июн, 12:50, Jani Tiainen  wrote:
> On Sun, 2011-06-05 at 22:36 -0700, Constantine wrote:
> > Hi, a have a problem, but may be this is expected behaviour:
>
> > on client side i'm post:
> > $.post("my url",{myvar:null}...)
>
> > but on server side:
> > request.POST becomes {myvar:u'null'}
>
> > null deserialized to string. So, do i need to report a bug in tracker?
>
> It's not "deserialized" thus not a but but works as designed. HTTP
> POST/GET parameters are only strings. Nothing more, nothing less. Django
> doesn't do any magic by default.
>
> You can use some known notation to handle your data, like JSON which can
> serialize and deserialize data correctly.
>
> --
>
> Jani Tiainen

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Request and null value

2011-06-05 Thread Jani Tiainen
On Sun, 2011-06-05 at 22:36 -0700, Constantine wrote:
> Hi, a have a problem, but may be this is expected behaviour:
> 
> on client side i'm post:
> $.post("my url",{myvar:null}...)
> 
> but on server side:
> request.POST becomes {myvar:u'null'}
> 
> null deserialized to string. So, do i need to report a bug in tracker?
> 

It's not "deserialized" thus not a but but works as designed. HTTP
POST/GET parameters are only strings. Nothing more, nothing less. Django
doesn't do any magic by default. 

You can use some known notation to handle your data, like JSON which can
serialize and deserialize data correctly.

-- 

Jani Tiainen



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Request variables are empty in views.py

2011-04-10 Thread Ali E . İMREK
10 Nisan 2011 13:33 tarihinde Ali E.İMREK  yazdı:
> I'm sending XML data but request.raw_post_data and POST vars are
> empty, whats wrong?
>
> ___views.py___
> def reply(request):
>    return HttpResponse("Server raw reply: "+str(request.raw_post_data))
>
>
> I've copied POST process information form Firebug Net/XHR tab.
>
> ___HEADERS___
> Host    localhost
> User-Agent      Mozilla/5.0 (X11; Linux i686; rv:2.0) Gecko/20110323 
> Firefox/4.0
> Accept  text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
> Accept-Language tr-tr,tr;q=0.8,en-us;q=0.5,en;q=0.3
> Accept-Encoding gzip, deflate
> Accept-Charset  ISO-8859-9,utf-8;q=0.7,*;q=0.7
> Keep-Alive      115
> Connection      keep-alive
> Content-Type    application/xml; charset=UTF-8
>
>
> ___DATA___
> XML
> 
>    1
> 
>
> Source
> 1
>
>
> --
> Ali E.İMREK
>

This PHP code response my data;



But django fails.

-- 
Ali E.İMREK

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: request in model

2011-03-14 Thread Mike Ramirez
On Monday, March 14, 2011 07:45:23 am Igor Nemilentsev wrote:
> I am new in Django.
> I am looking for a solution for my problem.
> I want to have a base model class
> inheriting all other model classes from that class.
> In the base model class I want to check
> some permissions for users.
> So, need pass request to model class so that
> to have request.user.
> Is it possible?
> Sorry for the obscure explanation,
> I just want to know whether it is possible to go this way.

class MyModel(models.Model):
  ...
  def __init__(self, user=None, *args, **kwargs):
super(MyModel, self).__init__(*args, **kwargs)
self.user = user

or:

class MyModel(models.Model):
  ...
  def setUser(self, user=None):
self.user = user


Call setUser before you call any method that requires the user. If user is 
None, you can raise an error in your model.  Though it's best to do perm 
checking in the view/templates or a form, though with the form you're going to 
be passing around request.user also, but passing it part of the __init__() is 
normal with forms.


please note this for models:

http://docs.djangoproject.com/en/dev/topics/db/models/#field-name-hiding-is-
not-permitted

Also, you might want to research the admin source to see how it handles the 
user and permission model.


Mike






-- 
A copy of the universe is not what is required of art; one of the damned
things is ample.
-- Rebecca West

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: request in urls.py

2011-02-18 Thread Burhan
urls.py doesn't do anything with GET or POST requests, its just
regular expression to method mapping.

So you can pass whatever you want to the link, and they will all work.

For example, in your urls.py you have:

(r'^logout$', logout_user)

All these requests will be passed to your logout_user method:

/logout
/logout?next=/home
/logout?next=/home/=bar


def logout_user(request):

   # - do your logout routine
   next = request.GET.get('next','/home')
   return redirect(next)

Hope this helps,
--
Burhan Khalid

On Feb 18, 1:15 pm, galago  wrote:
> Is it possible to pass request.path in urls.py? I want to pass it as next
> parameter in logout declaration.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Request Object Data

2010-12-17 Thread Jonas H.

On 12/17/2010 10:18 PM, hank23 wrote:

Is data entered on an input screen automatically added to the request
when the screen is submitted? If so are there any special parameters
or settings in the screen controls which have to be set/coded to get
the entered data saved into the request and under what keys is the
data saved? Once in the request then how can I retrieve the data back
out of the request so that I access it and do something with it? I
have seen an example where some data is extracted back out of the
request using "request.POST['choice']". Can this code be used to
retrieve any data which is saved in the request? Thanks for the
help.



http://docs.djangoproject.com/en/dev/intro/tutorial04/

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Request object problem

2010-09-22 Thread girish shabadimath
ya correct, now i got complete picture of client.get() and RequestFactory,


On Wed, Sep 22, 2010 at 5:28 PM, bruno desthuilliers <
bruno.desthuilli...@gmail.com> wrote:

> On 22 sep, 13:17, girish shabadimath  wrote:
> > Thanks for the reply, actually the response object got using
> RequestFactory
> > is different from the one returned by client.get() function,,
>
> The reponse object you get using RequestFactory is the one returned by
> your view.
>
> > i think response object returned by client.get() supports
> response.template
> > and response.context['data'],,,
>
> The test.Client uses quite a few Django hooks (middlewares, signals
> etc) to takes care of all this:
>
> http://code.djangoproject.com/browser/django/trunk/django/test/client.py
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Girish M S

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Request object problem

2010-09-22 Thread bruno desthuilliers
On 22 sep, 13:17, girish shabadimath  wrote:
> Thanks for the reply, actually the response object got using RequestFactory
> is different from the one returned by client.get() function,,

The reponse object you get using RequestFactory is the one returned by
your view.

> i think response object returned by client.get() supports response.template
> and response.context['data'],,,

The test.Client uses quite a few Django hooks (middlewares, signals
etc) to takes care of all this:

http://code.djangoproject.com/browser/django/trunk/django/test/client.py

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Request object problem

2010-09-22 Thread girish shabadimath
Thanks for the reply, actually the response object got using RequestFactory
is different from the one returned by client.get() function,,

i think response object returned by client.get() supports response.template
and response.context['data'],,,

ref:( http://djangosnippets.org/snippets/963/ )






On Wed, Sep 22, 2010 at 4:24 PM, bruno desthuilliers <
bruno.desthuilli...@gmail.com> wrote:

> On 22 sep, 11:31, girish shabadimath  wrote:
> > hi all,
> >
> > i used django snippethttp://djangosnippets.org/snippets/963/
> >
> > and successfully created request object
> >
> > i checked the response.status_code its giving 200
> >
> > i checked response.content it matches with the browser source code
> >
> > when i issue *response.template* it gives error
> >  and* response.context* also not giving output,,
> >
> > i used template and context data in view function,,
> >
> > why its showing nothing..?
>
> because, while the template and context are used to build the response
> object, they are not part of it.  render_to_response(templatename,
> context, ...) is just a convenient shortcut that loads the template,
> render it with the context, and build an HttpResponse using the
> generated content.
>
> FWIW, Django is not only mostly well documented but also OSS, so you
> can read the code to see what's going on:
>
>
> http://code.djangoproject.com/browser/django/trunk/django/shortcuts/__init__.py
>
> http://code.djangoproject.com/browser/django/trunk/django/http/__init__.py#L302
>
> As you can see, the HttpResponse object is built from some content -
> how this content is generated is totally orthogonal.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Girish M S

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Request object problem

2010-09-22 Thread bruno desthuilliers
On 22 sep, 11:31, girish shabadimath  wrote:
> hi all,
>
> i used django snippethttp://djangosnippets.org/snippets/963/
>
> and successfully created request object
>
> i checked the response.status_code its giving 200
>
> i checked response.content it matches with the browser source code
>
> when i issue *response.template* it gives error
>  and* response.context* also not giving output,,
>
> i used template and context data in view function,,
>
> why its showing nothing..?

because, while the template and context are used to build the response
object, they are not part of it.  render_to_response(templatename,
context, ...) is just a convenient shortcut that loads the template,
render it with the context, and build an HttpResponse using the
generated content.

FWIW, Django is not only mostly well documented but also OSS, so you
can read the code to see what's going on:

http://code.djangoproject.com/browser/django/trunk/django/shortcuts/__init__.py
http://code.djangoproject.com/browser/django/trunk/django/http/__init__.py#L302

As you can see, the HttpResponse object is built from some content -
how this content is generated is totally orthogonal.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: request object in generic view?

2010-09-09 Thread Łukasz Rekucki
On 9 September 2010 05:46, akcom  wrote:
> Is there anyway to access the request object from a generic view?
> Specifically, I'd like to access the request.user object.  I tried
> doing it as follows:
> (r'^$', 'django.views.generic.simple.direct_to_template', {'template':
> 'index.html', 'extra_context' : {'request' : request}}
> hoping that the dictionary element would be evaluated within the
> context of the view where request would be valid.
That would surely be too much magic.

>Alas I was mistaken.
>
> Any help would be much appreciated!
>

Generic views use RequestContext[1] as the context instance, so all
your context processors are executed. Just add
"django.core.context_processors.request"[2] to your
TEMPLATE_CONTEXT_PROCESSORS list and you'll have the "request" object
available in all your templates


[1]: 
http://docs.djangoproject.com/en/dev/ref/templates/api/#subclassing-context-requestcontext
[2]: 
http://docs.djangoproject.com/en/dev/ref/templates/api/#django-core-context-processors-request


-- 
Łukasz Rekucki

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Request to the list owner

2010-04-12 Thread Thierry CHICH

> On Mon, Apr 12, 2010 at 1:58 PM, Omer Barlas  wrote:
> > Can you please add a prefix to the email subject? I am reading my mail
> > mostly from my BB Bold, but I cannot filter mail like Thunderbird
> > does, it would be much simpler if there was a prefix like [django] or
> > such.
> 


It is true that mobile email client are not doing a very good job with 
filtering. Some of them don't do any job at all.

> No.
> 
> This has been proposed and rejected *many* times in the past. For example:
> 
> http://groups.google.com/group/django-users/browse_thread/thread/685617964e
> fab5f4
>  http://groups.google.com/group/django-users/browse_thread/thread/6207286aa
> 908f9b5
>  http://groups.google.com/group/django-users/browse_thread/thread/d8cc4b2f2
> 324d91b
>  http://groups.google.com/group/django-users/browse_thread/thread/6614ad241
> b3921f1
>  http://groups.google.com/group/django-users/browse_thread/thread/42a92e48c
> ec5c7c2
> 
> No offense, but if your mail client can't filter mail, then you need
> to get a better mail client.
> 
> Yours,
> Russ Magee %-)
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Request to the list owner

2010-04-12 Thread Russell Keith-Magee
On Mon, Apr 12, 2010 at 1:58 PM, Omer Barlas  wrote:
> Can you please add a prefix to the email subject? I am reading my mail
> mostly from my BB Bold, but I cannot filter mail like Thunderbird
> does, it would be much simpler if there was a prefix like [django] or
> such.

No.

This has been proposed and rejected *many* times in the past. For example:

http://groups.google.com/group/django-users/browse_thread/thread/685617964efab5f4
http://groups.google.com/group/django-users/browse_thread/thread/6207286aa908f9b5
http://groups.google.com/group/django-users/browse_thread/thread/d8cc4b2f2324d91b
http://groups.google.com/group/django-users/browse_thread/thread/6614ad241b3921f1
http://groups.google.com/group/django-users/browse_thread/thread/42a92e48cec5c7c2

No offense, but if your mail client can't filter mail, then you need
to get a better mail client.

Yours,
Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: request and email templates

2009-12-13 Thread Tim Miller
Daniel Roseman wrote:
> Looking at the code for that view, in
> django.contrib.auth.views.password_reset, it appears that the actual
> email creation and sending happens in the save method of the
> PasswordResetForm, and the request is not passed into that method at
> all so is not available in the template.
>
> To make this work, you'd have to override both the view and the form.
>
> It's not an unreasonable thing to want to do though - if you're keen,
> raise a ticket with a patch.
> --
> DR.

Thanks for the help. Opened a ticket with a rudimentary patch.

http://code.djangoproject.com/ticket/12372

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: Request POST String

2009-11-26 Thread Chris
Awesome, that looks like it. Thanks.

On Nov 26, 4:01 pm, Masklinn  wrote:
> On 26 Nov 2009, at 16:55 , Chris wrote:
>
> > Hi all,
>
> > Sorry for bothering you with something that is probably fairly
> > straight forward but I cant seem to find the solution myself.
>
> > I am using Google Checkout on my site. It calls one of my pages after
> > processing an order. It posts XML. Django seems to evaluate the XML
> > into a QueryDict, with rather silly results. For example:
>
> > blah
>
> > looks something like:
>
> > { 'blah']}
>
> > where ' > list containing the rest of the XML.
>
> > As you can see, this is wildly not what I am after. I need to access
> > the POST string directly without Django interpreting it as a
> > dictionary. How do I go about doing this? I'm open to other
> > suggestions but keep in mind I can't change the way in which the data
> > is posted, as it comes from Google Checkout.
>
> I think you 
> wanthttp://docs.djangoproject.com/en/dev/ref/request-response/#django.htt...

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: Request POST String

2009-11-26 Thread Masklinn
On 26 Nov 2009, at 16:55 , Chris wrote:
> Hi all,
> 
> Sorry for bothering you with something that is probably fairly
> straight forward but I cant seem to find the solution myself.
> 
> I am using Google Checkout on my site. It calls one of my pages after
> processing an order. It posts XML. Django seems to evaluate the XML
> into a QueryDict, with rather silly results. For example:
> 
> blah
> 
> looks something like:
> 
> { 'blah']}
> 
> where ' list containing the rest of the XML.
> 
> As you can see, this is wildly not what I am after. I need to access
> the POST string directly without Django interpreting it as a
> dictionary. How do I go about doing this? I'm open to other
> suggestions but keep in mind I can't change the way in which the data
> is posted, as it comes from Google Checkout.
I think you want 
http://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.raw_post_data

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: Request POST String

2009-11-26 Thread Chris
Yes, I did mean '=' rather than ':'. I have been doing too much JSON
lately...

Here is an example of the output from 'str(request.POST)':

\r\nhttp://checkout.google.com/schema/2;
serial-number="707751054951378-5-1">\r\n  NEW\r\n  CHARGEABLE\r\n  NEW\r\n
REVIEWING\r\n  2009-11-26T14:39:21.900Z\r\n
707751054951378\r\n\r\n\r\n']}>

Sorry about the lack of formatting but trying to format a mix of
object notation and XML looks rather weird however you do it.

'request.POST.items()' will give you much the same nonsense. I need to
get at POST before Django tries to interpret it.

Thanks.

On Nov 26, 4:05 pm, Daniel Roseman  wrote:
> On Nov 26, 3:55 pm, Chris  wrote:
>
> > Hi all,
>
> > Sorry for bothering you with something that is probably fairly
> > straight forward but I cant seem to find the solution myself.
>
> > I am using Google Checkout on my site. It calls one of my pages after
> > processing an order. It posts XML. Django seems to evaluate the XML
> > into a QueryDict, with rather silly results. For example:
>
> > blah
>
> This isn't valid XML. Do you mean:
>     blah
>
> > looks something like:
>
> > { 'blah']}
>
> > where ' > list containing the rest of the XML.
>
> > As you can see, this is wildly not what I am after. I need to access
> > the POST string directly without Django interpreting it as a
> > dictionary. How do I go about doing this? I'm open to other
> > suggestions but keep in mind I can't change the way in which the data
> > is posted, as it comes from Google Checkout.
>
> > Thanks.
>
> Can you post some code showing how you are getting the data from the
> POST and what you are doing with it?
> --
> DR.

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: Request POST String

2009-11-26 Thread Daniel Roseman
On Nov 26, 3:55 pm, Chris  wrote:
> Hi all,
>
> Sorry for bothering you with something that is probably fairly
> straight forward but I cant seem to find the solution myself.
>
> I am using Google Checkout on my site. It calls one of my pages after
> processing an order. It posts XML. Django seems to evaluate the XML
> into a QueryDict, with rather silly results. For example:
>
> blah

This isn't valid XML. Do you mean:
blah


> looks something like:
>
> { 'blah']}
>
> where ' list containing the rest of the XML.
>
> As you can see, this is wildly not what I am after. I need to access
> the POST string directly without Django interpreting it as a
> dictionary. How do I go about doing this? I'm open to other
> suggestions but keep in mind I can't change the way in which the data
> is posted, as it comes from Google Checkout.
>
> Thanks.

Can you post some code showing how you are getting the data from the
POST and what you are doing with it?
--
DR.

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: Request Entity Too Large

2009-09-19 Thread Graham Dumpleton



On Sep 18, 4:39 am, Karen Tracey  wrote:
> On Thu, Sep 17, 2009 at 1:47 PM, Jashugan  wrote:
>
> > Hello,
>
> > I have a user who is trying to upload a large file (> 50MB) to our
> > Django application. The error that they are getting is:
>
> > Request Entity Too Large
> > The requested resource
> > /ri/agent/orders/create/
> > does not allow request data with POST requests, or the amount of data
> > provided in the request exceeds the capacity limit.
>
> > Initially, I was thinking about changing FILE_UPLOAD_MAX_MEMORY_SIZE
> > in settings.py, but the documentation says files larger than this will
> > simply be streamed.  And this is played out in the application when we
> > upload 25 MB files.
>
> > I'm running Apache + mod_python + Django 1.1
>
> > Any ideas what settings I can look at?
>
> http://httpd.apache.org/docs/2.0/mod/core.html#limitrequestbody

The limit request body directive is effectively broken in conjunction
with mod_python. Read:

  https://issues.apache.org/jira/browse/MODPYTHON-240

Stop using mod_python, use mod_wsgi instead, where it works properly
as mod_wsgi does specific checks of its own in relation to
LimitRequestBody directive before any work done, where as mod_python
relies on lower level Apache HTTP input filter code doing the checks,
and which causes problems as explained in the ticket in mod_python
issue tracker.

Graham
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Request Entity Too Large

2009-09-18 Thread Jashugan


On Sep 17, 11:39 am, Karen Tracey  wrote:
>
> http://httpd.apache.org/docs/2.0/mod/core.html#limitrequestbody
>
> Karen

Excellent! Thanks Karen.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Request Entity Too Large

2009-09-17 Thread Karen Tracey
On Thu, Sep 17, 2009 at 1:47 PM, Jashugan  wrote:

>
> Hello,
>
> I have a user who is trying to upload a large file (> 50MB) to our
> Django application. The error that they are getting is:
>
> Request Entity Too Large
> The requested resource
> /ri/agent/orders/create/
> does not allow request data with POST requests, or the amount of data
> provided in the request exceeds the capacity limit.
>
> Initially, I was thinking about changing FILE_UPLOAD_MAX_MEMORY_SIZE
> in settings.py, but the documentation says files larger than this will
> simply be streamed.  And this is played out in the application when we
> upload 25 MB files.
>
> I'm running Apache + mod_python + Django 1.1
>
> Any ideas what settings I can look at?
>
>
http://httpd.apache.org/docs/2.0/mod/core.html#limitrequestbody

Karen

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: request body too long

2009-07-07 Thread Tom Evans

On Tue, 2009-07-07 at 03:02 -0700, Xu Mingming wrote:
> When i post a request to my django server with a body of 28000
> characters, i got a 413 response(request body too long), anymore knows
> how to increase this limit?
> 
> BTW, i run the server using:
> ./manage.py runserver
> 
> thanks
> 

Simplest way is to not run it like that. Use fastcgi, wsgi or
mod_python, and you won't have that issue.

Cheers

Tom


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Request aware template loader

2009-06-22 Thread Rama Vadakattu

have you gone through the below url:

http://www.b-list.org/weblog/2007/nov/01/django-tips-template-loading-and-rendering/

On Jun 22, 5:49 pm, z0n3z00t  wrote:
> I have a common site that is used by different clients.  Each client
> wants to be able to custom-brand the site to their liking.
>
> How it works: I provide a default theme for the site, i.e. templates
> and media, that clients can easily export and customise to their
> liking.  All default template files are stored in a templates/default
> directory on the server, and all default media inside a media/default
> directory.
>
> When they've done their customisations, clients use a form to upload
> an archive that contains all the template and media files that they
> want to override.  These uploaded theme archives are extracted using
> this convention:  Each customer's overridden templates and media would
> be extracted to templates/custXXX and media/custXXX.
>
> I quite like the way that the django template loaders are chained
> together in a sequence to find a specific template file - this is
> exactly the way I want my templates to load:  try to find the client's
> custom template inside the client's template folder and, failing that,
> load the default template.
>
> To do this the template loader needs access to the request object to
> determine request.user and work out which company he belongs to.
> (Only the login page is common across all clients, since the client
> can't be established)
>
> The problem is that the request object is not passed to the template
> loaders.  John Boxall posted a possible work-around using middleware
> and threading to store the request object 
> here:http://groups.google.co.za/group/django-users/browse_thread/thread/cb...
>
> What I like about this is that it doesn't touch the framework.  What I
> don't like is the fact that it's such an ugly hack.
>
> Does anyone know of a more elegant solution?  I'd appreciate any ideas
> on how to achieve this without hacking the framework.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: request object in custom template filter code?

2009-03-25 Thread Malcolm Tredinnick

On Wed, 2009-03-25 at 05:23 -0700, foxbunny wrote:
> I am trying to write a custom template filter which takes a variable
> which is a model object and grabs fields from a related object based
> on request.session['lang'] parameter. Or it would if I knew how to get
> the `lang` parameter from within the filter code.

Unless this information is explicitly passed into the template, you
won't have access to it. Template rendering is deliberately independent
of the request/response infrastructure, since it can be used in
situations where "request" doesn't make sense. However, if you really
just want the active language, have a look at how the
get_current_language template tag is implemented.

Regards,
Malcolm



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: request object in custom template filter code?

2009-03-25 Thread foxbunny

I forgot to mention I'm on django-trunk rev. 10163.


Branko
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



  1   2   >