Re: Using environment variables in settings.py - good practice? How to handle missing variables gracefully?

2013-09-18 Thread Victor Hooi
Hi, Hmm, in many cases there isn't really a sensible default (e.g. API keys or passwords). I was asking more in terms of - is this the "right" way of doing it in Django, or are people using some other technique to handle configuration you don't want in the repo? And is there a special

Re: Using environment variables in settings.py - good practice? How to handle missing variables gracefully?

2013-09-18 Thread Dig
Hi, Do you means some thing like this? os.environ.get('SOME_VARIABLE', 'default_value') Regards, Dig On Sep 19, 2013 1:37 PM, "Victor Hooi" wrote: > Hi, > > I have several settings in my Django settings.py file that are specific > > Currently, I'm grabbing these from

Using environment variables in settings.py - good practice? How to handle missing variables gracefully?

2013-09-18 Thread Victor Hooi
Hi, I have several settings in my Django settings.py file that are specific Currently, I'm grabbing these from environment variables in settings.py: import os > ... > # TODO - We need to gracefully catch if these aren't set. > SOME_VARIABLE = os.environ['SOME_VARIABLE'] This includes things

Re: password field showing hashed value on form value update

2013-09-18 Thread Russell Keith-Magee
On Thu, Sep 19, 2013 at 12:49 PM, Sivaram R wrote: > Karkar, > >I am not getting your point.I am using django default user model,my > requirement is,after the user successfully login,their is a page called > update user profile,their i am showing first name,last

Re: password field showing hashed value on form value update

2013-09-18 Thread Sivaram R
Karkar, I am not getting your point.I am using django default user model,my requirement is,after the user successfully login,their is a page called update user profile,their i am showing first name,last name,email are in update mode but password is showing the hashed value and not the

Re: add marks of same roll number of different of different semestrs

2013-09-18 Thread Harjot Mann
On Thu, Sep 19, 2013 at 7:39 AM, Lachlan Musicman wrote: > Harjot, > > The answer to your question requires more information. > > We would need to see your model structure at the least. I want to add the marks of same roll number in different classes as given in the

while loop in django

2013-09-18 Thread Harjot Mann
Please tell me how to use while loop indjango so that marks of students can be added untill the same roll number is going on? -- Harjot Kaur Mann Blog: http://harjotmann.wordpress.com/ Daily Dairy: http://harjotmann.wordpress.com/daily-diary/ -- You received this message because you are

Re: add marks of same roll number of different of different semestrs

2013-09-18 Thread Lachlan Musicman
Harjot, The answer to your question requires more information. We would need to see your model structure at the least. cheers L. On 19 September 2013 03:38, Harjot Mann wrote: > Here is the scrrenshot of my output, please tell me how can boht the > marks of physics

Re: migrating from django 1.3.0 to 1.5.4, getting ImproperlyConfigured exceptions (AUTH_USER_MODEL refers to model 'auth.User' that has not been installed)

2013-09-18 Thread Russell Keith-Magee
On Thu, Sep 19, 2013 at 1:51 AM, Lauri Carpenter < lauri.loebel.carpen...@gmail.com> wrote: > We have been using django 1.3.0 for a long time. We are now trying to > migrate to 1.5.4. We have not changed any schema or model information. We > have been using two layers of middleware and

Re: password field showing hashed value on form value update

2013-09-18 Thread kakararunachalservice
R u looking at the password from the admin? Sivaram R wrote: I have views.py to show the form instance and update the instance. On edit the form data,all other field are showing the correct value,password field is showing the entire hashed value from database and not

Re: Need help figuring out why my { key:value } doesn't seem to be passed to my view by my javascript file.

2013-09-18 Thread C. Kirby
If you want to use key value pairs like that, and you are modifying data in your database, you should really be using a POST and not a GET On Wednesday, September 18, 2013 10:00:51 AM UTC-5, 7equiv...@gmail.com wrote: > > "So I think that the ajax() function is calling the URL >

