On Sat, Jan 12, 2013 at 12:04 AM, chad petzoldt <cpetz...@gmail.com> wrote:
> Sanjay, you were hitting things pretty close. I think that making sure slug
> names match up to real *static* locations is the key. I am hosting with
> Apache, and I thought about using some configurations to cheat a little bit,
> and get some of the static-files burden off of Django and let Apache resolve
> any requests that point to actual files on disk (with some security in
> mind).
>
> What about a view that can determine if it should be pointing at a file on
> disk, and if so, do a custom Http_Response, and read the actually binary
> contents from disk by hand. Im just curious on this one; it could be an
> alternative means of file storage and recognition. I understand this may
> have some performance implications, but this is not going to break Django,
> correct? Is this bad Django etiquette?
>

Yea, hooking up slug-name to folder-name is brittle - if you're just
reading the binary contents of files and serving them, you could do it
in a django view, but you're probably better off doing it directly
through apache - there's no reason to use Django for something its not
good as :) - I think this really depends on how much these 'static'
html pages you're serving need other components of your django app -
if they're completely separate, then they're probably better off being
served simply as static files through apache :)

What I have done in the past is read template files off disk through
some name in the URL .. so like http://foo.com/home looks into a
directory, looks for home.html, and renders the template .. if you do
need to nest these static html files of yours into a django template
that has some other logic, I think this is a perfectly fine logic to
use and has worked well for me .. if you just need to serve the binary
files off disk though, you're probably better off just using apache to
serve them ...

Hope that makes sense / helps ..
-Sanjay


> Amirouche, a different way to describe what I am trying to achieve might be
> this: I would like to bypass the admin as much as possible when it comes to
> these "Articles". But when rendered, all of these articles do need at least
> a small HTML wrapper, and probably some kind of of global template that
> helps with navigation. If I could handle navigation without the admin, i
> would be very excited, but it does seem that I will need to use the admin
> for at least this purpose. The navigation would probably help render
> hierarchical  "menus" for use as templates within the Articles. I would like
> to keep this navigation as light as possible.
>
> Thanks for the feedback.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/ja-o_pBFAT4J.
>
> 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.

-- 
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.

Reply via email to