Re: simplelazyobject breaks code

2009-10-19 Thread Eric Holscher

Went ahead and filed a ticket for this. If you would chime in with
your example it probably wouldn't hurt, but I will link to this thread
as well.

http://code.djangoproject.com/ticket/12060

Cheers,
Eric
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django methodologies and best practices

2009-10-19 Thread Mike Ramirez
On Monday 19 October 2009 18:11:38 Sam Lai wrote:
 
> I am tempted to ask a related question though - what do people use to
> plan out their projects (for those that do :)? Large sheets of paper,
> diagramming software (e.g. Visio), mindmaps, plain old text files...
> 
> (Feel free to tell me to look at another thread if this has been asked
>  before :)
> 

Well, I've used tetex and latex, using lyx, (don't ever leave home without it 
if you're heavy into latex and not the good stretchy kind), to generate pdf 
files of the site plans, especially on important/big jobs. 

Normally, for small or my own personal projects I'll just run off a todo 
list/psuedo code in a text file or hand written mainly.  

Mike
- 
They spell it "da Vinci" and pronounce it "da Vinchy".  Foreigners
always spell better than they pronounce.
-- Mark Twain


signature.asc
Description: This is a digitally signed message part.


Re: Django methodologies and best practices

2009-10-19 Thread Sam Lai

2009/10/20 Shakefu :


> So ... I feel slightly guilty about asking this, because I might as
> well be throwing napalm on the stove but which editors/IDEs/whatever
> do people prefer for their Djangoing?

Don't mean to rain on your parade, but this topic's been done to
death, even recently - here's one:

http://groups.google.com/group/django-users/browse_thread/thread/5a753dd76513652b/34b9d89440798750?q=vim=ol;

I am tempted to ask a related question though - what do people use to
plan out their projects (for those that do :)? Large sheets of paper,
diagramming software (e.g. Visio), mindmaps, plain old text files...

(Feel free to tell me to look at another thread if this has been asked before :)

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django methodologies and best practices

2009-10-19 Thread Shakefu

Definitely +1 to Mike's post. Lots of great advice.

I'm ashamed to admit that I'm usually the sort who goes about projects
without any written planning what so ever. Generally I spend some time
forming an idea in my head as to what I'd like and what I want to
implement, but often that gets twisted and distorted in the details
until I'm slogged down in figuring out how to jury rig in a feature
that I should've seen coming but didn't.

I might have to try penciling out the project if only as an exercise
and experiment in trying a slightly more disciplined approach.


So ... I feel slightly guilty about asking this, because I might as
well be throwing napalm on the stove but which editors/IDEs/whatever
do people prefer for their Djangoing?


Personally I've been a long time user of jEdit, just because it
provided just enough for comfortable and quick editing without being
feature rich to the point where I feel like I should be doing things
the IDE's way instead of my own way.

Lately, however I've been learning and using vim and I think I'm
falling in love. I know it's already replaced nano in my toolbox for
any quick edits that I have to do over ssh. I've also been combining
it with screen locally to spend my code editing time in keyboard-
shortcut bliss. I'm a big fan of being able to code for hours without
having to go to a mouse; I don't know what that is, but it just is.
Maybe things are just more fun in a term.


On Oct 19, 11:06 am, Mike Ramirez  wrote:
> On Saturday 17 October 2009 21:55:39 Shakefu wrote:
>
> > So my questions are simple:
>
> > What are your opinions on the best methodologies and practices for
> > developing django apps and projects?
>
> > What sort of planning do you do for an application or project?
>
> I've been thinking about this and first off, I don't think there is a best
> practices for django apps and projects in terms of how you design a website.  
> Which your questions seem to point to.
>
> I think the best practices you're asking for are generic enough that they are
> effective with most web design projects regardless of language/framerowrk.
>
> For example the steps I take are first identify the goal project, then figure
> out what applications are required to make that goal a reality.  At the
> application level, I start with the models and what basic data do I need to
> collect for the app.  Then I go to the forms and create those as needed to
> collect data. Next to the urls and start mapping out urls to the data that
> should be displayed, collected, etc..., then create the basic views.  
>
> At this point the application should take shape and you'll know what it'll
> provide. From this point on, I start looking at what I'm missing in terms of
> the model fields and then decide if I need/want context processors, template
> tags and filters for the data and for data I want to be available regardless
> of the view. In say a gallery app, I'll add in template tags that display
> random images or a list of images, that can be used anywhere in the site.
>
> Then it's on to clean up.  I take these steps per project/app normally.
>
> > What development techniques do you use to help conceptualize an
> > evolving project/app?
>
> > So what works for you? Why? What doesn't work or what stumbling blocks
> > do certain routes present?
>
> Well, I start with drawing up a mock up of the index page layout (the basic
> layout used through out the site). Then write out (psuedocode/flowchart) what
> I think is needed to make the site function per the specs, using the order
> outlined above.
>
> This gives me a great idea of the full scope of the project before I type one
> thing or an image is made and I can minimize the additions of fields in the
> models (mentioned in an earlier email) later in the project.  
>
> What doesn't work for me and is probably the most annoying and most used
> system is to go at it on the fly, with little or no planning or written plans
> before you start to code.  Eventually you'll start to go out of scope and add
> more things within spec, changing the deployment time usually. With a plan, I
> tend to minimize 'scope creep'.  
>
> Outside of this, there are django specific things you should be aware of.
> Someone mentioned in a thread a few days ago (can't find it now) talking about
> two view functions, where you have your view function setup the data for that
> specific view and then a utility function that builds your context, template
> and returns the response.  I think they were putting a middle man between the
> render_to_response shortcut and the actual data gathering/building for the
> view.  To see what I mean, take a look at djangobb it uses a decorator to do
> this.
>
> Djangobb also use a build_form function that takes a form object and returns
> an instance of it, either initialized with post/get data or without it.
>
> In the end most of the best practices with django resort to utilizing the DRY
> philosophy more than 

Re: How to get a queryset?

2009-10-19 Thread adelaide_mike

Thanks Max.  In an ideal world left_connector, right_connector would
be the way to go.  However, I need to account for a cable that, at one
or both ends is split into separate conductors, that go to separate
connectors (thus breaking the rule I had specified.)  Nodes, with a
little embellishment,  allow me to achieve this.  I will investigate
your itertools suggestion.

Mike

On Oct 20, 8:38 am, Max Battcher  wrote:
> adelaide_mike wrote:
> > Hi
> > My models are, essentially :
> > class Cable(models.Model):
> >     cable = models.CharField(max_length=8)
>
> > class Connector(models.Model):
> >     connector = models.CharField(max_length=8)
>
> > class Node(models.Model):
> >     cable = models.ForeignKey(Cable)
> >     connector = models ForeignKey(Connector)
>
> > So, a real world cable can be plugged in to no, one, or two connectors
> > (one at each end).  The Node table describes the junctions between
> > cables and connectors.
>
> > Can I, without resorting to raw SQL, build a queryset that shows
> > connector-cable-connector?
>
> You would have a hard time even accomplishing that in raw SQL with those
> models...  If you have the flexibility to change your models I would try
> something like:
>
> class Connector(models.Model):
>    name = models.CharField(max_length=8)
>
> class Cable(models.Model):
>    name = models.CharField(max_length-8)
>    left_connector = models.ForeignKey(Connector, blank=True, null=True)
>    right_connector = models.ForeignKey(Connector, blank=True, null=True)
>
> This makes your 0, 1, or 2 relationship explicit. I went with the
> left/right distinction as it is an easy "handed" way of describing them,
> but other choices may be more appropriate depending on your usage
> patterns...
>
> Otherwise, your best bet would seem to me to be to use
> Node.objects.all().orderby('cable') and group the
> connector-cable-connector by yourself. Something that I generally find
> useful in situations like that is Python's groupby function from itertools.
>
> --
> --Max Battcher--http://worldmaker.net
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django Admin: DateField (Year and Month) only

2009-10-19 Thread Joshua Russo
I don't have an example of a date field but here is an example of how I
extended the Decimal field in making a Currency field.
http://www.djangosnippets.org/snippets/1527/

In the description there are
also links to the entire series of objects, including an input widget. That
should get you started on the concept of extending fields and widgets.


On Mon, Oct 19, 2009 at 10:40 PM, The Danny Bos  wrote:

>
>
> APologies for my naivety, how would I do that.
> Any examples you can point me toward?
>
> Thanks for the fast reply,
>
>
> d
>
>
>
> On Oct 20, 10:38 am, Joshua Russo  wrote:
> > On Mon, Oct 19, 2009 at 10:28 PM, The Danny Bos 
> wrote:
> >
> >
> >
> > > Hiya,
> >
> > > In the Django Admin for the DateField I only want to display the Year
> > > and Month as select lists. I'll default the day to the 1st every time.
> > > Is this possible?
> >
> > > I want to keep the dates very simple, as I'll be adding many items
> > > from 1900 to now. So using the current DateField calendar in Django
> > > Admin would be an absolute nightmare.
> >
> > > Any ideas?
> >
> > Your best bet is to extend the date form field and input widget.
> >
>

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django Admin: DateField (Year and Month) only

2009-10-19 Thread The Danny Bos


APologies for my naivety, how would I do that.
Any examples you can point me toward?

Thanks for the fast reply,


d



On Oct 20, 10:38 am, Joshua Russo  wrote:
> On Mon, Oct 19, 2009 at 10:28 PM, The Danny Bos  wrote:
>
>
>
> > Hiya,
>
> > In the Django Admin for the DateField I only want to display the Year
> > and Month as select lists. I'll default the day to the 1st every time.
> > Is this possible?
>
> > I want to keep the dates very simple, as I'll be adding many items
> > from 1900 to now. So using the current DateField calendar in Django
> > Admin would be an absolute nightmare.
>
> > Any ideas?
>
> Your best bet is to extend the date form field and input widget.
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django Admin: DateField (Year and Month) only

2009-10-19 Thread Joshua Russo
On Mon, Oct 19, 2009 at 10:28 PM, The Danny Bos  wrote:

>
> Hiya,
>
> In the Django Admin for the DateField I only want to display the Year
> and Month as select lists. I'll default the day to the 1st every time.
> Is this possible?
>
> I want to keep the dates very simple, as I'll be adding many items
> from 1900 to now. So using the current DateField calendar in Django
> Admin would be an absolute nightmare.
>
> Any ideas?
>

Your best bet is to extend the date form field and input widget.

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Help with splicing models to a legacy DB, please

2009-10-19 Thread Joshua Russo
On Mon, Oct 19, 2009 at 8:03 PM, John Handelaar  wrote:

>
> Hello
>
> For reasons I won't bore you with, a Mysql legacy DB *whose schema I
> cannot alter* contains (inter alia) two tables.  I'm trying to write
> an alternative front-end to this DB in Django which would be
> read-only.
>
> tableone has a primary key called tableone_id
>
> tabletwo contains rows which have a 1:1 relationship with equivalent
> rows in tableone, and a column called tableone_id to allow me connect
> them with a JOIN.  It does not, however, have a primary key of its
> own.
>
> It seems obvious to me that these two tables belong in one Model
> definition. How do I define a single model which spans the two tables
> and returns querysets containing all columns from both tables?
>
> a)  With a model manager?  If so, where do I put that manager and are
> there any examples I can steal?
> b)  With custom SQL in the model definition?  If so, again, does
> someone have an example online I can see somewhere?
> c)  Somewhere else?
>

