If your on Dreamhost, vote for Django support

2009-10-27 Thread Richard Jeong
Thanks to Daniels help, I'm likely going to get my Dreamhost VPS server installed inspite of the problems I had during my attempt at installation. I would like to adovcate that for anyone else who is still on Dreamhost and on this list, vote for Full Django support

django can't access site-packages when inside fastcgi on dreamhost

2009-10-27 Thread Jacob Fenwick
Wow, big surprise that someone else is having shared hosting issues with dreamhost eh? I'm importing a library I installed in site-packages in a module in a django app. When I call this django project, it returns with the error: ImportError: No module named lxml The django project is hosted on t

Re: How to stop web engine crawler crawling at URL that does not exists?

2009-10-27 Thread Karen Tracey
On Tue, Oct 27, 2009 at 7:38 PM, Joshua Partogi wrote: > > Hi all, > > I keep getting an error from the server because there's a web crawler > that is crawling at a URL that does not exists on my application > because it made a guess of a URL that should be on my application. > This is the error t

Re: upload problems

2009-10-27 Thread Karen Tracey
On Tue, Oct 27, 2009 at 5:57 PM, bax...@gretschpages.com < mail.bax...@gmail.com> wrote: > > Not sure what's going on, but my images aren't uploading. > > I'm using the built-in dev server. > > I'm on OS X. > > I've tried a lot of different things for MEDIA_ROOT. The most recent > is: > MEDIA_ROOT

Re: Versionable Models?

