Re: Email Backend setting needed, a potential bug

2010-05-26 Thread Russell Keith-Magee
On Wed, May 26, 2010 at 2:54 AM, Lakshman Prasad wrote: > Hi, > Since I upgraded to 1.1.2, I am unable to send mails as django seems > expecting a EMAIL_BACKEND. Something is severely broken with your setup, then. EMAIL_BACKEND is a setting that was introduced in Django 1.2, but it doesn't exist

Re: Resize uploaded file file with PIL

2010-05-26 Thread Igor Rubinovich
Kenneth and all, This probably needs more explanation, otherwise I'll keep misleading people into answering some question other then mine. I store the file in a custom storage (picasaweb) that I've implemented myself. The file never touches my filesystem and always stays a stream or whatever file-

Re: Resize uploaded file file with PIL

2010-05-26 Thread Kenneth Gonsalves
On Wednesday 26 May 2010 13:07:50 Igor Rubinovich wrote: > This probably needs more explanation, otherwise I'll keep misleading > people into answering some question other then mine. > I store the file in a custom storage (picasaweb) that I've implemented > myself. The file never touches my filesys

Re: Resize uploaded file file with PIL

2010-05-26 Thread Igor Rubinovich
In my photo class, the field is not ImageField but rather a custom image = PicasaImageField(upload_to=get_upload_to, blank=True, storage=pwcs()) And storage=pwcs() is probably what you're asking about. For the saving bit, here's some code with lots of detail omitted: photo = Photo(owner=cur

Re: Resize uploaded file file with PIL

2010-05-26 Thread Dejan Noveski
Why don't you try and copy request.FILES (request.FILES.copy()) and work with the new dictionary. As I understand request dictionaries are immutable. You can't change the reference of the image. Something like this: files_dict = request.FILES.copy() img = files_dict['image'] img.thumbnail( (200,20

Re: Email Backend setting needed, a potential bug

2010-05-26 Thread ankit rai
check your django version .It might be that you have django at two places .I m using django 1.1 , have not fount such problem On Wed, May 26, 2010 at 12:34 PM, Russell Keith-Magee < russ...@keith-magee.com> wrote: > On Wed, May 26, 2010 at 2:54 AM, Lakshman Prasad > wrote: > > Hi, > > Since I up

Re: Email Backend setting needed, a potential bug

2010-05-26 Thread Lakshman Prasad
So, I see what has happened. (Interesting it is) I upgraded django to 1.2 to try out: $pip install --upgrade django Then, back to work again: $pip install django==1.1.2 I don't think pip removed the pyc files when replacing, which is making it import mail module. So, This problem should be so

Re: Resize uploaded file file with PIL

2010-05-26 Thread Igor Rubinovich
Dejan - I think this was what I was looking for (and probably should have been able to figure it out myself :)) Thanks! Are you sure there's no problem with binary or other encodings? Thanks, Igor On May 26, 10:15 am, Dejan Noveski wrote: > Why don't you try and copy request.FILES (request.FI

Re: EmailField etc. and VARCHAR / TEXT

2010-05-26 Thread Daniel Roseman
On May 25, 10:49 pm, Jonathan Hayward wrote: > For CharField, EmailField, URLField, etc., is VARCHAR implementation > (meaning a fixed limit on length) absolutely non-negotiable, or there a way > to make e.g. a CharField that won't truncate if you cross some arbitrary > length? > > (If you don't s

Permissions of abstract model not added on syncdb

2010-05-26 Thread Dirk Eschler
Hello, i've got an abstract model which has no fields and only defines permissions. The permission isn't added to the auth_permission table on syncdb nor is the content_type added to django_content_type. The app is in INSTALLED_APPS. class Base(models.Model): class Meta: abstract =

Re: ModelForm gives invalid option.

2010-05-26 Thread Nuno Maltez
You simply need to provide a default value for your field, i.e. : turtle_type = models.IntegerField(null=False, blank=False, choices=TURTLE_TYPES, default=1) See the notes on: http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#field-types hth, Nuno On Tue, May 25, 2010 at 10:05 PM, J

Re: disabling dashboard 'recent actions'

2010-05-26 Thread Dirk Eschler
Am Mittwoch 26 Mai 2010, 08:50:09 schrieb rahul jain: > Hi Django, > > How to disable the dashboard ('recent actions') on django admin main page ? Hello, you can override the admin/index.html template to disable the display. There's a sidebar block you might want to change/remove. Best Regards

Session not working as i had hoped

2010-05-26 Thread grimmus
Hi, When the user enters a site for the first time they should see a flash version of the logo. All other times they should see a gif image. My home view looks like: if request.session.get('has_visited',True): visited = True else: visited = False t = loader.get_templa

Re: Session not working as i had hoped

2010-05-26 Thread Jirka Vejrazka
Hi, a simple hint: try to point out a place in your code where has_visited does exist and is set to False. Also, you probably don't want to have any code in your view after an unconditional "return" statement - that code would never get executed. HTH Jikra -- You received this messa

Re: Session not working as i had hoped

2010-05-26 Thread Nuno Maltez
http://docs.djangoproject.com/en/dev/topics/http/sessions/#using-sessions-in-views >    if request.session.get('has_visited',True): You're passing True as the default value to the get method - get(key, default=None); this means that when 'has_visited' isn't set in your session (1st visit) it st

Re: EmailField etc. and VARCHAR / TEXT

2010-05-26 Thread Jonathan Hayward
Thanks! On Wed, May 26, 2010 at 5:32 AM, Daniel Roseman wrote: > On May 25, 10:49 pm, Jonathan Hayward > wrote: > > For CharField, EmailField, URLField, etc., is VARCHAR implementation > > (meaning a fixed limit on length) absolutely non-negotiable, or there a > way > > to make e.g. a CharField

ContentType for proxy models

2010-05-26 Thread TallFurryMan
Hello, I wrote a model which is not abstract, and from which a few specialized classes derive: | class Action( Model ): | item = ForeignKey( Item ) | # A few other properties | | class Move( Action ): | class Meta: | proxy = True | | class Pick( Action ) | class Meta: |

Re: EmailField etc. and VARCHAR / TEXT

2010-05-26 Thread Alex Robbins
If you are using 1.2, then you could make a TextField with an email validator. That gets bonus points for using a new feature :) http://docs.djangoproject.com/en/dev/ref/forms/validation/#using-validators Alex On May 26, 8:24 am, Jonathan Hayward wrote: > Thanks! > > On Wed, May 26, 2010 at 5:32

Re: testing the comment framework using the test client

2010-05-26 Thread Alex Robbins
The way I've tested it in the past is: GET the page, using the client. Scrape the values you need. (BeautifulSoup makes this really easy, but you can do it with python's builtin stdlib I guess.) POST the comment message, along with all the values you just scraped. Hope that helps, Alex On May 25

Re: Grouping of applications in admin

2010-05-26 Thread Alex Robbins
You should check out django-admin-tools [0] It lets you make lots of changes to the admin index page. Hope that helps, Alex [0]http://bitbucket.org/izi/django-admin-tools/wiki/Home On May 25, 9:54 am, Dejan Noveski wrote: > Hello, > > Is there a way i can group admin models from different applic

Re: EmailField etc. and VARCHAR / TEXT

2010-05-26 Thread Jonathan Hayward
Thank you! On Wed, May 26, 2010 at 8:30 AM, Alex Robbins wrote: > If you are using 1.2, then you could make a TextField with an email > validator. That gets bonus points for using a new feature :) > http://docs.djangoproject.com/en/dev/ref/forms/validation/#using-validators > > Alex > > On May 2