I think your best bet is to create a view to logically combine the tables in
the DB. You can then use the following link that I just stumbled on my self
in another thread on this list. It describes a method for accessing views
via a model.
http://wolfram.kriesing.de/blog/index.php/2007/django-nice-and-critical-article#comment-48425

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Django Admin: DateField (Year and Month) only

2009-10-19 Thread The Danny Bos

Hiya,

In the Django Admin for the DateField I only want to display the Year
and Month as select lists. I'll default the day to the 1st every time.
Is this possible?

I want to keep the dates very simple, as I'll be adding many items
from 1900 to now. So using the current DateField calendar in Django
Admin would be an absolute nightmare.

Any ideas?
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: JOINs with Django ORM

2009-10-19 Thread Joshua Russo
2009/10/19 Tomasz Zieliński 

>
> On 19 Paź, 20:21, Daniel Roseman  wrote:
> >
> > You can't do this in one query with Django's ORM.
> >
> > One way of doing it in two queries might be to get use .annotate() to
> > add the max id of the related objectrevision for each revision, then
> > get all those objectrevisions (untested):
> >
> >objects = Object.objects.all().annotate(revision_id=Max
> > ('objectrevision__id'))
> >objectrevisions = ObjectRevision.objects.filter(id__in=
> > [o.revision_id for o in objects])
> >
>
> I found this solution, but we are talking about thousends of objects,
> so SQL query would be really huge. I' tested it with MySQL Query
> Browser
> and passing ton of ids to `WHERE id IN (...)` clause was causing major
> overhead
> comparing to using JOIN.
>
> Fortunately, in the mean time, I've found a nice solution using SQL
> views:
>
>
> http://wolfram.kriesing.de/blog/index.php/2007/django-nice-and-critical-article#comment-48425
>
> This is not strictly a solution to the problem I asked, but it allows
> to hide SQL under the floor
> and just use Django ORM in everydays work.
>
> Anyway, thank you for confirmation on this limitation, I wasn't sure
> about it.
>

Interesting. I've been wondering how one might tackle accessing views via
models. Thanks for the link.

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



[django-tinymce] Adding a custom toolbar button

2009-10-19 Thread eka

Hi,

Is there any way to achieve this with django-tinymce?

http://tinymce.moxiecode.com/examples/example_20.php

I tried configuring it, but seems to not like the way I pass the
function.

Any clues?
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: How to get a queryset?

2009-10-19 Thread Max Battcher

adelaide_mike wrote:
> Hi
> My models are, essentially :
> class Cable(models.Model):
> cable = models.CharField(max_length=8)
> 
> class Connector(models.Model):
> connector = models.CharField(max_length=8)
> 
> class Node(models.Model):
> cable = models.ForeignKey(Cable)
> connector = models ForeignKey(Connector)
> 
> So, a real world cable can be plugged in to no, one, or two connectors
> (one at each end).  The Node table describes the junctions between
> cables and connectors.
> 
> Can I, without resorting to raw SQL, build a queryset that shows
> connector-cable-connector?

You would have a hard time even accomplishing that in raw SQL with those 
models...  If you have the flexibility to change your models I would try 
something like:

class Connector(models.Model):
   name = models.CharField(max_length=8)

class Cable(models.Model):
   name = models.CharField(max_length-8)
   left_connector = models.ForeignKey(Connector, blank=True, null=True)
   right_connector = models.ForeignKey(Connector, blank=True, null=True)

This makes your 0, 1, or 2 relationship explicit. I went with the 
left/right distinction as it is an easy "handed" way of describing them, 
but other choices may be more appropriate depending on your usage 
patterns...

Otherwise, your best bet would seem to me to be to use 
Node.objects.all().orderby('cable') and group the 
connector-cable-connector by yourself. Something that I generally find 
useful in situations like that is Python's groupby function from itertools.

--
--Max Battcher--
http://worldmaker.net


--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



How to get a queryset?

2009-10-19 Thread adelaide_mike

Hi
My models are, essentially :
class Cable(models.Model):
cable = models.CharField(max_length=8)

class Connector(models.Model):
connector = models.CharField(max_length=8)

class Node(models.Model):
cable = models.ForeignKey(Cable)
connector = models ForeignKey(Connector)

So, a real world cable can be plugged in to no, one, or two connectors
(one at each end).  The Node table describes the junctions between
cables and connectors.

Can I, without resorting to raw SQL, build a queryset that shows
connector-cable-connector?

Thanks for any input.

Mike
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Help with splicing models to a legacy DB, please

2009-10-19 Thread John Handelaar

Hello

For reasons I won't bore you with, a Mysql legacy DB *whose schema I
cannot alter* contains (inter alia) two tables.  I'm trying to write
an alternative front-end to this DB in Django which would be
read-only.

tableone has a primary key called tableone_id

tabletwo contains rows which have a 1:1 relationship with equivalent
rows in tableone, and a column called tableone_id to allow me connect
them with a JOIN.  It does not, however, have a primary key of its
own.

It seems obvious to me that these two tables belong in one Model
definition. How do I define a single model which spans the two tables
and returns querysets containing all columns from both tables?

a)  With a model manager?  If so, where do I put that manager and are
there any examples I can steal?
b)  With custom SQL in the model definition?  If so, again, does
someone have an example online I can see somewhere?
c)  Somewhere else?

Any help gratefully received.

Cheers



John Handelaar

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: JOINs with Django ORM

2009-10-19 Thread Tomasz Zieliński

On 19 Paź, 20:21, Daniel Roseman  wrote:
>
> You can't do this in one query with Django's ORM.
>
> One way of doing it in two queries might be to get use .annotate() to
> add the max id of the related objectrevision for each revision, then
> get all those objectrevisions (untested):
>
>    objects = Object.objects.all().annotate(revision_id=Max
> ('objectrevision__id'))
>    objectrevisions = ObjectRevision.objects.filter(id__in=
> [o.revision_id for o in objects])
>

I found this solution, but we are talking about thousends of objects,
so SQL query would be really huge. I' tested it with MySQL Query
Browser
and passing ton of ids to `WHERE id IN (...)` clause was causing major
overhead
comparing to using JOIN.

Fortunately, in the mean time, I've found a nice solution using SQL
views:

http://wolfram.kriesing.de/blog/index.php/2007/django-nice-and-critical-article#comment-48425

This is not strictly a solution to the problem I asked, but it allows
to hide SQL under the floor
and just use Django ORM in everydays work.

Anyway, thank you for confirmation on this limitation, I wasn't sure
about it.

--
Tomasz Zielinski
http://pyconsultant.eu
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



starting a project in windows xp

2009-10-19 Thread Nick

FYI,

If anyone in general has trouble starting a new project in Windows xp,
this might help you. When I first tried creating a project, I cd'd
into the appropriate directory in a cmd prompt and then typed the path
to the django-admin.py file, then startproject, and the project name.
All this would do is open the django-admin.py file, not actually
execute it.

So, before the path to the django-admin.py file, type the path to
python.exe, a space, and then the path to django-admin.py, then
startproject, then 'project name'.

You have to pass the path to django-admin.py as an argument to
python.exe so it actually executes the file rather than just opening
it.

I hope this helps if it pertains to you.

Nick

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Best way to generate a local file from a models + views ?

2009-10-19 Thread Nicolas Steinmetz

Михаил Лукин a écrit :
> For purpose of generating apache config files I would recommend to use 
> management commands [1], so that you could generate config like this:
> ./manage genconf --server apache2 > /etc/apache2/vhosts.d/myapp.conf
> where genconf is your custom management command.
> 
> [1] http://docs.djangoproject.com/en/dev/howto/custom-management-commands/

Thanks, I'll think about it next time !

Nicolas


--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Best way to generate a local file from a models + views ?

2009-10-19 Thread Nicolas Steinmetz

Daniel Roseman a écrit :

> There's nothing magical about creating a file in Django, it's just
> Python. Assuming you have rights to write to a file, that should work.

It's what I was assuming but looks I did not find the right way to do it :-(

> Is render_to_string producing anything? Can you try printing it to the
> console or the server log?

Sounds weird - now file are generated and are no longer empty. Seems 
week end had some nice effects o_0

Sorry for the noise and thanks for your help,
Nicolas


--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django methodologies and best practices

2009-10-19 Thread kRON