2009-10-27 Thread Todd Blanchard
On Oct 27, 2009, at 6:09 PM, Tim Chase wrote: > >> There's quite a learning curve here. > > The learning curve doesn't have much to do with Django, but > rather development in general -- any time you take on a new > technology (or soup of technologies, in this case Python/HTML/CSS > Django's tem

Re: Versionable Models?

2009-10-27 Thread Tim Chase
> There's quite a learning curve here. The learning curve doesn't have much to do with Django, but rather development in general -- any time you take on a new technology (or soup of technologies, in this case Python/HTML/CSS Django's templating language, and possibly SQL) there's a hill to cl

Colored HTTP status codes

2009-10-27 Thread HARRY POTTRER
I was looking around the trac for the django project and came across this ticket: http://code.djangoproject.com/ticket/6385 It seemed like a pretty cool idea, and I hoped it would get to be added to the 1.2 release. Then I saw it was created over 2 years ago. I applied the patch to my cope of 1

models.py

2009-10-27 Thread Vman
how do i insert this: from django.contrib.auth.models import User class Bookmark(models.Model): title = models.CharField(maxlength=200) user = models.ForeignKey(User) link = models.ForeignKey(Link) into this? from django.db import models class Link(models.Model): url = models.URLField(unique=Tr

Re: how to store web page content values in client side?

2009-10-27 Thread Todd Blanchard
You shouldn't have to do that. Most browsers cache form state so if a user jumps off your page, then hits back, the form values should all be restored. Try doing nothing and see what the browser does. I'll bet it is what you want. -Todd On Oct 27, 2009, at 4:37 PM, webbo wrote: > > Hi

How to stop web engine crawler crawling at URL that does not exists?

2009-10-27 Thread Joshua Partogi
Hi all, I keep getting an error from the server because there's a web crawler that is crawling at a URL that does not exists on my application because it made a guess of a URL that should be on my application. This is the error that I get: NoReverseMatch: Reverse for 'blog-month-archives' with a

how to store web page content values in client side?

2009-10-27 Thread webbo
Hi all, I am new to django and web design. I might ask some non-sense questions. I want to store dropdown boxes values on client side by cookies. For example, any users open the web page and choose dropdown box value. If they jump to other page then go back, the web page will automatically sh

Re: Versionable Models?

2009-10-27 Thread Todd Blanchard
Great, I was trying to decide between that and "The definitive guide" and guess which one I ordered Back to Amazon... :-/ There's quite a learning curve here. -Todd On Oct 27, 2009, at 5:15 PM, Mike Dewhirst wrote: > > Todd Blanchard wrote: >> Total django noob here. Rails/PHP/Web

Re: Versionable Models?

2009-10-27 Thread Mike Dewhirst
Todd Blanchard wrote: > Total django noob here. Rails/PHP/WebObjects refugee here. > > I'm starting a project where some models need to be fully versioned. > > IOW, record update is forbidden - every save to a changed model should > result in a new record with a new version number or timestam

Consequences of a force_update

2009-10-27 Thread Gerard
Hi all, I'm trying to get all queries to have a where clause on a owner field for security reasons (overwritten filter() in a subclassed manager. Django seem to do a query in certain cases in the save_base() function, to make sure it actually can do an update. Does this have a particular reaso

Re: Filtering on model methods

2009-10-27 Thread Mikhail Korobov
If you want to be able to sort by some python method you have to fetch ALL data from all tables that are used in this method. It is indeed a bad practice and so it is not encouraged in django. The best you can do is to put your code to model's manager as a method. Model managers are often used fo

upload problems

2009-10-27 Thread bax...@gretschpages.com
Not sure what's going on, but my images aren't uploading. I'm using the built-in dev server. I'm on OS X. I've tried a lot of different things for MEDIA_ROOT. The most recent is: MEDIA_ROOT = '/Users//Sites/django-media/' and MEDIA_URL = '/media/' For now, while it's just in test, I have this

Re: models.py - __unicode() - Access related object's attributes?

2009-10-27 Thread Victor Hooi
heya, Daniel: Thanks for the quick reply. Hmm, ok, I made the correction to the code you recommended (changing str() to string interpolation). Do you know any good references on this, so I can get a better understanding of how these things are meant to work? For accessing the field, I found out

Re: Filtering on model methods

2009-10-27 Thread pbzRPA
Sorry I would also like to add that I would like to sort by this field in generic views. So results = Person.objects.filter (compare_to_others__gte = 1).order_by('compare_to_others') --~--~-~--~~~---~--~~ You received this message because you are subscribed to th

Filtering on model methods

2009-10-27 Thread pbzRPA
Hi all, I keep running into a problem. Often when creating models for existing databases which you can not modify, I find myself in need of quite a few model methods. That all works fine but then when I run a view I would like to be able to use the object mapper to filter by the method on a model

Re: Error

2009-10-27 Thread Vincent Jones
Thanks i am still a newbie and didn't realize how important upper and lower case letters are in programing. it works correctly now. On Tue, Oct 27, 2009 at 4:26 PM, Gabriel . wrote: > > On Tue, Oct 27, 2009 at 3:27 PM, Vman wrote: > > > > I created database using the 'python manage.py sycdb' >

Re: Redirects on HTTPS

2009-10-27 Thread zweb
for me this worked SetEnvIf X-Forwarded-Proto https HTTPS=1 as specified in this thread http://groups.google.com/group/django-users/browse_thread/thread/cdece5ef2e7fd280 On Oct 26, 6:01 am, "Tim Sawyer" wrote: > I still can't get this to work (original thread > athttp://groups.google.com/

Re: using ORM Parent->child rendering inside a template

2009-10-27 Thread Juan Hernandez
On Tue, Oct 27, 2009 at 3:39 PM, Ramiro Morales wrote: > > Have you actually tried doing so? LOL!!! somehow I didn't do it correctly!! That's the way to do it! Thanx :D --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google G

Re: Versionable Models?

2009-10-27 Thread Javier Guerra
On Tue, Oct 27, 2009 at 1:54 PM, Todd Blanchard wrote: > I'm starting a project where some models need to be fully versioned. check django-reversion: http://code.google.com/p/django-reversion/ -- Javier --~--~-~--~~~---~--~~ You received this message because y

Re: Error

2009-10-27 Thread Gabriel .
On Tue, Oct 27, 2009 at 3:27 PM, Vman wrote: > > I created database using the 'python manage.py sycdb' > > then proceeded to 'python manage.py sql bookmarks' > > and i receive this error: > Error: App with label bookmarks could not be found. Are you sure your > INSTALLED_APPS settings is correct?

Re: using ORM Parent->child rendering inside a template

2009-10-27 Thread Ramiro Morales
On Tue, Oct 27, 2009 at 4:57 PM, Juan Hernandez wrote: > but, what if i wanted to go the other way as I can do it in python/django with > "_set"?? Something like {{ x.comment_set.count }} (being x a post iterator). > Have you actually tried doing so? > I can do it with python and I can get the

Versionable Models?

2009-10-27 Thread Todd Blanchard
Total django noob here. Rails/PHP/WebObjects refugee here. I'm starting a project where some models need to be fully versioned. IOW, record update is forbidden - every save to a changed model should result in a new record with a new version number or timestamp along with identity pulled fro

Error

2009-10-27 Thread Vman
I created database using the 'python manage.py sycdb' then proceeded to 'python manage.py sql bookmarks' and i receive this error: Error: App with label bookmarks could not be found. Are you sure your INSTALLED_APPS settings is correct? I go to Settings py and the INSTALLED_APPS is 'django_book

using ORM Parent->child rendering inside a template

2009-10-27 Thread Juan Hernandez
Hey there people: Let's say that I have these models == class Post(models.Model): user = models.ForeignKey(User) category = models.ForeignKey(Categories) title = models.CharField(max_length=50) post = models.TextField() date = models.DateTimeField(auto_now_add=True) d

Re: Why does Django think my browser doesn't except cookies?

2009-10-27 Thread Grant Livingston
I wouldn't be surprised if this is a bug in IE =/ --~--~-~--~~~---~--~~ 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

Why does Django think my browser doesn't except cookies?

2009-10-27 Thread philip.bar...@impaerospace.com
This morning I started running a project using Django 1.03 on Apache2 on Ubuntu 9.10, which is running as a Virtual Machine on a Windows XP system. I have run the same Django project successfully on a Ubuntu 9.10 system. However, the VM version insists that IE does not accept cookies. Firefox an

Re: generic views 404 error

2009-10-27 Thread Brian McKeever
More info is needed. Could you post your urls? On Oct 25, 8:39 pm, Ross wrote: > I just neared the end of the poll application and converted everything > to generic views according to the tutorial. Once I started up the > server though, I could only find my admin page. I tried using the > newly

Expanding Sites Framework

2009-10-27 Thread John D Giotta
I'm working on a mostly admin based application and this is the first time I've leveraged the sites framework. However, I'd like to expand on the site model... add more information... and even be able to upload files. Is it a simple process to modify the Site models? I tend to want to steer clear

Re: How to lay out multiple apps sharing the same model? (newcomer)

2009-10-27 Thread Brian McKeever
Generally, I'd create a different app for different functionality. IE one for authentication related stuff, another for the forum, another specific to the website. It's really a matter of style though. You can put the model definitions most anywhere. You might want to check out the sites framewo

Re: Foreign Key Admin UI Error (from a new user)

2009-10-27 Thread David Nolen
Ahh I see now I needed to define ArtBaseModel as an abstract base class. On Oct 24, 7:06 pm, David Nolen wrote: > Thanks for the reply. The base model just looks like this: > > class ArtBaseModel(models.Model): >     created = models.DateTimeField() # models.DateTimeField(editable=False) >     m

Re: Foreign Key Admin UI Error (from a new user)

2009-10-27 Thread David Nolen
So the issue seems to stem from the fact that both Work and Title inherit from the same model. Is this a known issue? Is there something I can do to ArtBaseModel to make this work? I would like all my models to have created/modified. Thanks again, David On Oct 24, 7:56 am, Tom Evans wrote: > On

How to lay out multiple apps sharing the same model? (newcomer)

2009-10-27 Thread zimnyx
Hi! I got idea of three completely different, large websites, which share the same business model and same database. Saying "completely different", I don't mean just different look. These websites are something like: administarion tool, user services, etc. They are large and have completely diffe

Re: Trouble on Apache: unable to open database file

2009-10-27 Thread John D Giotta
It worked, but I also discovered a relative path to the database file in the settings.py was a bad move. Changing it to absolute was the second part of the solution. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dj

Re: update() (for bulks) is a atomic operation?

2009-10-27 Thread wancharle sebastiao quirino
thanks, A friend recommended the django-debug-toolbar but did not pay much attention. Now I have a reason. Thanks 2009/10/25 Mikhail Korobov > > Yes, it's a single query. > > Take a look at django-debug-toolbar. It can display all SQL queries > that was executed during request/response so you'

Re: object.save() executes a .filter() somewhere

2009-10-27 Thread Gerard
It works when I disable "use_for_related_fields = True". Would it be safe to disable this and simply manage the reverses myself? Regards, Gerard. PS: Sorry for the spam :) Gerard wrote: > Looking at the trace, the filter executed without a user is this one: > > File "/usr/lib/python2.5/site

Re: object.save() executes a .filter() somewhere

2009-10-27 Thread Gerard
Looking at the trace, the filter executed without a user is this one: File "/usr/lib/python2.5/site-packages/django/db/models/base.py" in save_base 470. manager.filter(pk=pk_val).extra(select={'a': 1}).values('a').order_by())): Overwriting save_base feels like I'm div

