Re: Django serving multiple subdomain sites -- okay to use thread-locals?

2010-05-31 Thread Graham Dumpleton
On Jun 1, 1:04 pm, Kieran Farr wrote: > We're adapting our Django powered video site to be an open video > platform for any user to create their own "site" using subdomains (eg > mysite.vidplatform.com) on one Django server instance. Each "site" > would obviously have

Django serving multiple subdomain sites -- okay to use thread-locals?

2010-05-31 Thread Kieran Farr
We're adapting our Django powered video site to be an open video platform for any user to create their own "site" using subdomains (eg mysite.vidplatform.com) on one Django server instance. Each "site" would obviously have content associated with only that site in addition to template and

Re: Built in password reset views resulting in Caught NoReverseMatch while rendering: Reverse for 'django.contrib.auth.views.password_reset_confirm'

2010-05-31 Thread Mike Dewhirst
On 1/06/2010 6:20am, Cromulent wrote: Hi Mike, Thanks for the response. I did think of that. My template loaders setting is as follows: TEMPLATE_LOADERS = ( 'django.template.loaders.app_directories.Loader', 'django.template.loaders.filesystem.Loader', ) all of my templates are

don't work Flatpages

2010-05-31 Thread gerram
Hi, everybody! I tried to set Flatpages about 3 days but I could get only "404" error in browser. If someone had a few time look at my settings: http://files.mail.ru/JXHUOU Enter for admin part: user:Django, pass:Django Regards. -- You received this message because you are subscribed to the

Help: Custom ManyRelatedManager Behavior

2010-05-31 Thread Tim
Hi, I am having trouble getting the behavior I would like from a ManyRelatedManager. I have a many to many relationship with User and ModelB, with a join table ModelJ. Instead of deleting items in my database, I am simply marking them as deleted. I have a custom manager that filters out deleted

Twisty Little Passages... widgets, fields, forms

2010-05-31 Thread Michael Davis
I'm trying to implement a simple grade book application using a modelformset where the students' names are READONLY and the grades are the only thing the teacher can edit. I've been looking for sample code to implement the readonly portion and one fellow (on another site) suggests I use his, but

Re: Can't access Django Dev Server.

2010-05-31 Thread Jeliuc Alexandr
Hello 1. no index page (debug off) 2. try another port 3. check for bugs in urls and views 4. recheck configurations in settings On May 30, 3:03 am, gin tonic wrote: > My development server is running but when I attempt to access it at > the localhost 127.0.0.1:8000 I

Re: Can't access Django Dev Server.

2010-05-31 Thread gin tonic
FIXED: settings.py > was ADMIN_MEDIA_PREFIX = '' settings.py > is now ADMIN_MEDIA_PREFIX = '/media/' On May 31, 3:15 pm, gin tonic wrote: > Also, I can connect to other projects, just not this one. Seems like > I'm overlooking something in settings.py or urls.py.

Re: Can't access Django Dev Server.

2010-05-31 Thread gin tonic
Also, I can connect to other projects, just not this one. Seems like I'm overlooking something in settings.py or urls.py. What would cause it to give no errors while not connecting? On May 31, 1:31 pm, gin tonic wrote: > Nope. > > But, there were changes in with some

Re: django-registration custom fields

2010-05-31 Thread Pankaj Singh
Thanks my problem has been resolved :) -- 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.

not understanding the OAuth2 docs

2010-05-31 Thread pyfreak
I plan on utilizing: http://github.com/simplegeo/python-oauth2 for my django-based Twitter app, however I'm wondering if anyone here who understands the django example, understands it better than I do. The first half of the page has an example for just plain Python, and there's a part there,

Re: Can't access Django Dev Server.

2010-05-31 Thread gin tonic
Nope. But, there were changes in with some of the settings when I did my first upload to webfaction, but from what I can tell, I've restored all my settings to their original state before the upload, but even though the dev runs, I can't connect. On May 29, 5:30 pm, Juan Hernandez