I really like Mike's post and I think it all boils down to what he's
said. There's not much to add except other personal preferences and
delicacies you take onto a new project.
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: python manage.py syncdb error: sqlite3.OperationalError: unable to open database file

2009-10-19 Thread selena

hello everyone
i apologize for being so quick on asking for help, before i double
checked my paths and local settings  - which i thought i did but
i have just realized that i had the old computer's name SSAVIC in the
database_name path - and that was the only reason this was not
working! thanks for help, this is (self)resolved
s

On Oct 19, 5:15 pm, selena  wrote:
> sure, here it is:
>
> # Django settings for mysite project.
>
> DEBUG = True
> TEMPLATE_DEBUG = DEBUG
>
> ADMINS = ('selena', 'idealnig...@gmail.com'
>     # ('Your Name', 'your_em...@domain.com'),
> )
>
> MANAGERS = ADMINS
>
> DATABASE_ENGINE = 'sqlite3'           # 'postgresql_psycopg2',
> 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
> DATABASE_NAME = '/home/ssavic/django2/mysite/db.db'             # Or
> path to database file if using sqlite3.
> DATABASE_USER = ''             # Not used with sqlite3.
> DATABASE_PASSWORD = ''         # Not used with sqlite3.
> DATABASE_HOST = ''             # Set to empty string for localhost.
> Not used with sqlite3.
> DATABASE_PORT = ''             # Set to empty string for default. Not
> used with sqlite3.
>
> # Local time zone for this installation. Choices can be found here:
> #http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
> # although not all choices may be available on all operating systems.
> # If running in a Windows environment this must be set to the same as
> your
> # system time zone.
> TIME_ZONE = 'Europe/Amsterdam'
>
> # Language code for this installation. All choices can be found here:
> #http://www.i18nguy.com/unicode/language-identifiers.html
> LANGUAGE_CODE = 'en-us'
>
> SITE_ID = 1
>
> # If you set this to False, Django will make some optimizations so as
> not
> # to load the internationalization machinery.
> USE_I18N = True
>
> # Absolute path to the directory that holds media.
> # Example: "/home/media/media.lawrence.com/"
> MEDIA_ROOT = ''
>
> # URL that handles the media served from MEDIA_ROOT. Make sure to use
> a
> # trailing slash if there is a path component (optional in other
> cases).
> # Examples: "http://media.lawrence.com;, "http://example.com/media/;
> MEDIA_URL = ''
>
> # URL prefix for admin media -- CSS, JavaScript and images. Make sure
> to use a
> # trailing slash.
> # Examples: "http://foo.com/media/;, "/media/".
> ADMIN_MEDIA_PREFIX = '/media/'
>
> # Make this unique, and don't share it with anybody.
> SECRET_KEY = 'c...@oss_^es%rz3$3lap6jp0h0bq=mf=1r1kg3z...@_wv'
>
> # List of callables that know how to import templates from various
> sources.
> TEMPLATE_LOADERS = (
>     'django.template.loaders.filesystem.load_template_source',
>     'django.template.loaders.app_directories.load_template_source',
> #     'django.template.loaders.eggs.load_template_source',
> )
>
> MIDDLEWARE_CLASSES = (
>     'django.middleware.common.CommonMiddleware',
>     'django.contrib.sessions.middleware.SessionMiddleware',
>     'django.contrib.auth.middleware.AuthenticationMiddleware',
> )
>
> ROOT_URLCONF = 'mysite.urls'
>
> TEMPLATE_DIRS = (
>     # Put strings here, like "/home/html/django_templates" or "C:/www/
> django/templates".
>     # Always use forward slashes, even on Windows.
>     # Don't forget to use absolute paths, not relative paths.
>     '/home/ssavic/django2/mysite/templates'
> )
>
> INSTALLED_APPS = (
>     'django.contrib.auth',
>     'django.contrib.contenttypes',
>     'django.contrib.sessions',
>     'django.contrib.sites',
>     'mysite.polls',
>     'django.contrib.admin'
> )
>
> i suspect the sqlite version and folder structure not working with the
> newer version of python. but maybe this is just a very unexperienced
> opinion.
> thanks for help!
> selena
>
> On Oct 19, 5:51 am, Ovnicraft  wrote:
>
> > 2009/10/18 selena 
>
> > > Hello
> > > hey michael
> > > I have been experiencing this problem since I installed my brand new
> > > Ubuntu Karmic with python in version 2.6 The project I am working on
> > > was working under python2.5 in my old Gentoo and still works (at least
> > > the python manage.py syncdb command does) on a server which is also
> > > running python2.5.
> > > I have tried installing both the latest official version and the
> > > latest development version of django and still the
> > > "python manage.py syncdb"
> > > it returns this error:
>
> > > Traceback (most recent call last):
> > >  File "manage.py", line 11, in 
> > >    execute_manager(settings)
> > >  File "/usr/local/lib/python2.6/dist-packages/django/core/management/
> > > __init__.py", line 3
> > >    utility.execute()
> > >  File "/usr/local/lib/python2.6/dist-packages/django/core/management/
> > > __init__.py", line 3
> > >    self.fetch_command(subcommand).run_from_argv(self.argv)
> > >  File "/usr/local/lib/python2.6/dist-packages/django/core/management/
> > > base.py", line 195,
> > >    self.execute(*args, **options.__dict__)
> > >  File 

Re: JOINs with Django ORM

2009-10-19 Thread Daniel Roseman

On Oct 19, 5:25 pm, Tomasz Zieliński
 wrote:
> On 19 Paź, 17:52, Daniel Roseman  wrote:
>
> > On Oct 19, 4:17 pm, Tomasz Zieliński
>
> > It's not clear what you mean by 'all latest ObjectRevisions'. Do you
> > mean all ObjectRevisions for a particular object? If so:
> >     myobject.objectrevision_set.all()
>
> I was unclear, but SQL should explain what I want to do - select
> all ObjectRevision-s that are latest in Object-s that they belong to.
> Moreover, I want to do this in with one ORM query, without resorting
> to SQL or splitting the query too much.
>
You can't do this in one query with Django's ORM.

One way of doing it in two queries might be to get use .annotate() to
add the max id of the related objectrevision for each revision, then
get all those objectrevisions (untested):

   objects = Object.objects.all().annotate(revision_id=Max
('objectrevision__id'))
   objectrevisions = ObjectRevision.objects.filter(id__in=
[o.revision_id for o in objects])
--
DR.
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Custom Comments

2009-10-19 Thread andreas schmid

check this link:
http://www.yashh.com/blog/2008/nov/21/django-comments-authenticated-users/