Re: Unit testing form validation issue

2009-10-27 Thread Chris Allen
Ended up populating the test database with fixtures via .json dumps. Thank you very much for your help. --- Chris On Oct 26, 6:19 pm, Karen Tracey wrote: > On Mon, Oct 26, 2009 at 4:12 PM, Chris Allen wrote: > > > Anyone have any experience with forms (ModelMultipleChoice fields and > > forei

Re: Caching performance regression between django 1.0 and django 1.1.1

2009-10-27 Thread mt
On Oct 22, 12:46 pm, Russell Keith-Magee wrote: > On Thu, Oct 22, 2009 at 4:38 PM, mt wrote: > > > On Oct 19, 1:08 pm, Russell Keith-Magee > > wrote: > >> On Mon, Oct 19, 2009 at 6:52 PM, mt wrote: > > >> > Hi All, > >> > I recently upgraded a high traffic site from django 1.0 to django > >>

object.save() executes a .filter() somewhere

2009-10-27 Thread Gerard
Hi all, I'm totally in the dark atm. I save an object in the following way: if form.is_valid(): order = form.save(commit=False) order.owner = request.user order.save() # << breaks I get the following error: AttributeError at /order/2/edit 'ValuesQuerySet' object

Re: Discovering the ip/port in use by runserver

2009-10-27 Thread tow
On Oct 27, 1:53 pm, Christian Joergensen wrote: > > You could probably just read it from sys.argv ;) ;-) That had crossed my mind. I think it might actually be the most robust way! You have to do a bit of fiddling to make sure you don't grab an option, and that you don't do this if you're not u