Importing ImageField from file or - better - generating it from another ImageField

2010-05-31 Thread Ricardo Bánffy
Hi folks I am having huge problems wrapping my head around the ImageField field type. I am trying to generate default thumbnails for uploaded images, both stored as ImageField attributes. It's done this way because the user must be able to manually edit the thumbnail if needed. I am failing

Re: Built in password reset views resulting in Caught NoReverseMatch while rendering: Reverse for 'django.contrib.auth.views.password_reset_confirm'

2010-05-31 Thread Cromulent
Hi Mike, Thanks for the response. I did think of that. My template loaders setting is as follows: TEMPLATE_LOADERS = ( 'django.template.loaders.app_directories.Loader', 'django.template.loaders.filesystem.Loader', ) all of my templates are stored in the template directory for each

Re: Image deduplication and upload_to

2010-05-31 Thread Ricardo Bánffy
Thanks. I have successfully made a lobotomized version I called OverwritingStorage that extends FileStorage and overrides get_available_name, _save and delete (and offers a hashed_path classmethod to be used in upload_to callables) http://djangosnippets.org/snippets/2044/ Now my problem is not

django problems

2010-05-31 Thread rahul jain
Hi Django, I have few questions and would like to seek your help. Q1) I have defined lot of admin actions and some of the actions require creating threads. So I split my long models.py into set of files. But whenever I try to import anything from models python complains ? ex: if i have defined

Re: Django form validations

2010-05-31 Thread Horst Gutmann
Well, since validators were introduced with 1.2 you can't really use them just right away with 1.1. So if zou want to use validators as in 1.2, you probably should update to 1.2 ;-) But there are still all the other validation facilities available like clean_fieldname etc. You can find all the

Re: django-admin-tools

2010-05-31 Thread rahul jain
Hi David, DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_em...@domain.com'), ) MANAGERS = ADMINS DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. # Local time zone for this installation. Choices can be

Re: Item is already being moderated

2010-05-31 Thread shacker
On May 31, 1:41 am, shacker wrote: > I get "The model 'item' is already being moderated."  I haven't set up > moderation before, so it's not clear what's triggering this. I do have > an "enable_comments" field on the Item model. Odd that the error puts > "item" in

Re: Problems with Django File Fields

2010-05-31 Thread Nuno Maltez
Well, I know this doesn't address most of the issues you raise, but I've used a combination of django-filebrowser, http://code.google.com/p/django-filebrowser/ , FileBrowseField and apache's x-sendfile, http://tn123.ath.cx/mod_xsendfile/, for serving restricted access files, successfully. I found

Re: Inconsistent database results between application and shell