simonecare...@gmail.com wrote:
> Post more information about errors you get, including you traceback.
> It will be more helpful.
>
> Bye.
>
> On Oct 19, 4:34 pm, ToTmX  wrote:
>   
>> Hi, I'm new django user.
>>
>> I want use Comments application and custom the input form with only
>> comment field in my form, without email field, site field, etc.
>>
>> I followed djangoproject.org guide for customing comments, but don't
>> work :-(
>>
>> Please, help me.
>> Thank's you and sorry for my english.
>> S.C.
>> 
> >
>
>   


--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django SAAS projects

2009-10-19 Thread hcarvalhoalves

On Oct 16, 7:09 pm, Savy  wrote:
> Hi Djangonauts,
>
> I am developing  a Django project (with a few pluggable apps).
>
> I want to offer this project as a SaaS (something like 37signals.com).
>
> i.e: customer1.product1.com , customer2.product2.com etc
>
> product1 could be the basecamp product2 could be highrise and so on.
>
> I want to know how the project should be structured for these
> products.
>
> Should there be a single project under which all products will be an
> application.  OR  Should I be making different projects for
> all the products.
>
> Also interms of database.. should all the products look into a single
> database or we should have seperate databases for each product.
>
> I am looking out for the most efficient and scalable way to do this.
>
> Thanks

Of course, it depends on the characteristics of your system and your
infrastructure, also on if you'll be allowing customization on a per-
client basis. But the easiest way to manage this kind of service is
having just one Django project, and having your applications be client-
aware.

In my case, we develop a SaaS for real state companies, and setting up
per-client domains (yourname.domain.com), validating uniqueness, and
some other things are way easier serving the Django project at the
root URL than would be otherwise. But in our case, clients still share
some information between themselves

On scalability, you can always cache (and Django provides great hook
for caching query or processed/template data), add a DB cluster, and
on the extreme case, work with database sharding (still hard to do
with Django, but look forward to Multi-DB support).

About security, having your data compromised for one client or all
clients is still the same: a security problem, that may get you sued.
As most security issues are reproducible, it doesn't really matter on
how many databases you scattered the information; I would worry more
about implementing good security policies.
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: JOINs with Django ORM

2009-10-19 Thread Tomasz Zieliński

On 19 Paź, 17:52, Daniel Roseman  wrote:
> On Oct 19, 4:17 pm, Tomasz Zieliński
>
>
> It's not clear what you mean by 'all latest ObjectRevisions'. Do you
> mean all ObjectRevisions for a particular object? If so:
>     myobject.objectrevision_set.all()

I was unclear, but SQL should explain what I want to do - select
all ObjectRevision-s that are latest in Object-s that they belong to.
Moreover, I want to do this in with one ORM query, without resorting
to SQL or splitting the query too much.

--
Tomasz Zielinski
http://pyconsultant.eu
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Custom Comments

2009-10-19 Thread simonecare...@gmail.com

Post more information about errors you get, including you traceback.
It will be more helpful.

Bye.

On Oct 19, 4:34 pm, ToTmX  wrote:
> Hi, I'm new django user.
>
> I want use Comments application and custom the input form with only
> comment field in my form, without email field, site field, etc.
>
> I followed djangoproject.org guide for customing comments, but don't
> work :-(
>
> Please, help me.
> Thank's you and sorry for my english.
> S.C.
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django methodologies and best practices

2009-10-19 Thread Mike Ramirez
On Saturday 17 October 2009 21:55:39 Shakefu wrote:
> So my questions are simple:
> 
> What are your opinions on the best methodologies and practices for
> developing django apps and projects?
> 
> What sort of planning do you do for an application or project?
 
I've been thinking about this and first off, I don't think there is a best 
practices for django apps and projects in terms of how you design a website.  
Which your questions seem to point to. 

I think the best practices you're asking for are generic enough that they are 
effective with most web design projects regardless of language/framerowrk.

For example the steps I take are first identify the goal project, then figure 
out what applications are required to make that goal a reality.  At the 
application level, I start with the models and what basic data do I need to 
collect for the app.  Then I go to the forms and create those as needed to 
collect data. Next to the urls and start mapping out urls to the data that 
should be displayed, collected, etc..., then create the basic views.  

At this point the application should take shape and you'll know what it'll 
provide. From this point on, I start looking at what I'm missing in terms of 
the model fields and then decide if I need/want context processors, template 
tags and filters for the data and for data I want to be available regardless 
of the view. In say a gallery app, I'll add in template tags that display 
random images or a list of images, that can be used anywhere in the site.


Then it's on to clean up.  I take these steps per project/app normally.

> What development techniques do you use to help conceptualize an
> evolving project/app?
>
> So what works for you? Why? What doesn't work or what stumbling blocks
> do certain routes present?

Well, I start with drawing up a mock up of the index page layout (the basic 
layout used through out the site). Then write out (psuedocode/flowchart) what 
I think is needed to make the site function per the specs, using the order 
outlined above.

This gives me a great idea of the full scope of the project before I type one 
thing or an image is made and I can minimize the additions of fields in the 
models (mentioned in an earlier email) later in the project.  

What doesn't work for me and is probably the most annoying and most used 
system is to go at it on the fly, with little or no planning or written plans 
before you start to code.  Eventually you'll start to go out of scope and add 
more things within spec, changing the deployment time usually. With a plan, I 
tend to minimize 'scope creep'.  

Outside of this, there are django specific things you should be aware of. 
Someone mentioned in a thread a few days ago (can't find it now) talking about 
two view functions, where you have your view function setup the data for that 
specific view and then a utility function that builds your context, template 
and returns the response.  I think they were putting a middle man between the 
render_to_response shortcut and the actual data gathering/building for the 
view.  To see what I mean, take a look at djangobb it uses a decorator to do 
this.

Djangobb also use a build_form function that takes a form object and returns 
an instance of it, either initialized with post/get data or without it.

In the end most of the best practices with django resort to utilizing the DRY 
philosophy more than anything.  But at the same time you lose some flexibility 
or atleast readibility if you combine multiple methods.  So I go with 
flexibility over DRY, because it is more important to me. This is why I don't 
like the two view idea, outside of using render_to_response.

Personally I've found by reading django-registration and DjangoBB that you can 
find a lot of good/best practices for building your app/project. Especially 
django-registation and how it defines it's view functions, the args passed to 
each function like extra_context and template name, this way it can be over 
written in the urls at allows the most flexibility for other developers.  The 
one item I'll take away from djangobb to other projects is it's per app 
settings usage.  Until then I had been using two global settings file, a 
settings_local.py with settings specific to the deployment such as database 
info, and  the regular settings.py file with settings global to the project 
regardless, like installed apps.  With app specific settings sprinkled between 
the two.

These are just a few of the ideas I've seen and utilize.  

The general rule of thumb I use is: K.I.S.S. Keep It Simple, Stupid.

Mike

> 
> --~--~-~--~~~---~--~~
> 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 django-users+unsubscr...@googlegroups.com For more options, visit this
>  group at 

Re: JOINs with Django ORM

2009-10-19 Thread Daniel Roseman

On Oct 19, 4:17 pm, Tomasz Zieliński
 wrote:
> Say I have Object model, which has ObjectRevision-s (ObjectRevision
> has ForeignKey to Object). I want to fetch from database all latest
> ObjectRevision-s. In SQL I can do it like this:
>
> SELECT r1.some_data
> FROM objectrevision r1
> LEFT OUTER JOIN objectrevision nr2
> ON (r1.object_id = r2.object_id AND r1.id < r2.id)
> WHERE r2.id IS NULL
>
> What would be be the best way to do it with Django ORM?
>

It's not clear what you mean by 'all latest ObjectRevisions'. Do you
mean all ObjectRevisions for a particular object? If so:
myobject.objectrevision_set.all()
--
DR.
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Add Request Parameters

2009-10-19 Thread Shawn Milochik

Keith,

Depending on what you're doing, it might be a good place to use a  
context processor.

http://docs.djangoproject.com/en/dev/ref/templates/api/#writing-your-own-context-processors

Also, if you're using (or can use) the session middleware, you can  
store these values in the session.

Shawn

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: How to enforce uniqueness based on two model fields

2009-10-19 Thread Shawn Milochik

Guillermo,

Please see the 'unique_together' syntax:

http://docs.djangoproject.com/en/dev/ref/models/options/#unique-together



--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Uploaded file always fails validation

2009-10-19 Thread mike.thon



On Oct 19, 4:36 pm, "mike.thon"  wrote:
> Hi all - I am quite new to python and Django but I'm starting to learn
> my way around.  I am writing a form for uploading files but the form
> always seems to fail the form.is_valid() test.  if I print the form
> errors using:
>
> errors = form.errors
> print errors
>
> I get this string:
>
> fileThis field is
> required.
>
> I can read the file name and file contents from the request.FILES
> object and the data is there but is_valid() seems to always return
> False.  I guess there must be a default clean() method on uploaded
> files that always returns false unless I override it?  I think I can
> write my own validator method and put it in clean_() in the
> form subclass but I would like to find out why the error is happening
> before I do that.
>
> BTW, I can upload the same file through the admin interface and I do
> not get the error.
> TIA

Well, I found the problem - When binding the POST data to the form,
you also need to specify the form file data (request.FILES)
http://docs.djangoproject.com/en/dev/ref/forms/api/#binding-uploaded-files-to-a-form

Thanks anyway!

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



JOINs with Django ORM

2009-10-19 Thread Tomasz Zieliński

Say I have Object model, which has ObjectRevision-s (ObjectRevision
has ForeignKey to Object). I want to fetch from database all latest
ObjectRevision-s. In SQL I can do it like this:

SELECT r1.some_data
FROM objectrevision r1
LEFT OUTER JOIN objectrevision nr2
ON (r1.object_id = r2.object_id AND r1.id < r2.id)
WHERE r2.id IS NULL

What would be be the best way to do it with Django ORM?

--
Tomasz Zielinski
http://pyconsultant.eu
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: python manage.py syncdb error: sqlite3.OperationalError: unable to open database file

2009-10-19 Thread selena

sure, here it is:

# Django settings for mysite project.

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = ('selena', 'idealnig...@gmail.com'
# ('Your Name', 'your_em...@domain.com'),
)

MANAGERS = ADMINS

DATABASE_ENGINE = 'sqlite3'   # 'postgresql_psycopg2',
'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = '/home/ssavic/django2/mysite/db.db' # Or
path to database file if using sqlite3.
DATABASE_USER = '' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used with sqlite3.
DATABASE_HOST = '' # Set to empty string for localhost.
Not used with sqlite3.
DATABASE_PORT = '' # Set to empty string for default. Not
used with sqlite3.

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# If running in a Windows environment this must be set to the same as
your
# system time zone.
TIME_ZONE = 'Europe/Amsterdam'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as
not
# to load the internationalization machinery.
USE_I18N = True

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = ''

# URL that handles the media served from MEDIA_ROOT. Make sure to use
a
# trailing slash if there is a path component (optional in other
cases).
# Examples: "http://media.lawrence.com;, "http://example.com/media/;
MEDIA_URL = ''

# URL prefix for admin media -- CSS, JavaScript and images. Make sure
to use a
# trailing slash.
# Examples: "http://foo.com/media/;, "/media/".
ADMIN_MEDIA_PREFIX = '/media/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = 'c...@oss_^es%rz3$3lap6jp0h0bq=mf=1r1kg3z...@_wv'

# List of callables that know how to import templates from various
sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
# 'django.template.loaders.eggs.load_template_source',
)

MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
)

ROOT_URLCONF = 'mysite.urls'

TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/
django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
'/home/ssavic/django2/mysite/templates'
)

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'mysite.polls',
'django.contrib.admin'
)

i suspect the sqlite version and folder structure not working with the
newer version of python. but maybe this is just a very unexperienced
opinion.
thanks for help!
selena


On Oct 19, 5:51 am, Ovnicraft  wrote:
> 2009/10/18 selena 
>
>
>
>
>
> > Hello
> > hey michael
> > I have been experiencing this problem since I installed my brand new
> > Ubuntu Karmic with python in version 2.6 The project I am working on
> > was working under python2.5 in my old Gentoo and still works (at least
> > the python manage.py syncdb command does) on a server which is also
> > running python2.5.
> > I have tried installing both the latest official version and the
> > latest development version of django and still the
> > "python manage.py syncdb"
> > it returns this error:
>
> > Traceback (most recent call last):
> >  File "manage.py", line 11, in 
> >    execute_manager(settings)
> >  File "/usr/local/lib/python2.6/dist-packages/django/core/management/
> > __init__.py", line 3
> >    utility.execute()
> >  File "/usr/local/lib/python2.6/dist-packages/django/core/management/
> > __init__.py", line 3
> >    self.fetch_command(subcommand).run_from_argv(self.argv)
> >  File "/usr/local/lib/python2.6/dist-packages/django/core/management/
> > base.py", line 195,
> >    self.execute(*args, **options.__dict__)
> >  File "/usr/local/lib/python2.6/dist-packages/django/core/management/
> > base.py", line 222,
> >    output = self.handle(*args, **options)
> >  File "/usr/local/lib/python2.6/dist-packages/django/core/management/
> > base.py", line 351,
> >    return self.handle_noargs(**options)
> >  File "/usr/local/lib/python2.6/dist-packages/django/core/management/
> > commands/syncdb.py",
> >    cursor = connection.cursor()
> >  File "/usr/local/lib/python2.6/dist-packages/django/db/backends/
> > __init__.py", line 81, i
> >    cursor = self._cursor()
> >  File "/usr/local/lib/python2.6/dist-packages/django/db/backends/
> > sqlite3/base.py", line 1
> >    self.connection = 