Re: Discovering the ip/port in use by runserver

2009-10-27 Thread tow
Thanks. I'd seen that, and that does indeed work if you're in a view & you've got access to a request object. I was hoping that there was another way, useful when you didn't have a request object to hand. I'm beginning to think the answer is "no" though. Toby On Oct 27, 1:14 pm, Karen Tracey w

Re: models.py - __unicode() - Access related object's attributes?

2009-10-27 Thread Daniel Roseman
On Oct 27, 2:49 pm, Victor Hooi wrote: > heya, > > In my models.py, I've got an "Address", as well as an abstract "Trip" > object, and then a "ToTrip", and "ReturnTrip" object that derive from > that. ToTrip and ReturnTrip both contain references to two Address > objects (models.ForeignKey). > >

satchmo SSLRedirectMiddleware for /admin not working with 1.1.1

2009-10-27 Thread captainmish
Hello First apologies for cross-posting, this is also a discussion in satchmo-users. I am trying to secure admin urls using satchmo's (0.9) SSLRedirectMiddleware, using HTTPS_PATHS in settings. It works perfectly in django 1.1, but breaks in 1.1.1 with "Django can't perform a SSL redirect while

Django/Jython doesn't work on Google App Engine

2009-10-27 Thread Olli Wang
Hi, I successfully created a WAR file which was able to run on Apache Tomcat with no problem. But when I uploaded it to the Google App Engine, it shows me a error message like this: Could not initialize class org.python.modules.thread.thread RequestURI=/ Caused by: java.lang.NoClassDefFoundErro

Re: Login over HTTPS

