Re: Where did you put your homepage view?

2007-05-31 Thread xiongzhenhua
?python,???asii
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Where did you put your homepage view?

2007-05-31 Thread David Larlet

2007/5/30, Panos Laganakos <[EMAIL PROTECTED]>:
>
> direct_to_template sounds like a nice way to handle the index page
> serving.
>
> But how can it be fed the dynamic content of one or more apps to
> display? Not sure how it's supposed to be done
> through "template tags" as Michel mentioned.

You can do this with inclusion_tags:
http://www.djangoproject.com/documentation/templates_python/#inclusion-tags

Really useful.

>
> On May 24, 5:42 pm, Michel Thadeu Sabchuk <[EMAIL PROTECTED]> wrote:
> > Index page doesn't need a view. Generally it is a static page, if it
> > have some dynamic data, it access through template tags. So, I follow
> > this structure:
> >
> >  project/
> >  project/templates/
> >  project/templates/main/
> >  project/templates/main/base.html
> >  project/templates/main/index.html
> >  project/templates/appname/another_template.html
> >
> > To point to the index template, I use generic views
> > (direct_to_template).
> > Best regards,
>
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Where did you put your homepage view?

2007-05-30 Thread Panos Laganakos

direct_to_template sounds like a nice way to handle the index page
serving.

But how can it be fed the dynamic content of one or more apps to
display? Not sure how it's supposed to be done
through "template tags" as Michel mentioned.

On May 24, 5:42 pm, Michel Thadeu Sabchuk <[EMAIL PROTECTED]> wrote:
> Index page doesn't need a view. Generally it is a static page, if it
> have some dynamic data, it access through template tags. So, I follow
> this structure:
>
>  project/
>  project/templates/
>  project/templates/main/
>  project/templates/main/base.html
>  project/templates/main/index.html
>  project/templates/appname/another_template.html
>
> To point to the index template, I use generic views
> (direct_to_template).
> Best regards,


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Where did you put your homepage view?

2007-05-24 Thread Michel Thadeu Sabchuk

Index page doesn't need a view. Generally it is a static page, if it
have some dynamic data, it access through template tags. So, I follow
this structure:

 project/
 project/templates/
 project/templates/main/
 project/templates/main/base.html
 project/templates/main/index.html
 project/templates/appname/another_template.html

To point to the index template, I use generic views
(direct_to_template).
Best regards,


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Where did you put your homepage view?

2007-05-24 Thread David Larlet

2007/5/23, David Larlet <[EMAIL PROTECTED]>:
> Hi,
>
> I'm juste curious, where did you put your homepage view when you've
> got a project with a lot of apps? Is there a best practice here?
>

Thanks a lot for your answers!

David

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Where did you put your homepage view?

2007-05-23 Thread Christian Markwart Hoeppner

> I'm juste curious, where did you put your homepage view when you've
> got a project with a lot of apps? Is there a best practice here?

An extra app? Man... Views do not *have* to reside inside some app.
Whenever I have some view not specific to some app, I create a module
for those in the project root. Same with project-specific middleware and
the such.

For example, I have lately gotten a maintenance-middleware solution from
this list, and it's being implemented in a module called "common_views"
that resides in the project folder.

Remember, you can have your code anywhere, as long as it's on the
pythonpath.

Be adventurous. We coders need to be.

Kind regards,
Chris Hoeppner
www.pixware.org


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Where did you put your homepage view?

2007-05-23 Thread afarnham

> I'm juste curious, where did you put your homepage view when you've
> got a project with a lot of apps?

I create a django app called "site" and put my index view in there. I
also put any template tags and filters that will be used across the
project in that app.

~Aaron


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Where did you put your homepage view?

2007-05-23 Thread Kyle Fox

> I usually make a home controller.  Then I typically use an index
> action for the home page view.

This is normally what I do as well, I just define a view called
'index' somewhere and point r'^$' at it.

But this seems like a good place for me to ask a related question I've
often puzzled over: in what module or py file does everyone else place
this view function?


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Where did you put your homepage view?

2007-05-23 Thread Kyle Fox

> I usually make a home controller.  Then I typically use an index
> action for the home page view.

This is normally what I do as well, I just define a view called
'index' somewhere and point r'^$' at it.

But this seems like a good place for me to ask a related question I've
often puzzled over: in what module or py file does everyone else place
this view function?


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Where did you put your homepage view?

2007-05-23 Thread Kyle Fox

> I usually make a home controller.  Then I typically use an index
> action for the home page view.

This is normally what I do as well, I just define a view called
'index' somewhere and point r'^$' at it.

But this seems like a good place for me to ask a related question I've
often puzzled over: in what module or py file does everyone else place
this view function?


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Where did you put your homepage view?

2007-05-23 Thread Greg Donald

On 5/23/07, David Larlet <[EMAIL PROTECTED]> wrote:
> I'm juste curious, where did you put your homepage view when you've
> got a project with a lot of apps? Is there a best practice here?

I usually make a home controller.  Then I typically use an index
action for the home page view.


-- 
Greg Donald
http://destiney.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Where did you put your homepage view?

2007-05-23 Thread Julio Nobrega

  On project_name/views.py ?

  Or do you mean the html template? I usually put on the template root
dir, except for my largest project which has a sub-dir named after the
website, where I store site related stuff like TOS, privacy policy...

On 5/23/07, David Larlet <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I'm juste curious, where did you put your homepage view when you've
> got a project with a lot of apps? Is there a best practice here?
>
> Thanks,
> David
>
> >
>


-- 
Julio Nobrega - http://www.inerciasensorial.com.br

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Where did you put your homepage view?

2007-05-23 Thread David Larlet

Hi,

I'm juste curious, where did you put your homepage view when you've
got a project with a lot of apps? Is there a best practice here?

Thanks,
David

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---