Re: Django methodologies and best practices

2009-10-19 Thread Tomasz Zieliński



On 19 Paź, 12:00, bruno desthuilliers 
wrote:
> On 18 oct, 23:15, Mike Ramirez  wrote:
>
> Or write a custom migration script, or just fire your favorite db
> client and issue a couple SQL queries.
>
> > I tend to start with the models first and when I add a field, I just use 
> > alter
> > to update the table in place. This has a gotcha with NOT NULL though, if you
> > don't specify a default you'll end up with an error.  To bypass this error, 
> > I
> > usually don't add the NOT NULL constraint till after I've added the field 
> > and
> > updated the existing rows with the required data.
>
> > This may not be the best approach to it, but it works for me and is fast
> > enough and requires less prep time for using such tools as evolution and the
> > like (no need to install or learn them) and/or editting fixtures.
>
> +1

I was also migrating manually, but after I started using 
http://south.aeracode.org/
now I could not imagine going back to doing manual migrations.

--
Tomasz Zielinski
http://pyconsultant.eu
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Data Looping with a Join? Perhaps ...

2009-10-19 Thread Javier Guerra

On Mon, Oct 19, 2009 at 9:55 AM, The Danny Bos  wrote:
> Will this display all CollectionTypes even if there is no record for a
> user in CollectionUserPile?

no.  in that case try this (untested):

in the view:

mytypes = ((t, t.collectionuserpile_set.filter(user=request.user)) for
t in CollectionType.all())

in the template:

{% for type,pile in mytypes %}
  {{type}}
  {% for item in pile %}
{{item}}
  {% endfor %}
{% endfor %}

-- 
Javier

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Uploaded file always fails validation

2009-10-19 Thread mike.thon

Hi all - I am quite new to python and Django but I'm starting to learn
my way around.  I am writing a form for uploading files but the form
always seems to fail the form.is_valid() test.  if I print the form
errors using:

errors = form.errors
print errors

I get this string:

fileThis field is
required.

I can read the file name and file contents from the request.FILES
object and the data is there but is_valid() seems to always return
False.  I guess there must be a default clean() method on uploaded
files that always returns false unless I override it?  I think I can
write my own validator method and put it in clean_() in the
form subclass but I would like to find out why the error is happening
before I do that.

BTW, I can upload the same file through the admin interface and I do
not get the error.
TIA

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Custom Comments

2009-10-19 Thread ToTmX

Hi, I'm new django user.

I want use Comments application and custom the input form with only
comment field in my form, without email field, site field, etc.

I followed djangoproject.org guide for customing comments, but don't
work :-(

Please, help me.
Thank's you and sorry for my english.
S.C.

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Data Looping with a Join? Perhaps ...

2009-10-19 Thread The Danny Bos


Will this display all CollectionTypes even if there is no record for a
user in CollectionUserPile?
As I'd want to set a default item if there isn't, but still loop
through all Types.


d



On Oct 20, 1:35 am, Javier Guerra  wrote:
> On Mon, Oct 19, 2009 at 6:53 AM, The Danny Bos  wrote:
>
>
>
>
>
>
>
> > K, I've got one for ya.
>
> > I've created a new table to handle Users latest "owned" item, how
> > would I get this joined data up in my views.py where I'm currently
> > just looping through CollectionTypes. Tables and current Query is
> > below:
>
> > models.py
> > class CollectionType(models.Model):
> >        title = models.CharField(max_length=50, unique=True) eg: "Pokemon
> > Cards"
> >        slug = models.SlugField(max_length=50, unique=True) eg: "pokemon
> > cards"
>
> > class CollectionUserPile(models.Model):
> >        user = models.ForeignKey(User) eg: "Danny"
> >        collection_item = models.ForeignKey(CollectionItem) eg: "Pokemon Card
> > No.12"
> >        collection_type = models.ForeignKey(CollectionType) eg: "Pokemon
> > Cards"
>
> > views.py
> > types = CollectionType.objects.all().order_by('title')
>
> > So I want to loop through all the CollectionTypes, then in that loop I
> > want to display the collection_item data.
>
> try something like this:
>
> in the view:
>
> mypiles = request.user.collectionuserpile_set.order_by(collection_type)
>
> in the template:
>
> {% for pile in mypiles %}
>   {% ifchanged %} {{pile.type}} {% endifchanged %}
>   {{pile.item}}
> {% endfor %}
>
> --
> Javier
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



simplelazyobject breaks code

2009-10-19 Thread ozgurisil


Here's a template filter that has been working without problems till
recently, before I updated Django source:

from pm_core.models import PMUser

@register.filter
def can_manage_market(user, market):
if not isinstance(user, PMUser): return False
return user.can_manage_market(market)

The filter has begun to return false always. The problem seems to be
that the 'user' instance is of 'SimpleLazyObject' instead of PMUser (a
subclass of User). Searching it up on the internet brought me to
Ticket #12049, which indicates that this may be a similar bug
(however, the patch provided there is not a remedy, unfortunately).
Should I file a ticket, or is there anything I am missing?

Thanks in advance,
Ozgur.

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Data Looping with a Join? Perhaps ...

2009-10-19 Thread Javier Guerra

On Mon, Oct 19, 2009 at 6:53 AM, The Danny Bos  wrote:
>
> K, I've got one for ya.
>
> I've created a new table to handle Users latest "owned" item, how
> would I get this joined data up in my views.py where I'm currently
> just looping through CollectionTypes. Tables and current Query is
> below:
>
> models.py
> class CollectionType(models.Model):
>        title = models.CharField(max_length=50, unique=True) eg: "Pokemon
> Cards"
>        slug = models.SlugField(max_length=50, unique=True) eg: "pokemon
> cards"
>
> class CollectionUserPile(models.Model):
>        user = models.ForeignKey(User) eg: "Danny"
>        collection_item = models.ForeignKey(CollectionItem) eg: "Pokemon Card
> No.12"
>        collection_type = models.ForeignKey(CollectionType) eg: "Pokemon
> Cards"
>
> views.py
> types = CollectionType.objects.all().order_by('title')
>
>
> So I want to loop through all the CollectionTypes, then in that loop I
> want to display the collection_item data.

try something like this:

in the view:

mypiles = request.user.collectionuserpile_set.order_by(collection_type)

in the template:

{% for pile in mypiles %}
  {% ifchanged %} {{pile.type}} {% endifchanged %}
  {{pile.item}}
{% endfor %}


-- 
Javier

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: unable to see SQL even after DEBUG=True in settings

2009-10-19 Thread Indu



On Oct 16, 8:22 pm, Javier Guerra  wrote:
> On Fri, Oct 16, 2009 at 1:55 AM, Jani Tiainen  wrote:
> >> I have run the app such that it has executed number of db queries and I
> >> know for sure there must be some sql.  But still I don't see any in
> >> connection.queries.  what am I doing wrong?
>
> > Are you sure that querysets are evaluated? Meaning that you actually
> > access them, just create querysets.
>
> also, from the transcript you send, it's not obvious if you actually
> run the app in the same python process or if it's running separately
> and you'd want to magically see the effect in an independent
> interpreter
>

Putting the code in the view showed the sql.  You were right.  The app
was running on a different process and my interpreter spawned a
different one!  Thanks for pointing me in the right direction. silly
me!

thanks Javier, Jani

Indu
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Keeping sexes apart helps girls to thrive ... find Western Morning

2009-10-19 Thread jhonsan

Keeping sexes apart helps girls to thrive ... find Western Morning
News, The Plymouth (UK) articles. New report has been published which
concludes girls are ...


Keeping sexes apart helps girls to thrive ... find Western Morning
News, The Plymouth (UK) articles. New report has been published which
concludes girls are ...


http://quickinfotech.blogspot.com/
http://quickinfotech.blogspot.com/
http://quickinfotech.blogspot.com/
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Caching performance regression between django 1.0 and django 1.1.1

2009-10-19 Thread mt



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
> > 1.1.1 and noticed that the load on the server went through the roof,
> > so I had to revert to django 1.0.
> > I've done some testing and noticed that the caching behaviour between
> > 1. 0 and 1.1.1 has changed.
> > Basically I was caching expensive database queries using memcached, in
> > django 1.0 reading from the cache is a fast operation however in
> > django 1.1.1 reading from cache causes all fields with a callable as
> > default to be called.
> > In the case where that callable is an expensive operation the
> > performance is severely affected.
> > I've created patches showing this regression for the branches
> >http://code.djangoproject.com/svn/django/branches/releases/1.0.X
> > and
> >http://code.djangoproject.com/svn/django/branches/releases/1.1.X
> > which shows the default callable being called on cache read.
>
> > My questions are:
> > 1. Is it wrong to store querysets in the cache?
>
> Strictly, a queryset doesn't contain *any* data - it's just a
> programatic representation of a SQL query. So, putting a queryset in
> the cache doesn't inherently mean that anything is being stored.
> However, if the queryset has been evaluated, there might be something
> in the queryset's internal result cache, and *that* value will be
> returned when the value is retrieved from the cache.
>
> > 2. Should I log a bug for this in the django tracker and upload my
> > test case patches?
>
> Certainly.
Done: http://code.djangoproject.com/ticket/12057
Thanks
Michael

>
> > 3. Was this change made on purpose to fulfill other features?
>
> I can't think of any obvious reason that you would see a regression of
> that sort - the core infrastructure for queries didn't change between
> v1.0 and v1.1. There were some features added (such as aggregates),
> and some cleanup of the internals of value_list() and values()
> querysets, but those changes shouldn't have affected caching
> behaviour.
>
> Yours,
> Russ Magee %-)
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: using ajax with django