2009-10-27 Thread Tom Evans
On Tue, 2009-10-27 at 07:58 +0200, Jani Tiainen wrote: > I'm trying to get Django to make authentication (namely username + > password) to be transferred over HTTPS. But rest of the site is still on > plain old HTTP. > > How this can be done? I've very little success and google didn't gave > m

Re: Login over HTTPS

2009-10-27 Thread Gerard
Good point on the psycho part. And my mistake, I saw a page once where the inline from submit was just SSL and I was thinking about that. The answer partially rests on your webserver, because Django itself (as far as I know) doesn't distinct between the two. An approach could be to have your w

models.py - __unicode() - Access related object's attributes?

2009-10-27 Thread Victor Hooi
heya, In my models.py, I've got an "Address", as well as an abstract "Trip" object, and then a "ToTrip", and "ReturnTrip" object that derive from that. ToTrip and ReturnTrip both contain references to two Address objects (models.ForeignKey). class Address(models.Model): description = models.

Re: Django templates, break a for after an if

2009-10-27 Thread Nicu Marcu
Thanks for help, very cool stuff, work perfect. 2009/10/26 Tom Evans > > On Mon, 2009-10-26 at 15:54 +0200, Jani Tiainen wrote: > > NMarcu kirjoitti: > > > Hello all, > > > > > >I want to do something like this: > > > > > > {% for u in users %} > > > {% for su in superu %} > > >

Re: query with field name only known at runtime

2009-10-27 Thread James Harrison Fisher
a-HA. Simple. I had a suspicion this would be a python solution rather than Django-specific solution. Thanks! On Oct 27, 11:14 am, Daniel Roseman wrote: > On Oct 27, 10:48 am, James Harrison Fisher > wrote: > > > > > Hi, > > > I've recently come across something that's stumped me.  I am crea

Re: Discovering the ip/port in use by runserver

2009-10-27 Thread Christian Joergensen
tow wrote: > I know it uses whatever I specified. What I'm asking is, inside the > django process, is it possible to find out what I specified? > > ie, if I did "./manage.py runserver" - how do I find out, from a view > inside the django process, that I'm running on localhost:8000? > > if I did

Re: efficiently deleting content based on how old it is

2009-10-27 Thread Chris Withers
Peter Bengtsson wrote: >> Yep, that's prettymuch what I ended up writing. Wow, Django's ORM >> expressions are ugly compared to SQLAlchemy ;-) >> > Then just > import sqlalchemy Yes, because that obviously provides a drop-in replacement for all users of Django's ORM ;-) > If the db is a legacy

Re: Discovering the ip/port in use by runserver

2009-10-27 Thread Karen Tracey
On Tue, Oct 27, 2009 at 8:13 AM, tow wrote: > > Clearly I know what I did, I'm wondering if I can get a view inside > the django process to know what I did. > > > http://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.META lists SERVER_PORT among the typical headers.

Re: Adding button to admin change form

2009-10-27 Thread Aaron
On Oct 26, 5:06 pm, Mikhail Korobov wrote: > You should override change_form.html template and save it as > > /your_project/templates/admin/your_app/change_form.html > > or > > /your_project/templates/admin/your_app/your_model/change_form.html Thank you. I ended up creating my own tag to repace

Re: Discovering the ip/port in use by runserver

2009-10-27 Thread tow
I know it uses whatever I specified. What I'm asking is, inside the django process, is it possible to find out what I specified? ie, if I did "./manage.py runserver" - how do I find out, from a view inside the django process, that I'm running on localhost:8000? if I did './manage.py runserver ot

Re: Discovering the ip/port in use by runserver

2009-10-27 Thread Larrik Jaerico
Perhaps he is looking for a way to get the values passed to runserver, then? On Oct 27, 3:17 am, Jani Tiainen wrote: > tow kirjoitti: > > > If you're running your django server through ./manage.py runserver, is > > there a way, from within the django process, to discover which  IP > > address an

Django SVN 1.2_pre_alpha CSRF login problems and doc typos

2009-10-27 Thread davor
Hi, I've just updated to latest trunk, and now site login does not work cos of CSRF that has been enabled in all contrib apps. I should put {% csrf_token %} in login forms (i use custom template for auth login) on plenty of sites that usually don't use CSRF and some of them don't use contrib.adm