problem with running test

2010-05-26 Thread irum
Hi, I am working on django for a project and have to do some funcitonal testing. However, whenever I run manage.py test, I get the error shown below. I have tried searching threads in this group and they mention having these applications installed in my settings file: 'django.contrib.auth', 'djang

Django error in django's context.py

2010-05-26 Thread zayatzz
Hello I created new project, added bunch of apps (which are required for django cms 2.0) and when i proceeded to admin, to create first set of pages i got this error: http://pastebin.com/ZYKuuz85 I also mentioned it in django cms 2.0 group here :http:// groups.google.com/group/django-cms/browse_

Re: ModelForm gives invalid option.

2010-05-26 Thread Joshua Frankenstein Lutes
That did it! Thanks! -- 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,

Creating a custom view in Django admin,

2010-05-26 Thread Dexter
Hi, I am building a newsletter system, but I'm wondering how to incorporate it into the django admin. Just recently I started discovering the capabilities of the admin interface, and finding out how things are supposed to be working. I want to make an interface which follows the django "zen". My

Re: ModelForm always calls Model's clean method

2010-05-26 Thread Rendy Anthony
My mistake in the model definition. They are supposed to be foreign keys to the same model. Thank you for the explanation. I was expecting something like the errors variable like in a Form. Unfortunately there is no equivalent "error" variable in the model validation. Here is what I can do in form