2009-10-19 Thread Kenneth Gonsalves

On Monday 19 Oct 2009 4:19:19 pm Jorge Bastida wrote:
> > To use ajax you need to be able to make AJAX connections through
> > javascript and make your view.py code to return the right format
> > depending on the request (html, xml, json). So theres nothing special
> > you need to install.
>
> As Anton says, you didn't need any special library to use ajax in django,
> but if you need an "easy-way" try http://dajaxproject.com/  it may help
> you.

wow! looks real good.
-- 
regards
Kenneth Gonsalves
Senior Project Officer
NRC-FOSS
http://nrcfosshelpline.in/web/

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Caching performance regression between django 1.0 and django 1.1.1

2009-10-19 Thread Russell Keith-Magee

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
> 1.1.1 and noticed that the load on the server went through the roof,
> so I had to revert to django 1.0.
> I've done some testing and noticed that the caching behaviour between
> 1. 0 and 1.1.1 has changed.
> Basically I was caching expensive database queries using memcached, in
> django 1.0 reading from the cache is a fast operation however in
> django 1.1.1 reading from cache causes all fields with a callable as
> default to be called.
> In the case where that callable is an expensive operation the
> performance is severely affected.
> I've created patches showing this regression for the branches
> http://code.djangoproject.com/svn/django/branches/releases/1.0.X
> and
> http://code.djangoproject.com/svn/django/branches/releases/1.1.X
> which shows the default callable being called on cache read.
>
> My questions are:
> 1. Is it wrong to store querysets in the cache?

Strictly, a queryset doesn't contain *any* data - it's just a
programatic representation of a SQL query. So, putting a queryset in
the cache doesn't inherently mean that anything is being stored.
However, if the queryset has been evaluated, there might be something
in the queryset's internal result cache, and *that* value will be
returned when the value is retrieved from the cache.

> 2. Should I log a bug for this in the django tracker and upload my
> test case patches?

Certainly.

> 3. Was this change made on purpose to fulfill other features?

I can't think of any obvious reason that you would see a regression of
that sort - the core infrastructure for queries didn't change between
v1.0 and v1.1. There were some features added (such as aggregates),
and some cleanup of the internals of value_list() and values()
querysets, but those changes shouldn't have affected caching
behaviour.

Yours,
Russ Magee %-)

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Data Looping with a Join? Perhaps ...

2009-10-19 Thread The Danny Bos

K, I've got one for ya.

I've created a new table to handle Users latest "owned" item, how
would I get this joined data up in my views.py where I'm currently
just looping through CollectionTypes. Tables and current Query is
below:

models.py
class CollectionType(models.Model):
title = models.CharField(max_length=50, unique=True) eg: "Pokemon
Cards"
slug = models.SlugField(max_length=50, unique=True) eg: "pokemon
cards"

class CollectionUserPile(models.Model):
user = models.ForeignKey(User) eg: "Danny"
collection_item = models.ForeignKey(CollectionItem) eg: "Pokemon Card
No.12"
collection_type = models.ForeignKey(CollectionType) eg: "Pokemon
Cards"

views.py
types = CollectionType.objects.all().order_by('title')


So I want to loop through all the CollectionTypes, then in that loop I
want to display the collection_item data.
Seems easy, but I can't wrap my head around looping through one table
while getting one field where the User = Request.User and
collection_type = CollectionType.

Know what I mean?
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: using ajax with django

2009-10-19 Thread Tom Evans

On Mon, 2009-10-19 at 03:41 -0700, neetu wrote:
> Thanks a lot.
> 
> Can u tell me how can i make ajax connections.
> 

http://lmgtfy.com/?q=make+ajax+request

Cheers

Tom


--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: using ajax with django

2009-10-19 Thread neetu

Thanks jorge

On Oct 19, 3:49 pm, Jorge Bastida  wrote:
> > To use ajax you need to be able to make AJAX connections through
> > javascript and make your view.py code to return the right format
> > depending on the request (html, xml, json). So theres nothing special
> > you need to install.
>
> As Anton says, you didn't need any special library to use ajax in django,
> but if you need an "easy-way" tryhttp://dajaxproject.com/ it may help you.
>
> Greetings
>
> -- jorge[at]thecodefarm.com
> neo2001[at]gmail.com
> neo[at]art-xtreme.com

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: using ajax with django

2009-10-19 Thread neetu

Thanks a lot.

Can u tell me how can i make ajax connections.

On Oct 19, 3:24 pm, Antoni Aloy  wrote:
> 2009/10/19 neetu :
>
> > Hi All
>
> > I want to use ajax for my website.I am new to ajax.The backend code
> > for my website uses django.
> > I want to know the what are the things i need to install before using
> > ajax for my website.should i download and install ajaxcontroltoolkit.
>
> To use ajax you need to be able to make AJAX connections through
> javascript and make your view.py code to return the right format
> depending on the request (html, xml, json). So theres nothing special
> you need to install.
>
> --
> Antoni Aloy López
> Blog:http://trespams.com
> Site:http://apsl.net

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Caching performance regression between django 1.0 and django 1.1.1

2009-10-19 Thread mt

Hi All,
I recently upgraded a high traffic site from django 1.0 to django
1.1.1 and noticed that the load on the server went through the roof,
so I had to revert to django 1.0.
I've done some testing and noticed that the caching behaviour between
1. 0 and 1.1.1 has changed.
Basically I was caching expensive database queries using memcached, in
django 1.0 reading from the cache is a fast operation however in
django 1.1.1 reading from cache causes all fields with a callable as
default to be called.
In the case where that callable is an expensive operation the
performance is severely affected.
I've created patches showing this regression for the branches
http://code.djangoproject.com/svn/django/branches/releases/1.0.X
and
http://code.djangoproject.com/svn/django/branches/releases/1.1.X
which shows the default callable being called on cache read.

My questions are:
1. Is it wrong to store querysets in the cache?
2. Should I log a bug for this in the django tracker and upload my
test case patches?
3. Was this change made on purpose to fulfill other features?

Thanks
Michael
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Caching performance regression between django 1.0 and django 1.1.1

2009-10-19 Thread mt

Hi All,
I recently upgraded a high traffic site from django 1.0 to django
1.1.1 and noticed that the load on the server went through the roof,
so I had to revert to django 1.0.
I've done some testing and noticed that the caching behaviour between
1. 0 and 1.1.1 has changed.
Basically I was caching expensive database queries using memcached, in
django 1.0 reading from the cache is a fast operation however in
django 1.1.1 reading from cache causes all fields with a callable as
default to be called.
In the case where that callable is an expensive operation the
performance is severely affected.
I've created patches showing this regression for the branches
http://code.djangoproject.com/svn/django/branches/releases/1.0.X
and
http://code.djangoproject.com/svn/django/branches/releases/1.1.X
which shows the default callable being called on cache read.

My questions are:
1. Is it wrong to store querysets in the cache?
2. Should I log a bug for this in the django tracker and upload my
test case patches?
3. Was this change made on purpose to fulfill other features?

Thanks
Michael
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: using ajax with django

2009-10-19 Thread Jorge Bastida
>
>
> To use ajax you need to be able to make AJAX connections through
> javascript and make your view.py code to return the right format
> depending on the request (html, xml, json). So theres nothing special
> you need to install.
>

As Anton says, you didn't need any special library to use ajax in django,
but if you need an "easy-way" try http://dajaxproject.com/  it may help you.

Greetings

-- jorge[at]thecodefarm.com
neo2001[at]gmail.com
neo[at]art-xtreme.com

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Best way to generate a local file from a models + views ?

2009-10-19 Thread Михаил Лукин
For purpose of generating apache config files I would recommend to use
management commands [1], so that you could generate config like this:
./manage genconf --server apache2 > /etc/apache2/vhosts.d/myapp.conf
where genconf is your custom management command.

[1] http://docs.djangoproject.com/en/dev/howto/custom-management-commands/

2009/10/19 Daniel Roseman 

>
> On Oct 19, 9:41 am, Nicolas Steinmetz  wrote:
> > Re,
> >
> > Anybody for helping me in my quest ?
> >
> > Nicolas
> >
> > On 16 oct, 21:58, Nicolas Steinmetz  wrote:
> >
> >
> >
> > > Hello,
> >
> > > I'm building a django app to manage the reverse proxies of my firm. I'm
> > > at the step where I want to generate configuration files for apache and
> > > then send it from the server that host the django app to the reverse
> > > proxies.
> >
> > > I built a view base on a generic view (object_detail) with some extra
> > > code. With a mimetype set to plain/text it generates the right
> > > configuration file as a view.
> >
> > > I read the doc regarding outputin csv/pdf file but they are proposed
> for
> > > download and not generated on the server itself.
> >
> > > I tried to play with render_to_string() (based on [1]) within a view
> but
> > > with no success so far. File is created but remains empty. You can see
> > > the code here [2] and the working view is here [3]
> >
> > > If someone already did something similar to what I need, I'll be glad
> to
> > > see some running code :)
> >
> > > Cheers,
> > > Nicolas
> >
> > > [1]http://www.djangosnippets.org/snippets/689/
> > > [2]http://friendpaste.com/9emHQNyTWuLt10S8jlqhY
> > > [3]http://friendpaste.com/4Z2bikQnCVXQ1EKh1Puq9B
>
> There's nothing magical about creating a file in Django, it's just
> Python. Assuming you have rights to write to a file, that should work.
>
> Is render_to_string producing anything? Can you try printing it to the
> console or the server log?
> --
> DR.
> >
>


-- 
regards,
Mihail

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: using ajax with django

2009-10-19 Thread Antoni Aloy

