On Mon, Jan 14, 2013 at 8:16 PM, chad petzoldt <
cpet...@gmail.com> wrote:
>> It had occurred to me that Django wasn't the right tool for this job -
>> not everything is a nail :)
>
>
> I am embedding these files within a template, so they are not direct static
> serves. But the content must be inserted within the template "as-is" from
> the filesystem.
>
here is a view i have from a project (simplified):
def viewPage(request, page):
filename = page + ".html"
html_file = join(HTML_PATH, filename)
try:
txt = open(html_file).read()
except:
return HttpResponse("page not found")
context = RequestContext(request, {'html': txt})
return render_to_response("page.html", context)
And the corresponding url.py:
(r'(?P<page>.*)', 'foo.views.viewPage'),
And then page.html is something like:
<!doctype html>
<!-- any other stuff ... -->
<body>
{{ html }}
</body>
My use case was different tho, but just to highlight that its fairly
straightforward to read the contents of some file on disk and stick it
into a django template ..
In your case, each "page" is going to need its own corresponding set
of css / js, so I imagine this would be a bit more work .. but I'm
still fairly certain you can come up with a scheme that allows you to
have your html and css / js on the file-system and then use python
code to put it together into a master template / integrate with other
app logic you have ..
It does seem like a bit of a hack, but hey, moulding InDesign exports
into actual webpages is always going to be, a bit ;-)
> I suck at Javascript.
>
ok, this shouldn't affect this problem / use-case.
> Perhaps still, Django is not proper for the job, but I do know that I need
> some server-side logic, and I want to do it in Python. Any recommendations
> on another framework?
> There are aspects of Django that are growing on me, this one paradigm is
> where I am struggling, and I would not like to abandon just yet.
>
What is the paradigm, exactly ... ? Do you have an idea of how you
would have implemented the same thing using php or anything else? It
may give a better idea of your use case / what you're thinking.
> To recap one of my original statements; I do believe what I am really
> looking for is a content management system, I just don't feel ready to
> commit (maybe I need to get over that). I want a content management system
> that focuses more on the "client experience" in the browser. It needs to be
> picky about layouts, and aware of embedded media. Any suggestions for
> starters?
>
Welll .. the most important question here is: does the client /
non-tech people need to be able to edit content themselves? Or will
you / someone "techie" always be handling the editing of the html? If
people do need to edit themselves, then you generally do need to
structure things a little - an all-singing-all-dancing WYSIWYG editor
for end-users, is I'm afraid, still a bit of a pipe dream (someone
please correct me if things have changed :)) .. going down the path of
trying to build a system that's going to accommodate for radically
different designs that you have no way of pre-empting, is generally a
recipe for disaster .. I think you've got the right idea of trying to
get the system to adapt to your work-flow rather than the other way
around .. and if it is only you editing the HTML files, build
something that helps you manage that, rather than a "content
management system", although, er, anything that you use to manage
content is a content management system :)
The other option, of course, is to tell the client that they need to
stick to a consistent format, and then just put stuff into different
fields in the database and render it in a template like normal :)
hope my response didn't add to the confusion, and hope you find a
solution that works for you.
happy hacking!
-Sanjay
> NOTE: My site layouts are not "liquid" at all. They are very absolute; from
> dimensions to positioning. Its not just about getting all the content on the
> page in a certain order.
>
>
>
> --
> 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/-/hLQsR_8-pOYJ.