2010-05-31 Thread Stodge
I hang my head in shame. I had the name and type reversed in my Ajax call to the view. :( On May 31, 12:19 pm, Stodge wrote: > Weird: > > syslog.syslog("Connections = %s" % str(connection.queries)) > > gives: > > May 31 12:18:41 localhost python: Connections = [] > > On May

Error

2010-05-31 Thread Bruxo_Mor Juca
Senhores, Preciso de ajuda no que se diz respeito a configuração do MANAGE.PY estou com o seguinte erro: Error execute_manage.py(settings) Estou criando uma pagina, criei no arquivo de Setting.py a seguinte definição: 'django.contrib.blog'; inclui esta linha logo abaixo da linha

Re: Django form validations

2010-05-31 Thread tazimk
yes, I have read that section but right know I am using Django version 1.1 which does not support some new built in validation functions . Also, where should valiadtions be done ideally server side or client side i.e using javascripts etc ? On May 31, 1:01 pm, Horst Gutmann

Can't override a ForeignKey field in a model-generated form

2010-05-31 Thread David Euzen
Using Django 1.2, I've got a "Niveau" class in models.py. That class contains an auto- refering field called "niveau" as a ForeignKey field. I use this class to store a tree structure: the "niveau" field references a "Niveau" instance's parent. class Niveau(models.Model): TYPES=( ('CAMP',

Re: django-registration custom fields

2010-05-31 Thread shacker
Pankaj - The fact that you're using a save() method here means that you're using instructions referring to an older version of django- registration. But you're probably actually deploying a current version, which doesn't allow for that. The upgrade guide says: "Previously, the form used to

Re: tinymce hyperlinks

2010-05-31 Thread Nuno Maltez
Maybe related to this issue? http://code.google.com/p/django-grappelli/issues/detail?id=184 It's supposed to be fixed on the latest grappelli release though. Nuno On Mon, May 31, 2010 at 5:13 PM, Bobby Roberts wrote: > the only javascript error i'm getting is this: > >

Re: Inconsistent database results between application and shell

2010-05-31 Thread Stodge
Weird: syslog.syslog("Connections = %s" % str(connection.queries)) gives: May 31 12:18:41 localhost python: Connections = [] On May 31, 12:12 pm, Stodge wrote: > Thanks. The various pieces of data (self.name etc) are 100% correct - > I dumped them all using syslog.

Re: Empty QueryDict on POST

2010-05-31 Thread Shawn Milochik
Try using django-debug-toolbar. It will show the POST and GET values. Also, you can use request.POST.get('formID') instead, which will return None (or the second, optional argument) if it's empty. What is your json_response middleware doing? Could it have anything to do with this? What if

Re: tinymce hyperlinks

2010-05-31 Thread Bobby Roberts
the only javascript error i'm getting is this: document.getElementsBySelector is not a function it's in my admin/js folder in the action.js file? On May 31, 5:15 am, Nuno Maltez wrote: > Which version of grappelli are you using? Currently the trunk requires > django

Re: Inconsistent database results between application and shell

2010-05-31 Thread Stodge
Thanks. The various pieces of data (self.name etc) are 100% correct - I dumped them all using syslog. However, it just occurred to me that maybe it's a unicode/string issue. I'm trying to dump the SQL that's generated - debug_toolbar isn't working for me. The timestamps are generated from the

Re: Inconsistent database results between application and shell

2010-05-31 Thread Javier Guerra Giraldez
On Mon, May 31, 2010 at 9:56 AM, Stodge wrote: > I have a query that filters on four fields: > >                res = MyModel.objects.filter(name=self.name, >                                                           type=self.type, >                                              

Re: Django 1.2.1 install in Ubuntu 10.04 via Synaptic?

2010-05-31 Thread AD
Thanks. I went ahead and downloaded the Django 1.2.1 tarball, untarred it and ran sudo python setup.py install in the directory. I needed to make one small change in my Apache httpd.conf file, but otherwise it all seems to be working smoothly! Thanks! On May 31, 10:33 am, Massimiliano della

Inconsistent database results between application and shell

2010-05-31 Thread Stodge
I have a query that filters on four fields: res = MyModel.objects.filter(name=self.name, type=self.type, last_update_time__gte=today,

Re: Django 1.2.1 install in Ubuntu 10.04 via Synaptic?

2010-05-31 Thread Massimiliano della Rovere
or you can do the following tric: 1) install django sudo apt-get -y install python-django 2) now you have all the dependencies you need 3) sudo apt-get -y install python-setuptools 4) sudo apt-get remove python-django 5) sudo easy_install -Z django repeat step 5 after each release of django On

Empty QueryDict on POST

2010-05-31 Thread Brian
Hello! I could use some help tracking down a problem here. I have a view that starts as follows: @login_required @json_response def save_exercise_week( request, week_id ): formID = request.POST['formID'] But this returns a 500 error because the QueryDict is empty -- MultiValueDictKeyError

Re: Django 1.2.1 install in Ubuntu 10.04 via Synaptic?