2009/10/19 neetu :
>
> Hi All
>
> I want to use ajax for my website.I am new to ajax.The backend code
> for my website uses django.
> I want to know the what are the things i need to install before using
> ajax for my website.should i download and install ajaxcontroltoolkit.
>
To use ajax you need to be able to make AJAX connections through
javascript and make your view.py code to return the right format
depending on the request (html, xml, json). So theres nothing special
you need to install.



-- 
Antoni Aloy López
Blog: http://trespams.com
Site: http://apsl.net

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



using ajax with django

2009-10-19 Thread neetu

Hi All

I want to use ajax for my website.I am new to ajax.The backend code
for my website uses django.
I want to know the what are the things i need to install before using
ajax for my website.should i download and install ajaxcontroltoolkit.

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: django & flex

2009-10-19 Thread beOn

> I guess long story short, stick with JSON, REST, SOAP, etc... it will make
> future expansion easier (if you can see it going that route).


That's a little too short for me. Not everything is likely to expand
beyond wildest expectations, so sometimes PyAMF will be the way to go.

Unfortunately, I can't add too much to this discussion because I'm in
the middle of trying to figure it out myself. Every snippet I find
seems to be missing critical pieces of information ;). Short stories
all around.

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: "django-pagination" and generic.views.date_based.archive_index()

2009-10-19 Thread Михаил Лукин
Finally, I see only 3 ways:
1. copy/paste archive index code and change it's behaviour so it can eat
num_latest=None
2. patch date_based.py in same way as (1)
3. use list_detail.object_list
Since 1-2 are dirty, I would recommend 3rd way. I'll let you know if I could
suggest something else :)

2009/10/19 tezro 

>
> Surely I could use the list_detail.object_list, but the use of date
> based generics though ))
>
>
> On Oct 18, 11:45 pm, Михаил Лукин  wrote:
> > Sorry, didn't look at condition well...:(
> >
> > So, you see the source and you see that there's no way to get all the
> > records with this view.
> > Why don't you use list_detail.object_list view? If you need just to order
> > list by date, you can use ordering on the model level:
> http://docs.djangoproject.com/en/dev/ref/models/options/#ordering
> >
> > 2009/10/18 tezro 
> >
> >
> >
> >
> >
> > > Would it? If "latest=None" doesn't it mean that there are no entries?
> >
> > > By the way, if I pass None to the condition, it returns False, so
> > > latest is None.
> >
> > > Or isn't it?
> >
> > > Also the template cannot render it, cause "object of type 'NoneType'
> > > has no len()".
> >
> > > Anyways, thanks for reply :)
> >
> > > On Oct 18, 11:04 pm, Mihail Lukin  wrote:
> > > > Look at date_based.py:
> >
> > > > if date_list and num_latest:
> > > > latest = queryset.order_by('-'+date_field)[:num_latest]
> > > > else:
> > > > latest = None
> >
> > > > So, if you use num_latest=None, you will always get the whole list.
> >
> > > > On Aug 30, 2:47 pm, tezro  wrote:
> >
> > > > > Anyone?
> >
> > > > > On Aug 14, 8:29 am, tezro  wrote:
> >
> > > > > > The question is that
> > > "django.views.generic.date_based.archive_index()"
> > > > > > takes an optional argument "num_latest" which is 15 by default.
> > > > > > Setting it manually to num_latest=10 is way off to
> correct to
> > > > > > me. It works. I suppose that it even doesn't retrieve all the
> tons of
> > > > > > data from the DB, but what if I have 10 + 1 record :)
> >
> > > > > > What's the right way to use "django-pagination" and the
> > > "archive_index
> > > > > > ()" or am I missing something?
> >
> > > > > > Example code.
> > > > > > ___
> >
> > > > > > def index(request):
> > > > > > qs = News.objects.filter(is_published=1)
> > > > > > return archive_index(request, qs, 'date',
> > > num_latest=1)
> > > > > > ___
> >
> > > > > > Thanks.
> >
> > --
> > regards,
> > Mihail
> >
>


-- 
regards,
Mihail

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: "django-pagination" and generic.views.date_based.archive_index()

2009-10-19 Thread tezro

Surely I could use the list_detail.object_list, but the use of date
based generics though ))


On Oct 18, 11:45 pm, Михаил Лукин  wrote:
> Sorry, didn't look at condition well...:(
>
> So, you see the source and you see that there's no way to get all the
> records with this view.
> Why don't you use list_detail.object_list view? If you need just to order
> list by date, you can use ordering on the model 
> level:http://docs.djangoproject.com/en/dev/ref/models/options/#ordering
>
> 2009/10/18 tezro 
>
>
>
>
>
> > Would it? If "latest=None" doesn't it mean that there are no entries?
>
> > By the way, if I pass None to the condition, it returns False, so
> > latest is None.
>
> > Or isn't it?
>
> > Also the template cannot render it, cause "object of type 'NoneType'
> > has no len()".
>
> > Anyways, thanks for reply :)
>
> > On Oct 18, 11:04 pm, Mihail Lukin  wrote:
> > > Look at date_based.py:
>
> > >     if date_list and num_latest:
> > >         latest = queryset.order_by('-'+date_field)[:num_latest]
> > >     else:
> > >         latest = None
>
> > > So, if you use num_latest=None, you will always get the whole list.
>
> > > On Aug 30, 2:47 pm, tezro  wrote:
>
> > > > Anyone?
>
> > > > On Aug 14, 8:29 am, tezro  wrote:
>
> > > > > The question is that
> > "django.views.generic.date_based.archive_index()"
> > > > > takes an optional argument "num_latest" which is 15 by default.
> > > > > Setting it manually to num_latest=10 is way off to correct to
> > > > > me. It works. I suppose that it even doesn't retrieve all the tons of
> > > > > data from the DB, but what if I have 10 + 1 record :)
>
> > > > > What's the right way to use "django-pagination" and the
> > "archive_index
> > > > > ()" or am I missing something?
>
> > > > > Example code.
> > > > > ___
>
> > > > > def index(request):
> > > > >         qs = News.objects.filter(is_published=1)
> > > > >         return archive_index(request, qs, 'date',
> > num_latest=1)
> > > > > ___
>
> > > > > Thanks.
>
> --
> regards,
> Mihail
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django methodologies and best practices

2009-10-19 Thread bruno desthuilliers



On 18 oct, 23:15, Mike Ramirez  wrote:
> On Sunday 18 October 2009 13:57:58 Shakefu wrote:
>
> > > > a first working implementation of my models (remember you can test
> > > > your models from the interactive shell and/or python scripts).
>
> > > Or write unit tests, which are more suited for testing than loose
> > > bunch of scripts
>
> > Well, I certainly have noticed that a lot of guides/tutorials/snippets
> > start with models and then write the rest of the required code in
> > varying order.
>
> > Is there any downside to starting with the models first?
>
> The biggest one is that if you decide later to add a field to the model that
> isn't there and you've filled in some data to the db.

I wouldn't call this a "downside". It's a very common situation when
programming db-backed applications, and you'll very certainly face it
whether you start with the models or not.

> Syncdb is ineffective at
> updating the table so you either drop the table and reload the data as a
> fixture with the added field data, or start again with data or use a db
> migration tool like django evolution.

Or write a custom migration script, or just fire your favorite db
client and issue a couple SQL queries.

> I tend to start with the models first and when I add a field, I just use alter
> to update the table in place. This has a gotcha with NOT NULL though, if you
> don't specify a default you'll end up with an error.  To bypass this error, I
> usually don't add the NOT NULL constraint till after I've added the field and
> updated the existing rows with the required data.
>
> This may not be the best approach to it, but it works for me and is fast
> enough and requires less prep time for using such tools as evolution and the
> like (no need to install or learn them) and/or editting fixtures.

+1


--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: django + mod_python + apache2 config problem

2009-10-19 Thread Graham Dumpleton



On Oct 19, 6:10 pm, Lars Stavholm  wrote:
> Bit of an annoying problem with apache2 + mod_python configuration.
>
> I've got my django site setup and working. When adding a 
> directive in the apache config which then includes authentication,
> the SetHandler None directive doesn't seem to work, i.e. I get a
> "Page not found" error in my django site, rather than the broswer
> login popup that I was expecting.

Why are you setting:

  SetHandler None

in the first place?

The Trac documentation does not tell you to set that directive for
'login' sub url.

See:

  http://trac.edgewall.org/wiki/TracModPython

I could try and explain why it may be getting routed to Django as a
result, but best off just fixing this mistake first and see what
happens.

The separate suggestion that PythonInterpreter is required is as far
as I can see totally irrelevant and wouldn't help.

Graham

> The django site is running (fine) as a virtual host, and within the
> virtual host I've defined...
>
> 
>   SetHandler mod_python
>   PythonInterpreter main_interpreter
>   PythonHandler trac.web.modpython_frontend
>   PythonOption TracEnv /var/trac/bfact
>   PythonOption TracParentEnv /var/trac
>   PythonOption TracUriRoot /trac
>   PythonOption PYTHON_EGG_CACHE /var/tmp
> 
>
> ...which works fine, whereas...
>
> 
>   SetHandler None
>   AuthType Digest
>   AuthName "MBF Trac"
>   AuthDigestProvider file
>   AuthUserFile /var/trac/.users
>   Require valid-user
> 
>
> ...send me back to the django application with a "Page not found" error.
>
> Any ideas?
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: About Django Notify

2009-10-19 Thread Daniel Roseman

On Oct 19, 10:17 am, aju mathew  wrote:
> Hi Daniel,
>
> I want to create a forum application using djangobb.
>
> For this it need django-notify, openauth etc.
>
> I install all these and specified in the INSTALLED_APPS in settings.py
>
> Inside openauth views.py It calls the methods in notify_user.py in
> django-notify.
>
> So i need notify_user.py.
>
> Please send me that file.
>
> Thanks
> Aju
>

