Bill,

The URLs in the file for app1 do not have such prefix. Following are two
lines from project/app1/urls.py -- other URLs have similar structure,
including that for app2.

urlpatterns = patterns('project.app1.views',
    url(r'^$',                                  'index',
name='index'),
    url(r'^(?P<object_id>\d+)/$',               'introduction',
name='introduction'),
)


On Sat, Mar 2, 2013 at 8:49 PM, Bill Freeman <ke1g...@gmail.com> wrote:

> You haven't show project/app1/urls.py (or wherever you're getting
> project.app1.urls).  My guess is that it also specifies that each url
> begins with "app1/".  Since the root urlconf matches *and consumes* one
> "app1/" from the request path, any "app1/" required by app1's urls.py is
> required in addition.
>
> Or isn't that your question?
>
> Bill
>
> On Fri, Mar 1, 2013 at 10:57 AM, Barun Saha <barun.sah...@gmail.com>wrote:
>
>> I have two Django apps (say, app1 and app2) hosted on the same machine
>> using Apache mod_wsgi. These two apps are hosted on two different
>> environments:
>>
>>  1. On a physical server where only these two apps are hosted. They are
>> accessed as http://www.example.com/app1/app1/ and
>> http://www.example.com/app2/app2/.
>>  2. In the second environment there is a proxy server. A separate web
>> page on that server is accessed as http://www.domain.com/. This links to
>> the above two apps (now hosted on a single virtual machine) as
>> http://www.domain.com/id1/ and http://www.domain.com/id2/
>>
>> The URLconf file looks like:
>>
>>     urlpatterns = patterns('',
>>         (r'^admin/', include(admin.site.urls)),
>>         (r'^app1/', include('project.app1.urls')),
>>     )
>>
>> The problem is, this URL configurations works in the environment 1, but
>> not in the environment 2. Now, if I do something *crazy* in the environment
>> 2 such as
>>
>>      urlpatterns = patterns('',
>>         (r'^admin/', include(admin.site.urls)),
>>         (r'^app1/app1/app1/', include('project.app1.urls')),
>>         (r'^app1/app1/', include('project.app1.urls')),
>>         (r'^app1/', include('project.app1.urls')),
>>      )
>>
>> then the application works. In the env. 2, the app is accessed as
>> http://www.domain.com/id1/app1/app1/.
>>
>> I couldn't understand why we need to prefix app1 in the URL so many
>> times. In other words, why (how) this works.
>>
>> Could someone clarify on this? Also, note that all configurations need to
>> be done on the virtual machine. I don't have access to the proxy server.
>>
>> (Posted in Stackoverflow:
>> http://stackoverflow.com/questions/15159134/django-urls-with-without-proxy-server
>> )
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>>
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/g-rUctm_0oY/unsubscribe?hl=en
> .
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Thanks,
Barun Saha
JPA
IIT, Kharagpur

http://pothi.com/pothi/book/barun-saha-swapner-kheya
http://delay-tolerant-networks.blogspot.com/p/one-tutorial.html

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to