2010-05-31 Thread Leonel Nunez
> I agree with you, Shawn. I just didn't want to push ahead with a manual uninstall and install if more-experienced Ubuntu users thought I'd be seeing Django 1.2.1 show up in the repository quickly. > > I'll give it a go. Thanks, > Ubuntu is a stable linux distribution. This means once a release

Re: New product django-queries

2010-05-31 Thread Guthy Peter
No, I haven't seen this, thank you for pointing me at that. However, I think my "solution" is a much simpler one. You don't have to write views, everything is set up automatically. Also, the list of searchable models is generated automatically. Of course, django-queries is a tool for people you

Re: New product django-queries

2010-05-31 Thread David De La Harpe Golden
On 31/05/10 11:55, Guthy Peter wrote: Dear Django users, I have written a new module for Django: it's called django-queries, and is sort of a mix between the Admin and the Databrowse products. While the Admin interface is for entering data, django-queries is intended for searching the entered

Re: Auto populate currently logged in user's user id in forms

2010-05-31 Thread gvkalra
I think that I figured it out . we can use commit=False then get the user from request.user .. am I correct ? ... any other way ?? On May 31, 6:03 pm, gvkalra wrote: > Hi. > Here what I have >

Re: How can I test the correctness of my models against the schema of a database?

2010-05-31 Thread David Horat
Thanks for the info Jani. One question: How did you manage to make the tests in Django? Because it forces you to create a test database and the idea of our tests is to do them on an already full test database. My idea if I can't skip it is to try and make them with the Python Unit Testing

Problems with Django File Fields

2010-05-31 Thread klaasvanschel...@gmail.com
Hi All, The standard Django File Fields (both on models and the form equivalent) have a number of shortcomings from my point of view / in my field. The most important of these are: * The result of uploaded file fields are assumed to be "public", i.e. served through the MEDIA url. I would rather

Auto populate currently logged in user's user id in forms

2010-05-31 Thread gvkalra
Hi. Here what I have done http://github.com/gvkalra/showtime/blob/master/photo/views.py What I want to do is: Auto populate the database with currently logged in user's user id like it has been done with the date of creation of the record by using uploaded = models.DateField(auto_now_add=True)

Re: db autoclobbering with automated tests

2010-05-31 Thread Russell Keith-Magee
On Fri, May 28, 2010 at 12:59 PM, Rolando Espinoza La Fuente wrote: > On Thu, May 27, 2010 at 2:00 PM, dmitry b wrote: >> So, no one is running automated tests? > > I'd added a patch that adds the --noinput option to testserver command: >

Re: New product django-queries

2010-05-31 Thread Guthy Peter
You have much more freedom with defining search criteria. In case of ForeignKeys, users can also select more then one related object, so one can search for "books, that have genre Sci-Fi or Fantasy". Also, as it's noted in the documentation, you can define InlineQueries (comparable to the

Re: New product django-queries

2010-05-31 Thread Jeliuc Alexandr
Hello. Can You explain the difference between this module and filters and search functionality of admin.modelAdmin? What is its best? On May 31, 1:55 pm, Guthy Peter wrote: > Dear Django users, > > I have written a new module for Django: it's called django-queries, > and is sort

Re: Django form validations

2010-05-31 Thread Horst Gutmann
Have you already read http://docs.djangoproject.com/en/1.2/ref/forms/validation/#ref-forms-validation ? On Mon, May 31, 2010 at 9:16 AM, tazimk wrote: > How to use django custom validators to verify form fields data > > -- > You received this message because you are

New product django-queries

2010-05-31 Thread Guthy Peter
Dear Django users, I have written a new module for Django: it's called django-queries, and is sort of a mix between the Admin and the Databrowse products. While the Admin interface is for entering data, django-queries is intended for searching the entered information. After defining the

Re: Django project as linux package