No it doesn't. I just checked out the latest version of django-
authopenid and it contains no reference to django-notify, let alone a
notify_user file. Here is the django-authopenid views.py:
http://bitbucket.org/benoitc/django-authopenid/src/tip/django_authopenid/views.py
- as you can see it does not reference any notify_user file.

Anyway, rather than asking random people on a mailing list to 'send me
the file', don't you think it would be a better idea to speak directly
to the creators of djangobb or django-authopenid?
--
DR.
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: About Django Notify

2009-10-19 Thread James Bennett

On Mon, Oct 19, 2009 at 12:12 AM, aju  wrote:
> I installed django-notify. But in that django-notify folder it does
> not contain the file notify_user.py. I need this file. Plese send me
> the file notify_user.py

It is likely that you will get a better response by contacting the
author of the application you are attempting to use.


-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: About Django Notify

2009-10-19 Thread aju mathew
Hi Daniel,

I want to create a forum application using djangobb.

For this it need django-notify, openauth etc.

I install all these and specified in the INSTALLED_APPS in settings.py

Inside openauth views.py It calls the methods in notify_user.py in
django-notify.

So i need notify_user.py.

Please send me that file.

Thanks
Aju




On Mon, Oct 19, 2009 at 2:22 PM, Daniel Roseman wrote:

>
> On Oct 19, 6:12 am, aju  wrote:
> > Hi
> >
> > I installed django-notify. But in that django-notify folder it does
> > not contain the file notify_user.py. I need this file. Plese send me
> > the file notify_user.py
>
> What do you think this file is supposed to do? What makes you think
> you need it?
> --
> DR.
> >
>


-- 
Thanks & Regards,
Aju P Mathew

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Add Request Parameters

2009-10-19 Thread Daniel Roseman

On Oct 19, 5:20 am, Keith  wrote:
> I'm writing some code that does something like...
>
> 1. check url for specific information
> 2. do some logic based on named group
> 3. pass results along on request
>
> It is easy for me to do this through urls.py for a single request.
> However, i want to perform this for every request.
>
> I am going down the path of creating a custom middleware that will
> perform my logic as mentioned.
>
> My problem is with how to pass the results along on the request.
>
> My intuition is to try and add a parameter like so...
>
>                 q = request.GET.copy();
>                 q.__setitem__('new_key', 'new_val')
>                 request.GET = q
>
> Only problem is that the code further down the pipe doesn't recognize
> 'new_key' as being available in the request.GET querydict.
>
> please advise.
>
> thanks.

Why do they need to be in the GET dictionary? If you want to add
custom information that will remain available throughout the request
process, just add an attribute to the request object itself:
request.new_key = 'new_val'.

(BTW, I wouldn't recommend using __setitem__ for anything - this is an
internal method, you should just do q['new_key']. But don't do this
anyway, as I say above.)
--
DR.
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Best way to generate a local file from a models + views ?

2009-10-19 Thread Daniel Roseman

On Oct 19, 9:41 am, Nicolas Steinmetz  wrote:
> Re,
>
> Anybody for helping me in my quest ?
>
> Nicolas
>
> On 16 oct, 21:58, Nicolas Steinmetz  wrote:
>
>
>
> > Hello,
>
> > I'm building a django app to manage the reverse proxies of my firm. I'm
> > at the step where I want to generate configuration files for apache and
> > then send it from the server that host the django app to the reverse
> > proxies.
>
> > I built a view base on a generic view (object_detail) with some extra
> > code. With a mimetype set to plain/text it generates the right
> > configuration file as a view.
>
> > I read the doc regarding outputin csv/pdf file but they are proposed for
> > download and not generated on the server itself.
>
> > I tried to play with render_to_string() (based on [1]) within a view but
> > with no success so far. File is created but remains empty. You can see
> > the code here [2] and the working view is here [3]
>
> > If someone already did something similar to what I need, I'll be glad to
> > see some running code :)
>
> > Cheers,
> > Nicolas
>
> > [1]http://www.djangosnippets.org/snippets/689/
> > [2]http://friendpaste.com/9emHQNyTWuLt10S8jlqhY
> > [3]http://friendpaste.com/4Z2bikQnCVXQ1EKh1Puq9B

There's nothing magical about creating a file in Django, it's just
Python. Assuming you have rights to write to a file, that should work.

Is render_to_string producing anything? Can you try printing it to the
console or the server log?
--
DR.
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: About Django Notify

2009-10-19 Thread Daniel Roseman

On Oct 19, 6:12 am, aju  wrote:
> Hi
>
> I installed django-notify. But in that django-notify folder it does
> not contain the file notify_user.py. I need this file. Plese send me
> the file notify_user.py

What do you think this file is supposed to do? What makes you think
you need it?
--
DR.
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Best way to generate a local file from a models + views ?

2009-10-19 Thread Nicolas Steinmetz

Re,

Anybody for helping me in my quest ?

Nicolas

On 16 oct, 21:58, Nicolas Steinmetz  wrote:
> Hello,
>
> I'm building a django app to manage the reverse proxies of my firm. I'm
> at the step where I want to generate configuration files for apache and
> then send it from the server that host the django app to the reverse
> proxies.
>
> I built a view base on a generic view (object_detail) with some extra
> code. With a mimetype set to plain/text it generates the right
> configuration file as a view.
>
> I read the doc regarding outputin csv/pdf file but they are proposed for
> download and not generated on the server itself.
>
> I tried to play with render_to_string() (based on [1]) within a view but
> with no success so far. File is created but remains empty. You can see
> the code here [2] and the working view is here [3]
>
> If someone already did something similar to what I need, I'll be glad to
> see some running code :)
>
> Cheers,
> Nicolas
>
> [1]http://www.djangosnippets.org/snippets/689/
> [2]http://friendpaste.com/9emHQNyTWuLt10S8jlqhY
> [3]http://friendpaste.com/4Z2bikQnCVXQ1EKh1Puq9B
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: django + mod_python + apache2 config problem

2009-10-19 Thread Kenneth Gonsalves

On Monday 19 Oct 2009 12:40:48 pm Lars Stavholm wrote:
> 
>   SetHandler mod_python
>   PythonInterpreter main_interpreter
>   PythonHandler trac.web.modpython_frontend
>   PythonOption TracEnv /var/trac/bfact
>   PythonOption TracParentEnv /var/trac
>   PythonOption TracUriRoot /trac
>   PythonOption PYTHON_EGG_CACHE /var/tmp
> 

you would need this line:
PythonInterpreter some_name

in your location directive (some_name may be anything as long as it is 
different for django and for trac) - otherwise your pythons will get tangled 
with each other. You will find django in your trac and trac in your django.


-- 
regards
Kenneth Gonsalves
Senior Project Officer
NRC-FOSS
http://nrcfosshelpline.in/web/

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: TemplateDoesNotExist at /admin/ on Centos with Django 1.1.1

2009-10-19 Thread nausikaa

Hi Christophe


Can you post some more information?
What does settings.py look like?
What does urls.py look like?
How do you register the Models at the admin interface?



On Oct 19, 2:41 am, Christophe Pettus  wrote:
> Greetings,
>
> I'm installing Django on a Centos 5.3 system, running under mod_wsgi  
> on Apache, using Django 1.1.1.  In a very basic install, when I  
> attempt to access the /admin/ URL, I get the above error... but the  
> templates are there:
>
> thebu...@blog templates]$ ls /opt/python2.6/lib/python2.6/site-
> packages/django/contrib/admin/templates/admin
> 404.html                           edit_inline
> 500.html                           filter.html
> actions.html                       includes
> app_index.html                     index.html
> auth                               invalid_setup.html
> base.html                          login.html
> base_site.html                     object_history.html
> change_form.html                   pagination.html
> change_list.html                   prepopulated_fields_js.html
> change_list_results.html           search_form.html
> date_hierarchy.html                submit_line.html
> delete_confirmation.html           template_validator.html
> delete_selected_confirmation.html
>
> Any guidance on what I might be doing wrong?  Thanks!
> --
> -- Christophe Pettus
>     x...@thebuild.com
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django doesnt create sqlite database

2009-10-19 Thread nausikaa

Hi mfever

How do you mean 'didn't create' ? What's the error message?
What does your settings.py look like?
What does the code look like that is doing something with the db?

On Oct 19, 8:18 am, mfever  wrote:
> Hi Buddy,
>
> I am newbie in Django. Recently I try out the Django tutorial from web
> with python 2.5.2 and sqlite3
>
> Unfortunately, Django doesn't create sqlite database as the tutorial
> stated. And I couldn't find any FAQ on the web.
>
> Could you advise me on this?
>
> 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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



django + mod_python + apache2 config problem

2009-10-19 Thread Lars Stavholm

Bit of an annoying problem with apache2 + mod_python configuration.

I've got my django site setup and working. When adding a 
directive in the apache config which then includes authentication,
the SetHandler None directive doesn't seem to work, i.e. I get a
"Page not found" error in my django site, rather than the broswer
login popup that I was expecting.

The django site is running (fine) as a virtual host, and within the
virtual host I've defined...


  SetHandler mod_python
  PythonInterpreter main_interpreter
  PythonHandler trac.web.modpython_frontend
  PythonOption TracEnv /var/trac/bfact
  PythonOption TracParentEnv /var/trac
  PythonOption TracUriRoot /trac
  PythonOption PYTHON_EGG_CACHE /var/tmp


...which works fine, whereas...


  SetHandler None
  AuthType Digest
  AuthName "MBF Trac"
  AuthDigestProvider file
  AuthUserFile /var/trac/.users
  Require valid-user


...send me back to the django application with a "Page not found" error.

Any ideas?



--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Django doesnt create sqlite database

2009-10-19 Thread mfever

Hi Buddy,

I am newbie in Django. Recently I try out the Django tutorial from web
with python 2.5.2 and sqlite3

Unfortunately, Django doesn't create sqlite database as the tutorial
stated. And I couldn't find any FAQ on the web.

Could you advise me on this?

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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---