Re: Should I start to use Mako from beginning?

2010-06-30 Thread Kai Diefenbach
Hi, On 2010-06-30 17:34:25 +0200, AllenDang said: I'm new to django, it's amazing! But after I did some research from google, I found out that some people say that the default template engine of django is not that good to use, they recommend Mako as a replacement. So I'm wondering if I should

Re: Signal emitted after successful login?

2010-06-30 Thread derek
On Jun 29, 9:51 pm, Daniel Hilton wrote: > On 29 June 2010 20:07, Andy McKay wrote:> On 2010-06-29, > at 10:48 AM, tiemonster wrote: > > >> Is a signal emitted after a successful login? I need to hook a > >> particular piece of code into that point in the application. > > One easy way is to wrap

Re: change displayed name of users object

2010-06-30 Thread derek
On Jun 29, 7:43 pm, Jacob Fenwick wrote: > Thanks for the link Derek. > > I don't think it quite does what I want. > > I guess I should have been more specific. > > I want to change how the Users object is displayed in the Django admin. > > This is a one line change in the Django code, but I would

Re: Should I start to use Mako from beginning?

2010-06-30 Thread Ramdas S
On Thu, Jul 1, 2010 at 10:58 AM, Alexander Jeliuc wrote: > Default template engine is very nice... and more than enough. > > > On Thu, Jul 1, 2010 at 8:22 AM, Kenneth Gonsalves wrote: > >> On Wednesday 30 June 2010 21:04:25 AllenDang wrote: >> > I'm new to django, it's amazing! But after I did som

Re: Should I start to use Mako from beginning?

2010-06-30 Thread Alexander Jeliuc
Default template engine is very nice... and more than enough. On Thu, Jul 1, 2010 at 8:22 AM, Kenneth Gonsalves wrote: > On Wednesday 30 June 2010 21:04:25 AllenDang wrote: > > I'm new to django, it's amazing! But after I did some research from > > google, I found out that some people say that t

Re: Should I start to use Mako from beginning?

2010-06-30 Thread Kenneth Gonsalves
On Wednesday 30 June 2010 21:04:25 AllenDang wrote: > I'm new to django, it's amazing! But after I did some research from > google, I found out that some people say that the default template > engine of django is not that good to use, they recommend Mako as a > replacement. it is not wise to liste

Re: Django on multiple servers? (Deployment Problem)

