can't show admin interface

2009-09-25 Thread pengwupeng
the environment is apache+django, accessing my app is ok,but i can't access the admin interface. the configuration of the httpd.conf is likes this below: Listen 127.0.0.1: SetHandler python-program PythonPath "sys.path+['c:/']" PythonHandler

Re: Need help with a filter in a view

2009-09-25 Thread Derek Willis
Jim's right, but I'd also suggest redoing your CurrentRanking model so it has just one foreign key, to SchoolSeason (since that in turn has fk's to the School model): class League(models.Model): league_name = models.CharField(max_length=100) class School(models.Model): school_name =

Re: Need help with a filter in a view

2009-09-25 Thread Jim McGaw
What you might be asking for is the following syntax, that allows you to perform queries against the data in more than one table: CurrentRanking.objects.filter (school__schoolseason__league__league_name="League Name").order_by('- rating') Those are double underscores between the model names and

Re: Need help with a filter in a view

2009-09-25 Thread jeffself
Oops. I should have said my current view returns a list of rankings (school_name, rating) rather than all schools. On Sep 25, 7:59 pm, jeffself wrote: > I've got the following models: > > class League(models.Model): >     league_name = models.CharField(max_length=100) > >

Need help with a filter in a view

2009-09-25 Thread jeffself
I've got the following models: class League(models.Model): league_name = models.CharField(max_length=100) class School(models.Model): school_name = models.CharField(max_length=100) class SchoolSeason(models.Model): season = models.IntegerField() school =

Re: Files in MEDIA_ROOT not getting accessed on Windows

2009-09-25 Thread Karen Tracey
On Fri, Sep 25, 2009 at 2:59 PM, Aaron wrote: > > I have a Django 1.1 project under Windows, and I am using an app that > uses JavaScript (specifically, Page CMS). The JavaScript is in the js > folder of the media folder, and I've set MEDIA_ROOT in my settings to > the full

Re: Unable to delete inline model in admin that contains a FileField (...attribute has no file associated with it)

2009-09-25 Thread Karen Tracey
On Fri, Sep 25, 2009 at 11:34 AM, DavidA wrote: > > Thanks, Karen. You were right - I had overridden it. If I delete the > __unicode__ method it works now. What's odd is that I can't seem to > catch any exception. If I try the code below, the admin still breaks. > And

Re: starting a new site with django

2009-09-25 Thread Gonzalo Delgado
El Fri, 25 Sep 2009 15:30:02 -0700 (PDT) Ronen Gal escribió: > I would like to build a website which sells videos (music lessons). > The site would include ~50 videos, 150MB each. > I need some kind of shopping cart, and the ability to recieve payment. > I also need user

starting a new site with django

2009-09-25 Thread Ronen Gal
Hi, I would like to build a website which sells videos (music lessons). The site would include ~50 videos, 150MB each. I need some kind of shopping cart, and the ability to recieve payment. I also need user accounts, so I can learn my users flavour and offer them appropriate videos. I need some

redirect to enter page

2009-09-25 Thread Dan Cox
Django Users, I'm pretty new to django so please excuse my ignorance. I'd like to redirect users to an "enter" page no matter where they entered the site. The enter page would have the user read/check a disclaimer type of box and then return to the page they were originally going to. Any

Re: TemplateSyntaxError: VariableDoesNotExist

2009-09-25 Thread Florian Schweikert
2009/9/24 Brian McKeever > > I would write a custom tag that wraps ugettext but checks for None. > > http://docs.djangoproject.com/en/dev/howto/custom-template-tags/#writing-custom-template-filters > http://docs.djangoproject.com/en/dev/topics/i18n/#standard-translation > > On

Overriding verbose_name in contrib or 3rd-party apps?

2009-09-25 Thread ringemup
Is there an easy way to override strings like help_text or verbose_name or __unicode__ methods for models in contrib or third- party apps? I can't seem to find anything on Google. Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Error Message regarding len()

2009-09-25 Thread Nick
You were exactly right, it was a sloppy mistake. Thanks for looking at this. Time to move on to the next error I just got. On Sep 25, 3:40 pm, Brian McKeever wrote: > I'd guess that you didn't set AWS_SECRET_ACCESS_KEY correctly in your > settings. > >

Re: Urls.py: Match a leading Question Mark

2009-09-25 Thread mike
Dziękują! (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-users@googlegroups.com To unsubscribe from this group, send email to

Re: Error Message regarding len()

2009-09-25 Thread Brian McKeever
I'd guess that you didn't set AWS_SECRET_ACCESS_KEY correctly in your settings. http://code.welldev.org/django-storages/wiki/S3Storage On Sep 25, 2:12 pm, Nick wrote: > something like this? > > Environment: > > Request Method: POST > Request

Re: Error Message regarding len()

2009-09-25 Thread Nick
something like this? Environment: Request Method: POST Request URL: http://localhost:8000/admin/StoryWall/statefair/16/ Django Version: 1.2 pre-alpha SVN-11434 Python Version: 2.5.4 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions',

Re: Error Message regarding len()

2009-09-25 Thread Brian McKeever
A stack trace would be more useful. On Sep 25, 12:07 pm, Nick wrote: > I'm using the django-storages backends from David Larlet to upload > images to s3 from inside the admin.  When i try to run everything I > get an error: > > object of type 'NoneType' has no len() > > Here

Re: are django applications portable?

2009-09-25 Thread Kevin Teague
On Sep 25, 9:59 am, dijxtra wrote: > Hi everybody, > > Django applications, as I understood them should be pluginable on > project basis. That is, I should be able to install them to my > *project*, not to my django installation. So I downloaded django- > tagging and run the

Re: Named URL Patterns -- Syntax Error

2009-09-25 Thread W3
Thanks, that was it. Bit of a simple one I probably should have spotted. Andrew On 25 Sep, 19:42, Tim Chase wrote: > > Can somebody tell me why i get a syntax error with this named URL > > pattern? > > > urlpatterns = patterns('', > >     url(r'^feed/(?P.*)/$',

Files in MEDIA_ROOT not getting accessed on Windows

2009-09-25 Thread Aaron
I have a Django 1.1 project under Windows, and I am using an app that uses JavaScript (specifically, Page CMS). The JavaScript is in the js folder of the media folder, and I've set MEDIA_ROOT in my settings to the full path to the media folder (with backslashes replaced by forward slashes).

Re: Named URL Patterns -- Syntax Error

2009-09-25 Thread Tim Chase
> Can somebody tell me why i get a syntax error with this named URL > pattern? > > urlpatterns = patterns('', > url(r'^feed/(?P.*)/$', > 'django.contrib.syndication.views.feed', > {'feed_dict': feeds} looks like a missing comma here... > name="feed"), > ) -tim

Re: opener.dismissAddAnotherPopup error tinymce

2009-09-25 Thread Joost Cassee
On 24 sep, 15:36, Ali Rıza KELEŞ wrote: > But i just defined document.domain in my tinymce initializer, nowhere > else.. Is there anywhere else should I define it? Yes, because *all* Javascript code that needs to work together must have the same document.domain value.

Re: are django applications portable?

2009-09-25 Thread dijxtra
On Sep 25, 7:54 pm, Javier Guerra wrote: > On Fri, Sep 25, 2009 at 11:59 AM, dijxtra wrote: > > > Hi everybody, > > > Django applications, as I understood them should be pluginable on > > project basis. That is, I should be able to install them to my > >

Error Message regarding len()

2009-09-25 Thread Nick
I'm using the django-storages backends from David Larlet to upload images to s3 from inside the admin. When i try to run everything I get an error: object of type 'NoneType' has no len() Here is my model: from django.db import models from django.core.files.storage import default_storage as

Named URL Patterns -- Syntax Error

2009-09-25 Thread When ideas fail
Can somebody tell me why i get a syntax error with this named URL pattern? urlpatterns = patterns('', url(r'^feed/(?P.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feeds} name="feed"), ) This is the traceback: Traceback: File

Re: are django applications portable?

2009-09-25 Thread Javier Guerra
On Fri, Sep 25, 2009 at 11:59 AM, dijxtra wrote: > > Hi everybody, > > Django applications, as I understood them should be pluginable on > project basis. That is, I should be able to install them to my > *project*, not to my django installation. 'portable' means 'use from any

Re: are django applications portable?

2009-09-25 Thread Brian McKeever
I'm not familiar with the plugin, but I would guess that it's trying to add itself to the python path. That way it's easily available for any django project without having to include it in an individual project. I would bet that it'd work just fine included manually in your project without

Re: is this a sane way to show total number of objects in pagination?

2009-09-25 Thread Brian McKeever
Oh, it's just a preference. I don't like calculating stuff in the template. It violates the MVT pattern to some minor degree. On Sep 25, 6:41 am, Bryan wrote: > I can't think of a reason, if nothing else its a matter or taste/ > preference.  He said "I would probably...",

Re: is this a sane way to show total number of objects in pagination?

2009-09-25 Thread Brian McKeever
.count uses a sql function that just counts the rows. Doing len(model.objects.all()) pulls ALL of the objects from the database including all of the associated data and then counts them. It should be a significant performance difference for any large data set. On Sep 24, 11:12 am, Chris

are django applications portable?

2009-09-25 Thread dijxtra
Hi everybody, Django applications, as I understood them should be pluginable on project basis. That is, I should be able to install them to my *project*, not to my django installation. So I downloaded django- tagging and run the python setup.py install. And it failed:

Re: Unable to delete inline model in admin that contains a FileField (...attribute has no file associated with it)

2009-09-25 Thread DavidA
Thanks, Karen. You were right - I had overridden it. If I delete the __unicode__ method it works now. What's odd is that I can't seem to catch any exception. If I try the code below, the admin still breaks. And what's also odd is that I never see my models.py file in the stack trace. def

URL resolving of patterns including 0 or 1 operator fails.......

2009-09-25 Thread Lewis Taylor
Here it goes: I wanted a clean url structure so i tried to abstract as much as i could in one url pattern. it looks something like this: url(r'^approved/((?P[a-zA-Z ,-]+)?)(/?)((?P[0-9]+)?) (/?) $', get_approved_images, name='approved_images') this in theory should allow the return of 1) all

django-lean for a/b split-testing

2009-09-25 Thread Erik Wright
Hi folks, My team has recently begun following a product development approach modeled heavily on Customer Development and Lean Startup concepts. In particular, we are now using a/b split-test experiments to measure the impact of all visible changes on our users. When we started out, we found

Re: Unable to delete inline model in admin that contains a FileField (...attribute has no file associated with it)

2009-09-25 Thread Karen Tracey
On Fri, Sep 25, 2009 at 9:05 AM, DavidA wrote: > > I'm getting this error when I try to remove an inline model instance > in the Django admin: > >Traceback: >File "C:\Python25\lib\site-packages\django\core\handlers\base.py" > in get_response > 92.

Unable to delete inline model in admin that contains a FileField (...attribute has no file associated with it)

2009-09-25 Thread DavidA
I'm getting this error when I try to remove an inline model instance in the Django admin: Traceback: File "C:\Python25\lib\site-packages\django\core\handlers\base.py" in get_response 92. response = callback(request, *callback_args, **callback_kwargs) File

Re: is this a sane way to show total number of objects in pagination?

2009-09-25 Thread Bryan
I can't think of a reason, if nothing else its a matter or taste/ preference. He said "I would probably...", so he may have been implying that there was a technical reason but most likely he was just stating his preference. On Sep 25, 5:03 am, Chris Withers wrote: >

Re: same session on more than 1 website

2009-09-25 Thread Hinnack
please add to the documentation:every site has to have the same SECRET_KEY, too when you want to get session vars from a different host, as the cookie-data is encoded by this key. -- Hinnack --~--~-~--~~~---~--~~ You received this message because you are

Re: Multi table inheritance and reverse lookup

2009-09-25 Thread Bogdan I. Bursuc
Don't know if this is the solution for you, but you could take a look here: http://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#id1 and do something like this: class Product(models.Model): name = models.CharField(max_length=64) class Meta:

Re: The emergence of captcha after several incorrect logins

2009-09-25 Thread Sam Lai
Not much you can do apart from track IP addresses and enable recaptcha for it for a certain period of time. The client can manipulate everything else they send to you. Sure you'll end up annoying some innocent people, but because you're only enabling it for a limited period of time, it shouldn't

Re: Django point field

2009-09-25 Thread please smile
Thanks a lot Nabil servais. its works for me too On Fri, Sep 25, 2009 at 2:06 PM, Nabil Servais wrote: > > Hello, > > I use json for output instead of cvs, and it works. Also I convert the > lattitude and longitude into float. > > enjoy > > def

Re: Django point field

2009-09-25 Thread Nabil Servais
Hello, I use json for output instead of cvs, and it works. Also I convert the lattitude and longitude into float. enjoy def get_lat_long(location): key = settings.GOOGLE_API_KEY output = "json" location = urllib.quote_plus(location) request =

The emergence of captcha after several incorrect logins

2009-09-25 Thread chegivara
Hi all, I use this code to show a recaptcha after several incorrect logins. The essence of the work is this: It creates the session to count the number of invalid logins and after 3 times wrong authentication emergence recaptcha. But you can simply delete the session and thus bypass a

Re: Django point field

2009-09-25 Thread Nabil Servais
Hello, I solve your probleme in changing the output format into json, then I convert the coordinates into Float. def get_lat_long(location): key = '' output = "json" location = urllib.quote_plus(location) request = "http://maps.google.com/maps/geo?q=%s=%s; %

Re: is this a sane way to show total number of objects in pagination?

2009-09-25 Thread Chris Withers
Jani Tiainen wrote: > Chris Withers kirjoitti: >> Brian McKeever wrote: >>> .count is definitely the way to go. Although, I would probably pass it >>> to your template instead of determining it there. >> What difference does it make? > > len(qs) evaluates queryset - thus pulling in _every_

Re: is this a sane way to show total number of objects in pagination?

2009-09-25 Thread Daniel Roseman
On Sep 25, 9:08 am, Jani Tiainen wrote: > Chris Withers kirjoitti: > > > Brian McKeever wrote: > >> .count is definitely the way to go. Although, I would probably pass it > >> to your template instead of determining it there. > > > What difference does it make? > > len(qs)

assign dynamic value to form field in django admin

2009-09-25 Thread Joru
Hi I need to assign one form field dynamically inside django admin when user change value in select box class One(models.Model): name = models.CharField(max_length=200) code = models.CharField(max_length=100) class Two(models.Model): two_name = models.CharField(max_length=200)

Re: Django 1.0 cannot handle ManyToOne inheritance in two apps

2009-09-25 Thread Daniel Roseman
On Sep 25, 3:30 am, luciferleo wrote: > Hi, I am using Django 1.0 > Suppose I have two models in one file: > > class BaseModel(models.Model): >     # attrs >     creator = models.ForeignKey('User', related_name='%(class) > s_creator_set') > > class User(BaseModel): >     #

Re: Urls.py: Match a leading Question Mark

2009-09-25 Thread Jarek Zgoda
Wiadomość napisana w dniu 2009-09-25, o godz. 10:16, przez mike: > > Hi. Im migrating from an old PHP piece of junk to Django (hooray) and > this client is very insistent on maintaining all of his old PHP-based > URLs, which will be 301 redirected so as to not lose SEO. As there > are 1000s of

Urls.py: Match a leading Question Mark

2009-09-25 Thread mike
Hi. Im migrating from an old PHP piece of junk to Django (hooray) and this client is very insistent on maintaining all of his old PHP-based URLs, which will be 301 redirected so as to not lose SEO. As there are 1000s of these links, mod_rewrite might not be the best solution, especially since

Re: is this a sane way to show total number of objects in pagination?

2009-09-25 Thread Jani Tiainen
Chris Withers kirjoitti: > Brian McKeever wrote: >> .count is definitely the way to go. Although, I would probably pass it >> to your template instead of determining it there. > > What difference does it make? len(qs) evaluates queryset - thus pulling in _every_ object from DB to Python -

Re: Firefox search plugin for Django documents

2009-09-25 Thread taijirobot
I feel happy that it can you:) On Sep 25, 2:47 am, dimitri pater - serpia wrote: > 2009/9/24 玉东 : > > > > > Hi, guys, > > > I've made afirefoxsearch plugin for django documents. It can save your > > time if you often search the official django

Django point field

2009-09-25 Thread please smile
Hi all, I have a problem to convert latitude and longitude values into point field value. def get_lat_long(location): key = settings.GOOGLE_API_KEY output = "csv" location = urllib.quote_plus(location) request = "http://maps.google.com/maps/geo?q=%s=%s=%s;

Simple database replication app for Django

2009-09-25 Thread Roberto Rosario
I needed a simple way to append new records from many Oracle dbs to one Mysql db, and came up with this solution. As part of the mantra "Release Early, Release Often" I'm putting it into a separate app, making it more generic and releasing it on google code. Code is at:

same session on more than 1 website

2009-09-25 Thread hinnack
hi, I do have only set SESSION_COOKIE_DOMAIN = '.dev.miadi.net' in both sites and now I am expecting to be able to set a value under host1.dev.miadi.net and to read it under host2.dev.miadi.net - but this does not work. the browser does send the cookie he got from host1 to host2, but the site