Django Hosting

2010-05-26 Thread Anjan Dwaraknath
Hey, I have a startup company, I wish to setup a website for it, is it possible to get free web hosting for my site, till i find out if it works out or not Thank you -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send e

Re: Session not working as i had hoped

2010-05-26 Thread daniels
Also move : request.session['has_visited'] = True above the return statement. On May 26, 4:02 pm, Nuno Maltez wrote: > http://docs.djangoproject.com/en/dev/topics/http/sessions/#using-sess... > > >    if request.session.get('has_visited',True): > > You're passing True as the default value to th

Re: Session not working as i had hoped

2010-05-26 Thread Masklinn
On 2010-05-26, at 15:02 , Nuno Maltez wrote: > > http://docs.djangoproject.com/en/dev/topics/http/sessions/#using-sessions-in-views > > >>if request.session.get('has_visited',True): > > You're passing True as the default value to the get method - get(key, > default=None); this means that w

Re: Django Hosting

2010-05-26 Thread piz...@gmail.com
Try HelioHost and AlwaysData Cheers, Oscar C. El 26/05/2010, a las 18:27, Anjan Dwaraknath escribió: Hey, I have a startup company, I wish to setup a website for it, is it possible to get free web hosting for my site, till i find out if it works out or not Thank you -- You received this m

Django minimum deployment requirements

2010-05-26 Thread Murasame
Can a Django powered app run in a standard apache mod_python only webserver? -- 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 djang

Re: problem with running test

2010-05-26 Thread irum
Sorry, I fixed it. It was a small overlook so I thought I should post it here for newbies. After updating my django-trunk and including installed apps,I was missing application name after test, i.e., command should be: manage.py test [aapname] BR, Irum On May 26, 7:12 pm, irum wrote: > Hi, > I

Re: Django minimum deployment requirements

2010-05-26 Thread Jirka Vejrazka
As long as you have Django installed, yes. It's in the documentation. Cheers Jirka On 26/05/2010, Murasame wrote: > Can a Django powered app run in a standard apache mod_python only > webserver? > > -- > You received this message because you are subscribed to the Google Groups > "Django

Help me with render_to_response!

2010-05-26 Thread Nate
I'm teaching myself django and I'm having an issue with render_to_response. I am passing it a template and a dictionary. When I view the page on a local host, it displays the entire template, including HTML tags, instead of formatting the page according to the tags. I don't have this issue when I

Re: Django error in django's context.py

2010-05-26 Thread Karen Tracey
On Wed, May 26, 2010 at 12:13 PM, zayatzz wrote: > Hello > > I created new project, added bunch of apps (which are required for > django cms 2.0) and when i proceeded to admin, to create first set of > pages i got this error: > > http://pastebin.com/ZYKuuz85 > > I also mentioned it in django cms

