wsgi vs. debug server URL's

54 views
Skip to first unread message

Sells, Fred

unread,
Nov 12, 2013, 12:42:06 PM11/12/13
to django...@googlegroups.com

We deploy with Apache and it serves both django and generic html.  We are a small shop with internal applications and minimal server load and we are not ready to have a django server and an html server.

 

I use the /wsgi  prefix in my url’s to identify what goes to django (via the httpd wsgi.conf file)

 

When I deploy with wsgi in production my urls look like  http://myserver.mydomain.com/wsgi/myapp

 

But when running the debug server I get http://localhost/myapp

 

Is there a clean way to handle this without having to define the “/wsgi” prefix and use it conditionally based on whether I’m Unix (production) or Windows (debug)???

Avraham Serour

unread,
Nov 12, 2013, 1:21:04 PM11/12/13
to django...@googlegroups.com
it seems to me that this is on your apache configuration nothing to do with django or your application


--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/DCD75728F460F14586086EA606E83082E71EA5D3%40ACEVXCHMBX1001.ADVENTISTCORP.NET.
For more options, visit https://groups.google.com/groups/opt_out.

Alex Mandel

unread,
Nov 12, 2013, 1:34:00 PM11/12/13
to django...@googlegroups.com
Actually you could modify the project settings.py or urls.py to enforce
that url on the debug servers. This means that the project files will be
different but the app files will be the same between dev and production.

But that's really odd way of doing it, normally on a production server
you wouldn't want to advertise /wsgi to end users. I'd encourage you to
rethink your apache config too.

Enjoy,
Alex

On 11/12/2013 10:21 AM, Avraham Serour wrote:
> it seems to me that this is on your apache configuration nothing to do with
> django or your application
>
>
> On Tue, Nov 12, 2013 at 7:42 PM, Sells, Fred
> <fred....@adventistcare.org>wrote:
>
>> We deploy with Apache and it serves both django and generic html. We
>> are a small shop with internal applications and minimal server load and we
>> are not ready to have a django server and an html server.
>>
>>
>>
>> I use the /wsgi prefix in my url�s to identify what goes to django (via
>> the httpd wsgi.conf file)
>>
>>
>>
>> When I deploy with wsgi in production my urls look like
>> http://myserver.mydomain.com/wsgi/myapp
>>
>>
>>
>> But when running the debug server I get http://localhost/myapp
>>
>>
>>
>> Is there a clean way to handle this without having to define the �/wsgi�
>> prefix and use it conditionally based on whether I�m Unix (production) or

Daniel Roseman

unread,
Nov 13, 2013, 8:44:17 AM11/13/13
to django...@googlegroups.com
There's no need to insert the prefix at all. As long as you consistently use the {% url %} tag (or the reverse() function) throughout your application to calculate URLs, Django will take account of the WSGI server prefix and use it properly.
--
DR.
Reply all
Reply to author
Forward
0 new messages