2010-06-30 Thread Paul Gully
another problem: im running this app on top of another page, so say www.example.com is the site, it wont allow me to access just any other page if the app is at the root of the site (www.example.com/myapp would work, but www.example.com/siteinfo wouldnt (unless i suppose i wrote a url template for

Re: Django on multiple servers? (Deployment Problem)

2010-06-30 Thread Paul Gully
Ok, again. i feel like a question whore, but i think this should be the last thing. I fixed the database problem for the main app, but the admin site isnt working at all, im getting an internal server error (500) when i try to access it. halp? On Wed, Jun 30, 2010 at 10:24 PM, Paul Gully wrote:

Django on multiple servers? (Deployment Problem)

2010-06-30 Thread nano
Ok, so i've written my Django app on computer A with the dev server, and have pushed it to server B, running apache (implemented with mod_wsgi). The server also has Django installed, but cannot find the settings for some reason. what i've gathered is that because i've never run the 'makeproject' co

Re: Django on multiple servers? (Deployment Problem)

2010-06-30 Thread Paul Gully
Oh wow. ok, so i solved that problem (it was just the sys.path thing in the wsgi file. easy fix) ,but now django is unable to open the database files to render the URLs. im using SQLite, so again, i assume the problem is that this project isn't 'native' to the computer, however that doesn't help me

Newby Question: template system doesn't render form html

2010-06-30 Thread Gene
When I put a form into my template it comes back blank. Does anyone know why? what is in my template what I get in my browser -- 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..

Re: using django for google appengine, noob to both.

2010-06-30 Thread Malcolm MacKinnon
You should look at this site: http://www.allbuttonspressed.com/projects/django-nonrel I recommend it over any other django appengine ORM I've tried. I think it can help you with some of your issues. The blog and discussion group is very act

Re: Should I start to use Mako from beginning?

2010-06-30 Thread AllenDang
Thanks for your helpful feedback, both Bill and Euan. You just make up my mind. I'll start building my site with entire original django now. -- 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...@google

Re: using django for google appengine, noob to both.

2010-06-30 Thread Felippe Bueno
You can... but there are some limitations. For example, django's admin site, don't work using appengine You need to use db.Model, You need to use google.appengine.ext.db.djangoforms to validate forms... And some more Btw, I think its better we discuss this using private messages, or at app-

Re: using django for google appengine, noob to both.

2010-06-30 Thread Sector7B
interestingly though, i guess my problem is still that i'm not able to do the django way of things, which I thought was idea behind doing it like this: http://code.google.com/appengine/articles/appengine_helper_for_django.html On Jun 30, 7:30 pm, Sector7B wrote: > i was just coming to write that,

Re: using django for google appengine, noob to both.

2010-06-30 Thread Sector7B
i was just coming to write that, lol. I opened up the code and read it! What a novel approach. Thanks for pointer, i'm going to try again. On Jun 30, 7:17 pm, Felippe Bueno wrote: > BaseModel extends db.Model :) > > http://stackoverflow.com/questions/1720157/diference-between-appengin... > > >

Re: using django for google appengine, noob to both.

2010-06-30 Thread Felippe Bueno
BaseModel extends db.Model :) http://stackoverflow.com/questions/1720157/diference-between-appengine-django-basemodel-and-db-model On Wed, Jun 30, 2010 at 8:09 PM, Sector7B wrote: > Thank you for your reply. I gave it a try, and it didn't seem to > work. The helper project (according to the

Re: using django for google appengine, noob to both.

2010-06-30 Thread Sector7B
Thank you for your reply. I gave it a try, and it didn't seem to work. The helper project (according to the introductory article) has me using their "BaseModel", which I think is supposed to revert me back to using Django code. However there seems to be very little written beyond that article, a

Re: Proper approach to updating model object with 100 attributes.

2010-06-30 Thread Ray Cote
Thanks for everybody's comments. I ended up using the setattr method and, since I always know the data I have is a subset of the data in the model, that works wonderfully. --Ray - Original Message - From: "euan.godd...@googlemail.com" To: "Django users" Sent: Wednesday, June 30, 201

Re: DATABASE_ROUTERS in settings.py results in Internal Server Error

2010-06-30 Thread thusjanthan
Hi, If your project is named myproject and your app is named myapp where the router is contained. Then you need to set it to the following and you need to include the Classname as well. So if your AppRouter is like this which is in the directory myproject.myapp: AppRouter.py: Class Router(object)

does QuerySet delete delete the objects by their primary key?

2010-06-30 Thread thusjanthan
Hi, I did a query on an object using their "non" primary keys such that: a = Topic.objects.filter(topic='Politics') topic is not a primary key. suppose topicID is primary key. When I run: a.delete() the SQL that is executed is: DELETE FROM 'Topic' WHERE topicID in (1) my problem is a littl

Re: LAMPP + Django on Fedora 13 Linux

2010-06-30 Thread jlighthouse
Thank you Matthias! I agree. I will only stop LAMPP, because my php project needs to be supported and is already configured for LAMPP. Now I'm going to install apache and mysql from scratch. Kostia -- You received this message because you are subscribed to the Google Groups "Django users" gro

Re: using django for google appengine, noob to both.

2010-06-30 Thread Felippe Bueno
I think (THINK) you problem is with the db.Model Take a look at http://code.google.com/appengine/docs/python/datastore/queryclass.html#Query_filter You will see that db.Model don't have the filter method, db.Quer

using django for google appengine, noob to both.

2010-06-30 Thread Sector7B
Hi, I'm using django on google appengine using this: http://code.google.com/appengine/articles/appengine_helper_for_django.html So I have my models, and I can load my pages and templates, and started to do some rudimentary object creates and gets inside the shell (python manage.py shell) and my vi

filter_horizontal not work

2010-06-30 Thread Roldyx
I am a new Django User. I am doing an aplication web. My problem is the next: When I put (admin.py) class FarmAdmin(admin.ModelAdmin): filter_horizontal = ('server',) ===models.py class Farm(models.Model): farm_id = models.IntegerField(primary_key=True) name = models.CharField(max_l

Fields-granularity permission

2010-06-30 Thread Alban
Hi all, I would like to obtain views (html) which are different according user permissions. Fields are displayed or not according this permissions both in edition mode and modification mode. After a few days to think about how to implement this in django, I'm still skeptical. In django (even wi

DATABASE_ROUTERS in settings.py results in Internal Server Error

2010-06-30 Thread Michael
I tried to configure a database router according to http://docs.djangoproject.com/en/dev/topics/db/multi-db/#an-example. All my attempts lead to the Django project outputing "Internal Server Error" generic message with no further info. If my project is named 'myproject' and my app named 'myapp' h

Re: LAMPP + Django on Fedora 13 Linux

2010-06-30 Thread Matthias Runge
On 30/06/10 17:48, jlighthouse wrote: Hi guys, I have been using Fedora 13 and LAMPP (appachefriends.org) to handle up my Joomla php development. I have Eclipse installed with PyDev module, django, python installed altogether on my Linux system. I would like to use phpmyadmin with Django, actual

Re: Load Different Views at same 'browser view'

2010-06-30 Thread Desproposito
Thanks for the answers. However i can't see the way of doing what I want with the template tags or pinax. I have read all the tags, and the pinax documentation and i couldn't find anything. On 30 jun, 05:25, Venkatraman S wrote: > On Wed, Jun 30, 2010 at 6:32 AM, Desproposito wrote: > > I've

Re: LAMPP + Django on Fedora 13 Linux

2010-06-30 Thread Matías Iturburu
There are a little misunderstanding in your posts. You don't need apache at all for developing using django, even mysql is optional. I'd suggest you to read the tutorial ( http://docs.djangoproject.com/en/dev/intro/tutorial01/) and then come back to some of the questions you ask below. Best regard

Re: cleaning html with bleach

2010-06-30 Thread shacker
On Jun 30, 12:00 am, Sam Lai wrote: > Nice find - I did pretty much the same thing, but using lxml.Cleaner. > This seems more configurable; I'm probably going to change mine over > to this instead. I needed to allow public rich text input on bucketlist.org so had to sanitize input carefully, and

expressions in values()

2010-06-30 Thread dmitry b
Hi, I have the following query: AnalyzedFile.objects.filter(bug_signature__bug_condition__tracked_change=cr).values("scm__path") In other words, the result is a list of AnalizedFile.scm.path values. I'd like to change the query so that the returned value is a combination of two fields: scm.path

Re: LAMPP + Django on Fedora 13 Linux

2010-06-30 Thread jlighthouse
That is true, phpmyadmin is not for Django. It is cool if I can find the similar web interface for mysql database. I do not use any php projects. I use only the python one empty project, that just had been created in Eclipse. It is essential for me to connect Django to already installed LAMPP, be

Re: LAMPP + Django on Fedora 13 Linux

2010-06-30 Thread euan.godd...@googlemail.com
I think you're maybe a bit confused about what exactly LAMPP provides. If you're going to use phpmyadmin, you might want to re-think going for Django in the first place. Django provides a much more tailored admin interface than phpmyadmin will give you (although the latter is great for custom SQL,

Re: "View on Site" for instance with Many-To-Many relation to the Site model

2010-06-30 Thread Sam
tl;dr version: admin "view on site" link returns the first Site associated with a model, rather than the current Site. Is this correct? It seems that it should return the current site (if it is picking one arbitrarily) -Sam On Jun 29, 11:19 pm, Sam wrote: > Hello, > > I'm using a model with a m

LAMPP + Django on Fedora 13 Linux

2010-06-30 Thread jlighthouse
Hi guys, I have been using Fedora 13 and LAMPP (appachefriends.org) to handle up my Joomla php development. I have Eclipse installed with PyDev module, django, python installed altogether on my Linux system. I would like to use phpmyadmin with Django, actually mysql with Django. Thus, considering

Re: Should I start to use Mako from beginning?

2010-06-30 Thread Bill Freeman
People who already know Mako probably prefer Mako. But my opinion is that Django templates are just fine (though I admit that I've never used Mako). But if you start with a system that isn't plugged in by default, you've steepened your learning curve. When something doesn't work as expected, is

Re: Should I start to use Mako from beginning?

2010-06-30 Thread euan.godd...@googlemail.com
If you're going to use Mako and SQLAlchemy I'd use Pylons or repoze.bfg rather than trying to crowbar them into Django. Django's templating engine and ORM are used on many high volume sites without any issues of scalability, so if you're keen to learn the rest of Django I'd stick to that. On the

Should I start to use Mako from beginning?

2010-06-30 Thread AllenDang
I'm new to django, it's amazing! But after I did some research from google, I found out that some people say that the default template engine of django is not that good to use, they recommend Mako as a replacement. So I'm wondering if I should start learning and using Mako from beginning? Frankly

Re: ManyToMany container with templating

2010-06-30 Thread Tom Evans
On Wed, Jun 30, 2010 at 4:15 PM, Rishtastic wrote: > Bump? > > Sorry guys - need some help with this. > > On Jun 29, 5:27 pm, Rishtastic wrote: >> Hi all, >> >> I'm trying to do >> >> foo is a User auth object >> comments.readers is a ManyToMany field that links back to the User >> >> I can itera

Re: ManyToMany container with templating

2010-06-30 Thread Rishtastic
Bump? Sorry guys - need some help with this. On Jun 29, 5:27 pm, Rishtastic wrote: > Hi all, > > I'm trying to do > > foo is a User auth object > comments.readers is a ManyToMany field that links back to the User > > I can iterate just fine by using > {% for foo in comments.readers.all %} > > {%

Re: Proper approach to updating model object with 100 attributes.

2010-06-30 Thread euan.godd...@googlemail.com
The frozenset wasn't any commentary on your approach or speed of parsing, I just like to use them where-ever possible. My only concern with your approach was that you were expecting every field on the model to be in the dictionary. Looping over the dictionary's items and ignoring any fields that a

Re: Proper approach to updating model object with 100 attributes.

2010-06-30 Thread Tim Chase
I'd stick to setattr and maybe verify that the key in the dictionary is one of the model's fields. I think there is a method on _meta called get_all_field_names. I've used this before to validate such actions. If that's the case, you can tweak the above to something like for name in obj._me

Ignored LANGUAGE_CODE !!

2010-06-30 Thread tonnzor
I found that Django completely ignore the defined language code in all cases except "runserver" and "runfcgi". I was very surprised when discovered that cool i18n doesn't work neither in my daemon tasks (publish information at given time) using Celery nor in console! Every time this lead "en-us"

deployment problem

2010-06-30 Thread kakarukeys
I tried to deploy a simple web app I wrote in Django and ran into problem with user authentication. On production server, the following steps didn't work like expected (on development server). "log in using a test user account, access a restricted page." it shows login required error message, th

Re: Proper approach to updating model object with 100 attributes.

2010-06-30 Thread euan.godd...@googlemail.com
I'd probably be a bit more cautious, since get_all_field_names gets foreign keys and all sorts and the field might not be in the dictionary. I'd suggest: # Make a frozenset of the fields for fast access: allowed_fields = frozenset(obj._meta.get_all_field_names()) for field, value in dictionary_o

Re: Proper approach to updating model object with 100 attributes.

2010-06-30 Thread Tim Chase
On 06/30/2010 02:10 AM, euan.godd...@googlemail.com wrote: I think you need to be careful messing with __dict__ as Django turns most fields in descriptors behind the scenes so setting them in the __dict__ could break these. Yeah, that was somewhat my assumption (and thus my caveat). Well, you

Re: how to develop cms on django

2010-06-30 Thread samie
roger that.. thank you. -- 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 optio

Re: how to develop cms on django

2010-06-30 Thread Tom Evans
On Wed, Jun 30, 2010 at 11:10 AM, samie wrote: > i dont have time i need to start development within  a month.. > > plz tell me all those crucial topics that i should learn > There is no magic incantation. I'd start with a python book, and every top level topic in the django documentation: http

Re: how to develop cms on django

2010-06-30 Thread Kenneth Gonsalves
On Wednesday 30 June 2010 15:40:20 samie wrote: > > Everything or almost. > > i dont have time i need to start development within a month.. > > plz tell me all those crucial topics that i should learn > 1. python 2. css 3. html 4. javascript 5. Database design 6. django installation, set up an

Re: how to develop cms on django

2010-06-30 Thread samie
On Jun 30, 1:58 pm, bruno desthuilliers wrote: > On 29 juin, 12:41, samie wrote: > > > 1 more query.. > > > what are important that i shld. learn in python and in django to > > develop my cms.. > > Everything or almost. i dont have time i need to start development within a month.. plz tell

Re: cleaning html with bleach

2010-06-30 Thread Sam Lai
Nice find - I did pretty much the same thing, but using lxml.Cleaner. This seems more configurable; I'm probably going to change mine over to this instead. Generally the rule with script injection is to scrub and filter on output, because that's the last line of defense. However, for situations li

Re: Parameters

2010-06-30 Thread Sam Lai
You need to serialize those variables and deliver them to the client to store as a cookie. That way, when a call to draw_graph is made, it will receive the cookie as part of the request, and you can get the parameters. If there is too much data, you should write those variables to the database, an

cleaning html with bleach

2010-06-30 Thread Tor Nordam
I'm developing a blog application in django, and I've been looking into ways to clean the input which will allow safe html tags, while removing all the evil stuff. I came across the tool bleach ( http://github.com/jsocol/bleach ), which seems to be easy to use. I was just wondering if anyone has a

Re: how to develop cms on django

2010-06-30 Thread bruno desthuilliers
On 29 juin, 15:32, derek wrote: > If you don't want to build everything from scratch, you may want to > look at:http://pinaxproject.com/ I don't think it's the best approach for a complete beginner. You need a good working knowledge of both Python and Django to make sense and good use of somethi

Re: how to develop cms on django

2010-06-30 Thread bruno desthuilliers
On 29 juin, 12:41, samie wrote: > 1 more query.. > > what are important that i shld. learn in python and in django to > develop my cms.. Everything or almost. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: how to develop cms on django

2010-06-30 Thread bruno desthuilliers
On 29 juin, 12:29, samie wrote: > sir i am a beginner in python and django.. > > i want develop a content management system using django.. > > plz help me wht shld i do from where shld i start.. I think the very first thing to do would be to avoid the sms style. > i am learning python from googl

Re: Proper approach to updating model object with 100 attributes.

2010-06-30 Thread euan.godd...@googlemail.com
I think you need to be careful messing with __dict__ as Django turns most fields in descriptors behind the scenes so setting them in the __dict__ could break these. I'd stick to setattr and maybe verify that the key in the dictionary is one of the model's fields. I think there is a method on _meta

Re: Disabling the use of certain template tags

2010-06-30 Thread euan.godd...@googlemail.com
I'm not sure whether you could define tags with these names yourself that do nothing (or a safe version of what Django allows). I suspect Django might not allow this and give a name clash. Alternatively you could parse any such tags out of the user defined templates before passing them to the temp