[Server-devel] [XSCE] Some queries regarding PATHAGAR workflows

Miguel González migonzalvar at activitycentral.com
Fri Sep 6 16:15:55 EDT 2013


On Fri, Sep 6, 2013 at 3:51 PM, George Hunt <georgejhunt at gmail.com> wrote:

> Hi Ajay,
>
> As you start playing with pathagar on XSCE, could you look at what will be
> involved to get it to work properly when the package is not located at the
> root of the server, ie. when WSGIalias is set to /books/ or /pathatar/?
>
> Seth looked at the access log,(copied below) and concluded that there
> would be some programatic changes required.
>
> Following is part of our conversation:
>
>
> Seth wrote:
> Django is definitely messing up.  books/book/add is the url you want,
> right?  You are prefixing a url with /books/$pathagar.
>
> If you can put pathagar at the root of your domain, it should just work.
>  If hosting pathagar with a prefix is necessary there are two things we can
> do:
>
> (On the XSCE server, I think we need a prefix -gh)
>
> 1. Look up the right Django way to make this abstract.  I am pretty sure a
> preferred way exists, but it will take me some time to seek the solution
> out and implement it.
>
>
One way to configure Django to run a web application in a subpath is to use
`FORCE_SCRIPT_NAME` setting [1] with the base URL. In this case:

```
FORCE_SCRIPT_NAME = '/books'
```
Hope it helps.

[1] https://docs.djangoproject.com/en/1.4/ref/settings/#force-script-name



