Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » How configure Django to handle /books URL and yet allow access to PDFs/images in subdirs of /books? [RSS Feed]

#1 Jan. 4, 2011 03:54:32

Chris S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

How configure Django to handle /books URL and yet allow access to PDFs/images in subdirs of /books?


How configure Django to handle /books URL and yet allow access to PDFs
and images in subdirs of /books?

Specifically, I want /books to be a dynamic page with lots of links to
PDFs and images of book covers contained in subdirectories of /books
like /books/some_book_1 and /books/some_book_1/book_cover.jpg.

cs

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 Jan. 4, 2011 07:49:03

Daniel R.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

How configure Django to handle /books URL and yet allow access to PDFs/images in subdirs of /books?


On Tuesday, January 4, 2011 3:54:25 AM UTC, Chris Seberino wrote:
>
> How configure Django to handle /books URL and yet allow access to PDFs
> and images in subdirs of /books?
>
> Specifically, I want /books to be a dynamic page with lots of links to
> PDFs and images of book covers contained in subdirectories of /books
> like /books/some_book_1 and /books/some_book_1/book_cover.jpg.
>
> cs


You'll need to configure your webserver to manage this, with some sort of
URL rewriting - eg RewriteRule in Apache, or whatever the equivalent is in
whatever you are using.
--
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-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#3 Jan. 4, 2011 08:48:17

Graham D.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

How configure Django to handle /books URL and yet allow access to PDFs/images in subdirs of /books?


On Tuesday, January 4, 2011 2:54:25 PM UTC+11, Chris Seberino wrote:
>
> How configure Django to handle /books URL and yet allow access to PDFs
> and images in subdirs of /books?
>
> Specifically, I want /books to be a dynamic page with lots of links to
> PDFs and images of book covers contained in subdirectories of /books
> like /books/some_book_1 and /books/some_book_1/book_cover.jpg.
>

Depends on how you are hosting Django.

If using Apache/mod_wsgi it is quite simple, and wouldn't even need URL
rewriting as suggested by others.

So, what are you hosting it with.

Graham

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#4 Jan. 4, 2011 17:14:16

Chris S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

How configure Django to handle /books URL and yet allow access to PDFs/images in subdirs of /books?


On Jan 4, 2:48 am, Graham Dumpleton <graham.dumple...@gmail.com>
wrote:
> If using Apache/mod_wsgi it is quite simple, and wouldn't even need URL
> rewriting as suggested by others.
>
> So, what are you hosting it with.

Yes I am using mod_wsgi. The following line sends all URLs to WSGI
script

WSGIScriptAlias / /etc/apache2/wsgi/phil4.com.wsgi

I also have other Alias lines like this..

Alias /images /var/www/static/images

What is tricky about this current problem is I want to send /books to
WSGI but NOT /books/* .

cs

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#5 Jan. 4, 2011 20:38:55

Chris S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

How configure Django to handle /books URL and yet allow access to PDFs/images in subdirs of /books?


Nevermind. I figured it out. To only have subdirs by static you need
to add a "/" at the end of an Alias line...

e.g.

Alias /books/ /some/static/dir/

Thanks!

cs

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

  • Root
  • » Django
  • » How configure Django to handle /books URL and yet allow access to PDFs/images in subdirs of /books? [RSS Feed]

Board footer

Moderator control

Enjoy the 18th of October
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support