Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position 0: ordinal not in range(128)

2011-03-02 Thread Daniel Roseman
On Thursday, March 3, 2011 6:48:21 AM UTC, Vladimir wrote: > > Good morning! > In me first exercise project with Django I met an error message: > UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position > 0: ordinal not in range(128). Admin pages are built without css. > Then I

AW: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position 0: ordinal not in range(128)

2011-03-02 Thread Szabo, Patrick (LNG-VIE)
Good morning ! Unfortunately i cant help you with your problem because i have the same problem here ;) I can however answer youre question if this is a common problem for django beginners. I don't think it's common for django beginners, i'd rather say it's common for python beginners - like me

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position 0: ordinal not in range(128)

2011-03-02 Thread Vladimir
Good morning! In me first exercise project with Django I met an error message: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position 0: ordinal not in range(128). Admin pages are built without css. Then I changed all .py-files entering # -*- coding: utf-8 -*- into the first row and

Re: urls.py usage

2011-03-02 Thread Vladimir
Thank you very much!!! It works! I followed "Python Web Development with Django. J.Forcier, P.Bissex, W.Chun" (I used russian edition). They instruct readers to include registration statement in model.py: Chapter 2 (my reverse translation from russian into English): Open file

Re: sites framework + gunicorn

2011-03-02 Thread Shawn Milochik
What do you mean by 'gunicorn instance' here? > The idea is that in each gunicorn instance I set the > DJANGO_SETTINGS_MODULE to a different settings.py file, and hopefully > get the corrrect result. In any case, I highly recommend you just use supervisord[1] for this and put the path to the

sites framework + gunicorn

2011-03-02 Thread ronny
Hi, I'm trying to run multiples sites using the sites-framework, and gunicorn. I'm using the same project, same databases, only I try to use different settings.py files with different names. The idea is that in each gunicorn instance I set the DJANGO_SETTINGS_MODULE to a different settings.py

Re: Using Django to white-label sites for multiple clients

2011-03-02 Thread Shawn Milochik
One option would be to just change the value of MEDIA_ROOT in settings.py. Or, if you're using 1.3 beta or above, STATIC_ROOT. You could do this by having multiple settings files -- one main one with anything that's common across all clients and one settings file for each client which imports the

Re: Converting to UTF8

2011-03-02 Thread Tim Sawyer
On 02/03/11 21:50, Javier Guerra Giraldez wrote: On Wed, Mar 2, 2011 at 4:21 PM, Tim Sawyer wrote: However, my web page now gets Harry Størksen instead. looks like part of your stack is still interpreting utf-8 data as latin1 check that 1: the field 2: the table

Re: oAuth 2.0