> 2. Modify all of the url routes in urls.py
>
> >  (r'^tags/(?P<tag>.+)/$', 'pathagar.books.views.by_tag',
>
> would become
>
> >  (r'^books/tags/(?P<tag>.+)/$', 'pathagar.books.views.by_tag',
>
> This is probably your best bet given your time constraints.
>
> --Seth
>
>
> On Sun, Aug 25, 2013 at 6:58 PM, George Hunt <georgejhunt at gmail.com>
>  wrote:
>
>>
>> After logging in as an administrative user to pathagar,  the following
>> log snippet shows an effort to select a book to upload in the
>> pathagar-error.log file:
>>
>> 172.18.100.204 - - [22/Aug/2013:14:13:49 +0000] "GET /favicon.ico
>> HTTP/1.1" 404 342 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2)
>> AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36"
>> 172.18.100.204 - - [22/Aug/2013:09:13:54 -0500] "GET /books/latest
>> HTTP/1.1" 301 - "http://172.18.96.1/portal/" "Mozilla/5.0 (Macintosh;
>> Intel Mac OS X 10_8_2) AppleWebKit/537.36 (KHTML, like Gecko)
>> Chrome/28.0.1500.95 Safari/537.36"
>> 172.18.100.204 - - [22/Aug/2013:09:13:59 -0500] "GET /books/latest/
>> HTTP/1.1" 200 3782 "http://172.18.96.1/portal/" "Mozilla/5.0 (Macintosh;
>> Intel Mac OS X 10_8_2) AppleWebKit/537.36 (KHTML, like Gecko)
>> Chrome/28.0.1500.95 Safari/537.36"
>> 172.18.100.204 - - [22/Aug/2013:09:13:59 -0500] "GET /favicon.ico
>> HTTP/1.1" 404 342 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2)
>> AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36"
>> 172.18.100.204 - - [22/Aug/2013:09:14:08 -0500] "GET /books/book/add HTTP/1.1"
>> 200 6405 "http://172.18.96.1/books/latest/" "Mozilla/5.0 (Macintosh;
>> Intel Mac OS X 10_8_2) AppleWebKit/537.36 (KHTML, like Gecko)
>> Chrome/28.0.1500.95 Safari/537.36"
>> 172.18.100.204 - - [22/Aug/2013:09:14:14 -0500] "GET
>> /media/js/admin/RelatedObjectLookups.js HTTP/1.1" 404 369 "
>> http://172.18.96.1/books/book/add" "Mozilla/5.0 (Macintosh; Intel Mac OS
>> X 10_8_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95
>> Safari/537.36"
>> 172.18.100.204 - - [22/Aug/2013:09:14:14 -0500] "GET /favicon.ico
>> HTTP/1.1" 404 342 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2)
>> AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36"
>>
>> <the book for upload was selected at this point, and the "add" button at
>> the bottom right of the screen was activated>
>>
>> 172.18.100.204 - - [22/Aug/2013:14:14:26 +0000] "POST /book/add HTTP/1.1"
>> 404 339 "http://172.18.96.1/books/book/add" "Mozilla/5.0 (Macintosh;
>> Intel Mac OS X 10_8_2) AppleWebKit/537.36 (KHTML, like Gecko)
>> Chrome/28.0.1500.95 Safari/537.36"
>> 172.18.100.204 - - [22/Aug/2013:14:14:26 +0000] "GET /favicon.ico
>> HTTP/1.1" 404 342 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2)
>> AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36"
>>
>>
>> (color added to highlight the url which seems questionable-- second was
>> different from the first)
>> I believe that that the correct url to post the data would be
>> "/books/book/add"
>>
>> This is because the httpd WSGIAlias in /etc/httpd/conf.d/pathagar.conf
>> points to the pathagar.wsgi file, which I think also should be used as a
>> prefix to the package.  Or--maybe I should be setting the prefix, and I'm
>> not doing it>
>>
>> As an additional observation, navigating to /books/ redirects to
>> "/latest/" rather than "/books/latest", and returns a 404 Not found error.
>> This may, or may not be related.
>>
>>
> Ajay, are you testing on a physical XO, or are you using a virtual machine?
>
> I'm glad to have your help resolving the remaining issues with pathagar on
> XSCE.
>
> George
>
> On Fri, Sep 6, 2013 at 9:33 AM, Ajay Garg <ajay at activitycentral.com>wrote:
>
>> Thanks Aneesh for the pointers; I will keep them in mind when I start
>> playing with PATHAGAR in XSCE :)
>> Thanks again.
>>
>>
>> On Fri, Sep 6, 2013 at 3:09 PM, Aneesh Dogra <lionaneesh at gmail.com>wrote:
>>
>>>
>>> On Sep 6, 2013 1:06 PM, "Ajay Garg" <ajay at activitycentral.com> wrote:
>>> >
>>> > Hi all.
>>> >
>>> > I have been playing with the public book-server
>>> http://108.171.173.65/latest/ that Sameer let me know some time back
>>> (thanks a lot Sameer, again !!)
>>> >
>>> > However, I have some queries regarding some workflows (and I found it
>>> best to query all you guys, so that the maximum information could be
>>> shared) :)  ::
>>> >
>>> >
>>> >
>>> > 1)
>>> > On the "home page" http://108.171.173.65/latest/, I only see a "Log
>>> in" option.
>>> > However, how do users get registered/created at first place?
>>> >
>>>
>>> You can add users through the django_admin interface (command line)
>>>
>>> > 2)
>>> > What is the notion of a "user" in the book-server?
>>> > In other words, what can a user do "after" logging in, which cannot be
>>> done "without" logging in?
>>> >
>>>
>>> User account in pathagar has rights to edit/add/delete the database
>>> entries I.e books.
>>>
>>> >
>>> > Looking forward to some pointers :)
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > Thanks and Regards,
>>> >
>>> > Ajay Garg
>>> > Dextrose Developer
>>> > Activity Central: http://activitycentral.com
>>>
>>
>>
>>
>> --
>> Regards,
>>
>> Ajay Garg
>> Dextrose Developer
>> Activity Central: http://activitycentral.com
>>
>
>


-- 
Miguel González
Activity Central: http://www.activitycentral.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.laptop.org/pipermail/server-devel/attachments/20130906/58ae0dcf/attachment.html>


More information about the Server-devel mailing list