Ashwoods, I did also some other business-related modifications so it
would take me some time to prepare that just for a snippet. That
middleware is not worth making it a snippet. I would better suggest
you to use the solution by Derek.

Regards,
Aidas Bendoraitis [aka Archatas]



On 3/21/07, ashwoods <[EMAIL PROTECTED]> wrote:
>
> could you post the code on django snippets? :)
>
> On Mar 20, 11:35 pm, "Aidas Bendoraitis" <[EMAIL PROTECTED]>
> wrote:
> > > have you found any solution?
> >
> > Yes. I wrote my own FlatPage model with it's own middleware. Now the
> > URL can be empty and it represents the relative path counting from the
> > website root directory. The root directory is "/" on the public site
> > and "/someproject/" on the development site. The root directory is set
> > in the settings.
> >
> > > would it be correct to say that the problem would
> > > be solved if there was a way to access project settings from inside
> > > flatpages?
> >
> > Not really. You don't define what you mean, saying "from inside
> > faltpages" - whether you're talking about models, views, middleware,
> > or something else from the flatpages. Anyway, it's enough to write
> > your own middleware to override the default control of the flatpages
> > (And fortunately it is not hard to do that).
> >
> > Regards,
> > Aidas Bendoraitis [aka Archatas]
> >
> >
> >
> > > On Mar 5, 12:44 pm, "Aidas Bendoraitis" <[EMAIL PROTECTED]>
> > > wrote:
> > > > We are developing a few Django projects. The development versions are
> > > > accessible in the local network under some directories of the local
> > > > server's IP (i.e.http://1.2.3.4/example/) and the published versions
> > > > are accessible under some domains directly (i.e.http://example.com/).
> >
> > > > If you have a similar situation, how are you dealing with the URLs 
> > > > ofFlatPages? The problem is that in the development version the URLs are
> > > > like /example/about/ and in the published version they are like
> > > > /about/. So we need to modify all theflatpageswhen transfer the data
> > > > from the development version to the public one.
> >
> > > > The ideas that came to my mind:
> > > > 1. creating my own FlatPage model based on the contributed one which
> > > > corresponds to the directory setting in the project settings.
> > > > 2. installing a BIND (DNS) server locally so that we didn't have to
> > > > put projects under specific directories, but rather under local domain
> > > > names (i.e.http://example.local/).
> > > > 3. creating some middleware that removes directory name from the
> > > > requested URL before URL parsing.
> >
> > > > What are the best practices for doing that? What do you do in similar
> > > > situations?
> >
> > > > Regards,
> > > > Aidas Bendoraitis [aka Archatas]
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to