2011-03-02 Thread Mick
In the README for python-oauth2 (https://github.com/simplegeo/python-oauth2) there is a good example in the "Logging into Django w/ Twitter" section. _Mick On Wednesday, March 2, 2011 at 2:36 PM, Олег Корсак wrote: > hello. Is there any tutorial/example about oAuth 2.0 built into Django >

oAuth 2.0

2011-03-02 Thread Олег Корсак
hello. Is there any tutorial/example about oAuth 2.0 built into Django and through python-oauth2-1.2.1 ? thanks signature.asc Description: OpenPGP digital signature

Re: Converting to UTF8

2011-03-02 Thread Javier Guerra Giraldez
On Wed, Mar 2, 2011 at 4:21 PM, Tim Sawyer wrote: > However, my web page now gets Harry Størksen instead. looks like part of your stack is still interpreting utf-8 data as latin1 check that 1: the field 2: the table 3: the database 4: the client connection 5: the

Re: newbie going through basic tutorial

2011-03-02 Thread Alex Hall
Well, looks like things are suddenly working. I started over, and changed two things: I removed the path from the database file name and I gave it an extension of .db. The file appeared in the same place as before, so my path was right, but the .db extension seems to have made something quite

Re: Pinax static files in windows7 virtualenv

2011-03-02 Thread mongoose
are you getting an errors, maybe 404 erros when the request is being made for the media files? On Feb 25, 1:07 pm, Kopch wrote: > Hi all! I'm noob in django. I've installed Pinax project in windows > virtualenv, after i've made static files collect with build_media. >

Re: Custom User Profiles + Signals

2011-03-02 Thread Jeremiah
So continuing with this... I got the print-outs to work (I still need to try Stefano's suggestion)... I register a new user (duh6) via my register page and in the output for the dev server, I see: in myproject.cc.models: for user , pr ofile already exists in cc.models: for user , profile

Converting to UTF8

2011-03-02 Thread Tim Sawyer
Hi, I have a postgres database that is LATIN1. It contains extended characters, for example Harry Størksen. I dumped this out to a file: pg_dump -U dbuser db > db.sql and then ran iconv iconv --from-code latin1 --to-code utf-8 db.sql > db-utf8.sql and then imported into a database which

Query Builder & temporary tables

2011-03-02 Thread Pascal Germroth
Hi, using the PostgreSQL backend I have a complex query q = Model.objects.filter(…) that selects some objects using multiple joins and some geoDjango magic. Then there are some other simpler queries like q2 = OtherModel.filter(foreign__in = q.query) q3 = YetAnotherModel.filter(foreign__in

Putting content_type on a different class for a generic relation?

2011-03-02 Thread Jim D
I've got two models. Here's what I'm trying to do: class InterestSet(models.Model, MailChimpAPIMixin): name = models.CharField(help_text="The interest grouping to add. Grouping names must be unique.", max_length=128, unique=True) content_type = models.ForeignKey(ContentType, blank=True,

curious about model classes

2011-03-02 Thread Alex Hall
Hi all, Still working through that tutorial. I am just curious: why are none of the class variables called self.var, but rather just var? For example: import models class Poll(models.Model): question=models.CharField(max_length=200) Should that not be self.question=... instead? Otherwise, saying

htaccess/rewrite engine/default page

2011-03-02 Thread Tim Johnson
I am using Python 2.6.6 on mint 10. I just installed django from synaptic. This is not a django-specific question, but I am hopeful that the answer will be helpful to other noobs. Given that I have the following python script installed on my machine: myFooLoader.py And I point my browser to

Using Django to white-label sites for multiple clients

2011-03-02 Thread Greg Pelly
I'm looking to "white label" a site built using Django. For those unfamiliar with white-labeling, we would like my site (call it "Amazing Site") to be able to be customized by sponsors A and B. Customer A provides us with their header, footer, css, and we can do *basic* re-branding, in order to

Re: Custom User Profiles + Signals

2011-03-02 Thread bruno desthuilliers
On 2 mar, 19:31, Jeremiah wrote: (snip) >> Given the above statement, I assume the "models.py" file you're >> talking about is not the one where you define your UserProfile class. (snip) > It is the same models.py file with the UserProfile class.  Is this the >

form.is_valid() changes a ModelForm's associated instance now?

2011-03-02 Thread Jumpfroggy
I discovered the recent changes to the "is_valid()" model form method in 1.2, and I'd love to hear thoughts on the rationale behind this change. I have this kind of code: item = Item.objects.get(id=1) print 'item.value: %s' % item.value form = ItemModelForm(request.POST,

Re: Custom User Profiles + Signals

2011-03-02 Thread Jeremiah
I appreciate all of your feedback! My comments inserted within the message below: > What does cc.models.UserProfile looks like ? class UserProfile(models.Model): user = models.OneToOneField(User) thing = models.CharField(max_length=200) def __unicode__(self):

Re: Custom User Profiles + Signals

2011-03-02 Thread Wandering Weezard
I'll give that a shot. Thank you for your feedback. Still learning a lot as I go. On Tue, Mar 1, 2011 at 8:07 PM, Stefano wrote: > why you don't create the profile only if needed ? > > class UserProfile(models.Model): >user = models.ForeignKey(User, unique=True) > >

Re: What apps or snippets to use for Facebook and Twitter registration, login and posting?

2011-03-02 Thread Jason Culverhouse
On Mar 2, 2011, at 8:28 AM, Rodrigo Cea wrote: > I am developing a site that I want to link with Facebook and Twitter. > > So as to not reinvent the wheel, I'm looking for apps or snippets that can > help with this, specifically: > > 1) allow users to register and login with their Facebook

Re: Query involving manytomany relationship

2011-03-02 Thread gontran
I will answer to myself (after having been trying for over an hour, I found the answer a couple of minutes after posting my question) products = Product.objects.filter(productlicence__client=client).distinct() -- You received this message because you are subscribed to the Google Groups "Django

Re: Query involving manytomany relationship

2011-03-02 Thread gontran
Sorry for the question, but I've been trying for over an hour and just when I post this message, I find the answer!! Here is it: products = Product.objects.filter(productlicence__client=client).distinct() Hope that it will be useful -- You received this message because you are subscribed to

Query involving manytomany relationship

2011-03-02 Thread gontran
Hello everybody this is maybe simple but I can't succeed in making a query. here is my model: class Client(models.Model): user= models.OneToOneField(User) product_licence= models.ManyToManyField('ProductLicence', blank=True, null=True) class

What apps or snippets to use for Facebook and Twitter registration, login and posting?

2011-03-02 Thread Rodrigo Cea
I am developing a site that I want to link with Facebook and Twitter. So as to not reinvent the wheel, I'm looking for apps or snippets that can help with this, specifically: 1) allow users to register and login with their Facebook and/or Twitter accounts. 2) Have these accounts be linked to

Regarding fieldsets in django

2011-03-02 Thread Suchindra Chandrahas
Hi All, I am a django newbie and I have a pretty small question here I need to register a customized admin view, so I edited /admin.py file and added the customized fieldsets, which is working perfectly fine However, I need to design a form with nested

InterfaceError: Connection already closed -- is this a regression?

2011-03-02 Thread onelson
I recently switched a project from mysql to postgres and started to see httpd throwing intermittent 500 errors. mod_wsgi (pid=26467): Exception occurred processing WSGI script '/ htdocs/django.wsgi'. Traceback (most recent call last): File

Re: python mysqldb installation problem

2011-03-02 Thread zhou vika
Thanks for solution. I have also encounter similar problem before. I have found the name for socket file appeared in exception content is different from which MySQL server using, but don't know how where to indicate the socket file name. /etc/mysql/my.cnf 2011/3/2 draix

Re: mysql MySQL-python and libmysqlclient.so.16 hell

2011-03-02 Thread Tom Evans
On Wed, Mar 2, 2011 at 3:01 PM, vanderkerkoff wrote: > Thanks Graham > > I went for the first option and added the path to my mysql libraries > to /etc/ld.so.conf > > Never had to do that before though, and I've installed this type of > system many many times.  This one is

Re: Django ORM query modelling question

2011-03-02 Thread Carsten Fuchs
Hi Jirka, Am 01.03.2011 21:44, schrieb Jirka Vejrazka: this does not seem to me like something you would be able to do using SQL (or Django ORM) only. I would guess that you'll have to write a bit of Python code that will walk through the entries and detect those that are different from

Re: How to pre-cache model data?

2011-03-02 Thread Alex Robbins
If you need to run tasks outside the request/response cycle, then you should be using celery. http://celeryproject.org/ Celery includes something called periodic tasks. http://ask.github.com/celery/userguide/periodic-tasks.html You just need to make a task that updates the value in cache, and

weird permissions issue

2011-03-02 Thread Eric Abrahamsen
I'm using the emencia newsletter, and things are essentially fine, except that I've run into a very strange permissions issue in the admin backend. I have my regular user login, and the superuser. I've given my regular user all permissions for all newsletter models, and yet some of the inter-modal

.htaccess + Django issues

2011-03-02 Thread Sithembewena Lloyd Dube
Hi all, Pardon me if this is the wrong list for the issue I have. I have a .htaccess file containing the following lines: AddType text/x-component .htc RewriteEngine On RewriteBase / RewriteCond %{QUERY_STRING} . RewriteRule ^(.*)\.php(.*)$ http://www.mydomain/forum/? [R=301,L] RewriteRule

Re: newbie going through basic tutorial

2011-03-02 Thread Alex Hall
On 3/2/11, Kenneth Gonsalves wrote: > On Tue, 2011-03-01 at 23:14 -0500, Alex Hall wrote: >> I get a very long traceback, ending with sqlite3.OperationalError: >> unable to open database file. > > looks like a permissions problem. Does the webserver have permissions to >

extend TimeFormat

2011-03-02 Thread marco ghidinelli
hello, i've a problem extending the TimeFormat class (used by "time" template filter). basically, i need a new method: def F(self): if self.date.minute == 0: return self.G() return u'%s:%s' % (self.G(), self.i()) very similar to the original one except for a

Creating one model row from another model save method

2011-03-02 Thread Kirill Gorin
Hi community I have two models in two apps, first named newsItem from django.db import models from datetime import datetime class newsItem(models.Model): pubDate = models.DateTimeField('date published',default=datetime.now()) author = models.CharField(max_length=20, default="author")

Re: Custom User Profiles + Signals

2011-03-02 Thread bruno desthuilliers
On 2 mar, 00:50, Jeremiah wrote: > Hi All, > > So, if I do the following from the shell (as spawned by manage.py): > >>> import cc.models What does cc.models.UserProfile looks like ? > >>> from django.contrib.auth.models import User > >>> u =

Re: a rookie problem about 'Modules'

2011-03-02 Thread xie he
thanks sincerely 2011/3/2 bruno desthuilliers > On 1 mar, 16:30, Bill Liao wrote: > > On Tuesday, March 1, 2011, iRick wrote: > > > hi,i'm a freshman for python. i got a problem about "Modules" > > Python-related

Re: a rookie problem about 'Modules'

2011-03-02 Thread xie he
thank you so much 2011/3/1 Bill Liao > On Tuesday, March 1, 2011, iRick wrote: > > hi,i'm a freshman for python. i got a problem about "Modules" > > this is my dir > > A/ > > a.py > > __init__.py > > B/ > > __init__.py >

Re: How to reduce DB queries?

2011-03-02 Thread galago
That's nice. I must check it. -- 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