Feedparser strange behaviour on Unix-platform Django

2010-05-26 Thread steve
Feedparser doesn't like, for some reason, the "http:// rss.news.yahoo.com/rss/topstories" feed for some reason, but only under specific conditions. -Won't- work: (i.e. 'bozo_exception': SAXParseException('not well- formed (invalid token)',) Inside a Django views.py file, and only on my live w

Image deduplication and upload_to

2010-05-26 Thread Ricardo Bánffy
Hi folks. I want to prevent the duplication of uploaded images. For that, I am using the upload_to property of ImageField set to a callable that computes the md5 hash of the uploaded file data and returns a file name. This should work _but_ when I save the model, the filename I gave back in the fu

Re: Feedparser strange behaviour on Unix-platform Django

2010-05-26 Thread steve
Resolved. Here it is, but don't throw a tomatoe at me or anything when I tell you. The database table that I was reading my feeds from - the record for the yahoo field.. it had a tab character right before the feed string. :\ On May 26, 12:33 pm, steve wrote: > Feedparser doesn't like, for som

set model field some value before add

2010-05-26 Thread ev
class Structure(models.Model): parent = models.ForeignKey('site.Structure',blank=True,null=True,default=0) title = models.CharField(max_length=128,verbose_name=u'Заголовок') url = models.CharField(max_length=48,verbose_name=u'URL') ordering = models.IntegerField(blan

Django v1.2 TestCase doesn't seem to load fixtures except 'initial_data'

2010-05-26 Thread Bryan
I am using Django v1.2 The fixture I defined "forum_fixtures.json" don't seem to be loading when I run tests. from django.test.client import Client from django.test import TestCase from utils import * from forum.models import * from forum import auth from django.contrib.contenttypes.models import

Re: Django error in django's context.py

2010-05-26 Thread zayatzz
On May 26, 10:26 pm, Karen Tracey wrote: > On Wed, May 26, 2010 at 12:13 PM, zayatzz wrote: > > Hello > > > I created new project, added bunch of apps (which are required for > > django cms 2.0) and when i proceeded to admin, to create first set of > > pages i got this error: > > >http://pasteb

Re: Safe and easy internationalization

2010-05-26 Thread Baurzhan Ismagulov
On Mon, May 24, 2010 at 01:47:14AM -0700, Pascal wrote: > From what I've read so far, using translation "tags" (or quick > phrases) in the code, and translating them to every target language > (including english) sounds a better approach than using, for example, > final english wordings as translat

Re: Help me with render_to_response!

2010-05-26 Thread Daniel Roseman
On May 26, 8:19 pm, Nate wrote: > I'm teaching myself django and I'm having an issue with > render_to_response.  I am passing it a template and a dictionary. > When I view the page on a local host, it displays the entire template, > including HTML tags, instead of formatting the page according to

Re: Help me with render_to_response!

2010-05-26 Thread Nate
def my_root_page(request): #t = get_template('root.html') html = 'Please Work!' #t.render(Context({})) return HttpResponse(html) def current_datetime(request): now = datetime.datetime.now() return render_to_response('current_datetime.html', {'current_date': now}) These are the

Custom model field validation with `clean_fields()`

2010-05-26 Thread kRON
I've recently read about `clean_fields()` and decided to move some stuff to I that I was doing in my `pre_save` handler previously. My tests failed and then I noticed that neither `clean_fields()` nor `full_clean()` was ever called before saving the model. The documentation says that only `clean()

apache wsgi deployment on non-root URL and absolute URLs for the auth contrib app

2010-05-26 Thread Javier
Hi all, I'm trying to deploy my app under a non-root url (http://myserver.com/ myapp), using apache and wsgi, but I'm having troubles with the configuration of the authentication framework. When trying to log in, I get redirected to the url I defined for that in the settings file (LOGIN_URL), but

Re: apache wsgi deployment on non-root URL and absolute URLs for the auth contrib app

2010-05-26 Thread Javier Rojas
Silly me can't write > > What should I do? change the LOGIN_*_URL settings somehow? to what > value should I change them? I checked some pinax code lying around > here, and I see that it simply prepends the url of deployment > under which the app is deployed to all the LOGIN_*_URL settings. >

Target WSGI script not found or unable to stat

2010-05-26 Thread mojito
Hello, I am trying to set up django 1.1.1 with mod_wsgi 2.3 and Apache 2.0.63 on Windows XP. My Python version is 2.4.4 I followed the instructions for installing and configuring mod_wsgi from http://code.google.com/p/modwsgi/. I set up the "Hello world " test first to see if my mod_wsgi install

Re: Target WSGI script not found or unable to stat

2010-05-26 Thread Graham Dumpleton
On May 27, 8:42 am, mojito wrote: > Hello, > I am trying to set up django 1.1.1 with mod_wsgi 2.3  and Apache > 2.0.63 on Windows XP. My Python version is 2.4.4 > > I followed the instructions for installing and configuring mod_wsgi > fromhttp://code.google.com/p/modwsgi/. > > I set up the "Hell

Speed Comparison of Django on CPython to Jython

2010-05-26 Thread Eric
Some basic searching hasn't answered my question if django running on CPython or Jython is faster. I know its not that simple of an issue, but I'm about to start a large django project that is moderately resource intensive, and will have to scale to pretty large sizes. Could anyone link some benchm

Re: can convert django docs of txt format to html format

2010-05-26 Thread pts
I've installed Sphinx, when I type "make html" under docs directory, but system shows that it cannot find this command. because I'm under windows xp system??? On May 18, 2:38 am, Daniel Roseman wrote: > On May 17, 5:05 pm, pts wrote: > > > After download django 1.2,i want to read docs offline,b

Redirect from a called function

2010-05-26 Thread shacker
I'm trying to figure out why HttpResponseRedirect doesn't work when called from within another function. For example, this works, of course: def foo(request): return HttpResponseRedirect('"http://example.com";) But this does not: def bar(request): print "In bar" return HttpResponseRedirect

Re: Redirect from a called function

2010-05-26 Thread Rendy Anthony
You also need to return the result of bar() from foo. Example: def bar(request): print "In bar" return HttpResponseRedirect('"http://example.com";) def foo(request): return bar() Regards, Rendy Anthony http://solyaris.wordpress.com On Thu, May 27, 2010 at 9:50 AM, shacker wrote: > I

Re: Redirect from a called function

2010-05-26 Thread shacker
Bingo! Thanks much. ./s On May 26, 6:57 pm, Rendy Anthony wrote: > You also need to return the result of bar() from foo. Example: > > def bar(request): >    print "In bar" >    return HttpResponseRedirect('"http://example.com";) > > def foo(request): >     return bar() > > Regards, > Rendy Antho

Re: set model field some value before add

2010-05-26 Thread Rendy Anthony
I think the best way is to override the Model's save method: class Structure(models.Model): parent = models.ForeignKey('site.Structure',blank=True,null=True,default=0) title = models.CharField(max_length=128,verbose_name=u'Заголовок') url = models.CharField(max_length=48,verbose_name=u

making this app re-usable

2010-05-26 Thread Jeffrey Taggarty
Hey Guys, I am trying to build this app so we ca re-use it throughout all of the projects we build. The re-usable app has it's own model and a FK to a specific model that it is related to, this is required. Right now I have a setting in my project settings.py that uses the re-usable that has this

Re: set model field some value before add

2010-05-26 Thread ev
Sounds good! I'm going to try )) On May 27, 6:45 am, Rendy Anthony wrote: > I think the best way is to override the Model's save method: > > class Structure(models.Model): >     parent > = models.ForeignKey('site.Structure',blank=True,null=True,default=0) >     title = models.CharField(max_length