Re: password field showing hashed value on form value update

2013-09-18 Thread C. Kirby
Django doesn't store the original password, that would be a huge security hole. It only has the hashed password available. On Wednesday, September 18, 2013 10:10:02 AM UTC-5, Sivaram R wrote: > > I have views.py to show the form instance and update the instance. > > On edit the form data,all

Re: iterating over a queryset?

2013-09-18 Thread Bill Freeman
.get() actually gets you an instance, while the queryset without the get acts (somewhat) like a list of instances. It is the .values() call that causes you to have dicts rather than instances. .get() considers it an error if the queryset represents either zero objects, or two or more objects (it

Re: iterating over a queryset?

2013-09-18 Thread Johan Bergkvist
Hi Yeah I see. I tried it out just after writing, with little success, but without the .values() I do still have the {{ data.field_name }} available which Is probably more usefull than actually iterating over a dataset regardless of content. Still the relationsships are only available as

Re: Hosting multiple sites on a single application

2013-09-18 Thread Doug Ballance
I can't recommend either of those solutions specifically, but I have been using an approach similar to that of django-multisite running on a threaded fastcgi instance since django .96 days and it has worked well for us. My main concern would be with third-party apps that set static data

Re: migrating from django 1.3.0 to 1.5.4, getting ImproperlyConfigured exceptions (AUTH_USER_MODEL refers to model 'auth.User' that has not been installed)

2013-09-18 Thread Daniel Roseman
On Wednesday, 18 September 2013 18:51:30 UTC+1, Lauri Carpenter wrote: > We have been using django 1.3.0 for a long time. We are now trying to > migrate to 1.5.4. We have not changed any schema or model information. We > have been using two layers of middleware and backends (notably

Re: iterating over a queryset?

2013-09-18 Thread Daniel Roseman
Well, not quite. That will work if you just omit .get(), because then you'll have a ValuesQuerySet - basically, a list of dicts. However, if you omit .values() as well you'll have a plain old QuerySet - ie a list of model instances - and those instances aren't dicts and don't have an .items()

Re: Middleware Causing OperationalError: (2006, 'MySQL server has gone away')

2013-09-18 Thread Paul Childs
After much research and help from a DBA in a company the solution to the problem was to put the following in the mysqld section of the my.ini file: max_allowed_packet=128M I think that the HTML header was so large that when the middleware made a call to MySQL it couldn't handle the size of the

Re: iterating over a queryset?

2013-09-18 Thread Bill Freeman
No. q will be a model instance, not a dict. Your inner loop would, perhaps, loop over a sequence of names (like the arguments you were passing to value()) and use those names to access the attributes of q. This might more cleanly handled with a method on the q object's class that returns the

migrating from django 1.3.0 to 1.5.4, getting ImproperlyConfigured exceptions (AUTH_USER_MODEL refers to model 'auth.User' that has not been installed)

2013-09-18 Thread Lauri Carpenter
We have been using django 1.3.0 for a long time. We are now trying to migrate to 1.5.4. We have not changed any schema or model information. We have been using two layers of middleware and backends (notably something based on SSLAuth Django App to authenticate first by certificate issued

Re: password field showing hashed value on form value update

2013-09-18 Thread Bill Freeman
That is a bad idea. It leaves your users vulnerable to a server or database or database backup compromise. The design is that if your server/database doesn't know the password, it can't give it up. If you truly want to store passwords in the clear, you will have to re-implement the

add marks of same roll number of different of different semestrs

2013-09-18 Thread Harjot Mann
Here is the scrrenshot of my output, please tell me how can boht the marks of physics of same roll number of different classes or semesters? http://screencloud.net/v/aCsl -- Harjot Kaur Mann Blog: http://harjotmann.wordpress.com/ Daily Dairy: http://harjotmann.wordpress.com/daily-diary/ -- You

App which relies on collecting data from different APIs

2013-09-18 Thread Jaimin Patel
Hi - Its may or may not be Django specific question. I am wondering if I want to develop something which consumes json/xml/csv data from different sources like news RSS feed, Sports data api for scores or restaurant menu price. is there any good architecture workflow one can recommend to do it

Re: iterating over a queryset?

2013-09-18 Thread Johan Bergkvist
Hi, thanks - that provides some perspective. So if I omitted the .get() and .values() i will have to loop over the queryset and then each dict, doing something like: {% for q in info %} {% for k, v in q.items %} {{ k }} {{ v}} {% empty %}

password field showing hashed value on form value update

2013-09-18 Thread Sivaram R
I have views.py to show the form instance and update the instance. On edit the form data,all other field are showing the correct value,password field is showing the entire hashed value from database and not the entered password. Is any way to show the entered password instead of hashed value

Re: Need help figuring out why my { key:value } doesn't seem to be passed to my view by my javascript file.

2013-09-18 Thread 7equivalents
"So I think that the ajax() function is calling the URL "/pi/?pathID=somevalue," Is that different than how a key:value pair are normally sent? I don't know much about this. This is the output from the development server... "GET /pi/ HTTP/1.1" 200 2600 -- You received this message because you

Re: Any good books for learning django?

2013-09-18 Thread Sithembewena Lloyd Dube
I asked PyDanny and Audrey for a free copy and they graciously obliged. Very good book, too. On Wed, Sep 18, 2013 at 12:29 PM, Yinka wrote: > These were not written for beginners, but they certainly can be helpful to > the beginnner: > >1. *Pro Django** ** >

Re: [Deployment + Apache2] difference between development server & production server

2013-09-18 Thread Karl Arunachal
Its always a pleasure. Have fun coding! On Mon, Sep 16, 2013 at 11:20 PM, hung david wrote: > > > On Monday, September 16, 2013 2:05:56 AM UTC+7, Kakar wrote: >> >> I dont know what you actually mean, but I think just by passing the url >> that you have created in the

Re: Need help in my Django code

2013-09-18 Thread Rafael E. Ferrero
hello ghenessa, first of all i'll recommend that use pastebin to share code since tabular spaces in python its relevand. now, you want to do something like triggers on database but do it in Django Admin? (something like automatic saving TimeStamp of a creation moment of the registry or update ?)

Need help in my Django code

2013-09-18 Thread ghenessa sabaldan
I am really stuck in my code. I have this printing project I have created. I wanted that in my student profile class, it will automatically update the the total printout and the available printout after the user has inputted the corresponding value in the printout class. and also the report

Re: Any good books for learning django?

2013-09-18 Thread Yinka
These were not written for beginners, but they certainly can be helpful to the beginnner: 1. *Pro Django** ** http://www.amazon.com/Pro-Django-Marty-Alchin/dp/1430258098/ref=sr_1_2?s=books=UTF8=1379499898=1-2=django * 2. *Instant Django 1.5 Application Development Starter **

Re: How do I create a standalone python application that uses the django environment (e.g. the ORM etc...)?

2013-09-18 Thread DJ-Tom
Hi Brad, that fixed it - plus I now have a better understanding of how python works. I'm beginning to understand what Jeff Knupp writes here: http://www.jeffknupp.com/blog/2012/12/11/learning-python-via-django-considered-harmful/ :-) Am Dienstag, 17. September 2013 17:58:42 UTC+2 schrieb Brad

Re: Need help figuring out why my { key:value } doesn't seem to be passed to my view by my javascript file.

2013-09-18 Thread Leonardo Giordani
If I correctly understand you are using jQuery.ajax(). Documentation says "Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests." So I think that the ajax() function is calling the URL "/pi/?pathID=somevalue". May you

Re: Exception Value: 'Decimal' object is not callable dont no where this is coming from, Any help will be kindly appreciated

2013-09-18 Thread Leonardo Giordani
Hi Maurice, where do you get this exception? Do you have a Django debug page as output? Are you calling a view? Can you paste its code? Leo Leonardo Giordani Author of The Digital Cat My profile on About.me - My GitHub