2010-05-31 Thread Petr Pejcel
Thanks so much. But I don't need to do it, but talk about it on my exam. Can you give me only important things, which must be done? Thanks again. On 31 kvě, 10:21, Baurzhan Ismagulov wrote: > On Mon, May 31, 2010 at 12:36:36AM -0700, Petr Pejcel wrote: > > How can I

fabric ssh connect problem

2010-05-31 Thread knight
Hi, I'm trying to deploy a django app with fabric and get the following error: Alexs-MacBook:fabric alex$ fab config:instance=peergw deploy -H - u -p [192.168.2.93] run: cat /etc/issue Traceback (most recent call last): File "build/bdist.macosx-10.6-universal/egg/fabric/main.py", line 419,

uploading file in 2 steps

2010-05-31 Thread knight
Hi, I want to upload a file in 2 steps. First I want to upload it and show the errors and on the second step I want actually to save the file data in the database. So I made a simple form and my problem is how to pass the same file to the form on the second step. I mean how to insert

Re: ImportError: No module named django.core

2010-05-31 Thread Nuno Maltez
Well, it seems that your python lib is at /usr/lib/python2.6/dist-packages: > mx:~/webapps$ python -c "from distutils.sysconfig import > get_python_lib; print get_python_lib()" > > /usr/lib/python2.6/dist-packages but django is in "local" - /usr/local/lib/python2.6/dist-packages >

RE: Re: Django project as linux package

2010-05-31 Thread Henrik Genssen
you can use ant and ant-deb-task http://code.google.com/p/ant-deb-task/ regards Henrik >reply to message: >date: 31.05.2010 10:21:04 >from: "Baurzhan Ismagulov" >to: "Django users" >subject: Re: Django project as linux package > >On Mon, May

Re: tinymce hyperlinks

2010-05-31 Thread Nuno Maltez
Which version of grappelli are you using? Currently the trunk requires django 1.2 but I think there's a branch that still works with 1.1. Having said that, we're using grappelli (a slightly older revision) with Django 1.1 in a live project and it works just fine. Do you notice any javascript

Item is already being moderated

2010-05-31 Thread shacker
Per the comment moderation docs at: http://docs.djangoproject.com/en/dev/ref/contrib/comments/moderation/ : # models.py from django.contrib.comments.moderation import CommentModerator, moderator class ItemModerator(CommentModerator): email_notification = True enable_field =

Re: Django project as linux package

2010-05-31 Thread Baurzhan Ismagulov
On Mon, May 31, 2010 at 12:36:36AM -0700, Petr Pejcel wrote: > How can I distribute Django project as linux package? For example deb > package. http://www.radix50.net/~ibr/notes/20080323-0-django-autotools-debian.html Questions or feedback welcome. With kind regards, -- Baurzhan Ismagulov

Re: django-registration custom fields

2010-05-31 Thread Pankaj Singh
I am using django-profiles with django-registration as per tutorial from http://praveensunsetpoint.wordpress.com/2009/04/21/django-registration-and-django-profile But after the submitting the form I am getting this error AttributeError at /accounts/register/ 'RegistrationForm' object has no

Django project as linux package

2010-05-31 Thread Petr Pejcel
Hello, Can anyone give me hand and help me with my problem? How can I distribute Django project as linux package? For example deb package. Thanks a lot for your time. Regards Petr -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Django form validations

2010-05-31 Thread tazimk
How to use django custom validators to verify form fields 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

Re: How can I test the correctness of my models against the schema of a database?

2010-05-31 Thread Jani Tiainen
Not really. If you're specially working with legacy databases trying to figure out that do Django models match underlying schema is PITA. We resolved this partially by doing few simple tests, namely running through all models and doing empty query. Since Django ORM queries for every field it

Re: Query Posts By Date

2010-05-31 Thread greg
Amazingly simple yet exactly what I wanted. And here I was trying to convert year and month into date objects. Thank you. On May 30, 10:19 pm, Justin Myers wrote: > If you're passing a "year" and "month" variable, I would use > Post.objects.filter(publish_date__year=year, >