Re: query with field name only known at runtime

2009-10-27 Thread Daniel Roseman
On Oct 27, 10:48 am, James Harrison Fisher wrote: > Hi, > > I've recently come across something that's stumped me.  I am creating > a 'shortcut' function for easier creation of add/edit views.  This > function needs to make a query on a model in the simple form: > > model.objects.get(field_name=v

query with field name only known at runtime

2009-10-27 Thread James Harrison Fisher
Hi, I've recently come across something that's stumped me. I am creating a 'shortcut' function for easier creation of add/edit views. This function needs to make a query on a model in the simple form: model.objects.get(field_name=value) where the variables "model", "field_name", and "value"

Re: Login over HTTPS

2009-10-27 Thread Jani Tiainen
Technically yes. From psychological point you need to provide SSL for login screen already so end user gets visual feedback that he's in secure transaction and certificate is validated. So yes, it should be "secure login" page, that forwards user back to nonsecure pages after login is succes

Re: No such table error when using threads

2009-10-27 Thread BlueBird
On 24 oct, 21:52, BlueBird wrote: > Hi, > > I've got a strange behavior. My application is split between a web > frontend and a backend which use the DB to exchange tasks and results. > > The problem is with the backend. It's just a regular program, > accessing the DB to fetch tasks, completing

Re: Sharing data between two Django sites

2009-10-27 Thread Graham Dumpleton
On Oct 27, 9:18 pm, Benjamin Wohlwend wrote: > Hi, > > I develop and maintain several Django sites that are all part of the > same organization. Some of them are more of the Intranet-type (e.g. > only for internal use), others are publicly accessible (e.g. a CMS). > My problem is that certain

Re: Sharing data between two Django sites

2009-10-27 Thread Thomas Guettler
Hi, we use one postgres database, and several postgres database users. None of them is database superuser. We have a wrapper around manage.py which asks for the database owner password if commands like syncdb are called. And we GRANT privileges the the database users. The code is hosted on two

Re: machinetags with namespaces and values, a ready-to-use branch

2009-10-27 Thread Gregor Müllegger
On Oct 15, 11:27 am, Sam Lai wrote: > I haven't looked at your code yet (I will soon), but I'm just curious > if your changes have had any impact on performance? I remember that > when I set out to implement some of this code, I had issues with it > being efficient when there are larger sets of t

Sharing data between two Django sites

2009-10-27 Thread Benjamin Wohlwend
Hi, I develop and maintain several Django sites that are all part of the same organization. Some of them are more of the Intranet-type (e.g. only for internal use), others are publicly accessible (e.g. a CMS). My problem is that certain data from the Intranet sites have to be displayed on a publi

Re: Login over HTTPS

2009-10-27 Thread Gerard
I think that technically only your form submit should be posted to a SSL based url and the rest doesn't have to. Which shouldn't be so hard. Just setup the 'post to' url in the template (under: form action="" ) or define in the view method where the form is initiated just before rendering. Thi

Re: Do reverse relations eventually kill performance?

2009-10-27 Thread Gerard
Hi Manfre, Tried subclassing the Manager but didn't know if overwriting get() and filter() would be enough. Thanx to your email I now realize it is :) .. while in the process I ended up making a extra failsafe net, with a tiny middleware tool I wrote: http://www.gerardjp.com/2009/10/26/django

Admin not looking in templates/admin/flatpages/flatpage for change_form.html

2009-10-27 Thread Nev
Hello, I have done the tinymce thing for my flatpages, but it only works if I put my change_form.html under templates/admin. If I put it under templates/admin/flatpages or templates/admin/flatpages/flatpage it is ignored. I am using django 1.1.1. Can anyone tell me what I've missed. Do I have to

Re: Discovering the ip/port in use by runserver

2009-10-27 Thread Jani Tiainen
tow kirjoitti: > If you're running your django server through ./manage.py runserver, is > there a way, from within the django process, to discover which IP > address and port are in use? It doesn't use anything it just listens whatever you specified at startup. Default is any local address (loc