recommended fcgi way for django 1.6 on windows? Problems with https

83 views
Skip to first unread message

anton

unread,
Apr 8, 2014, 1:09:54 PM4/8/14
to django...@googlegroups.com
Hi ,

I use:
- windows 7 64 bit
- python 2.7.6 (32bit)
- apache 2.4.9 (32bit vc9 build from apachelounge)
- django 1.6.2
- flup for fcgi ( noted as prerequisite in django docs)

I use flup for running django as fcgi,
unfortunately I have the problem that
my django app runs fine with http but not with https.

I saw that in https mode the request.path
variable in my view is not '/mydjangoapp/' (like in http mode)
but '/mydjangoapp/mydiangoapp/'.

So the links which are calculated with the reverse("myapp.myview") function
are wrong.

I looked a bit in flup bit did not fully understan why it builds the
request.path variable the way it does (add least in https mode
the apache does not create a SCRIPT_URL = the env["SCRIPT_URL"] in flup
is empty, and this seems to cause the problem).

my questions are now:
- Is there any special point to take care about when using https?
- is there another reccomended way to do fcgi (on windows)??

I ask this because flup seems *dead*, and the flup website
is down since *months* now (at least it was down every time I tried to
access the flup trac).

So what is the future for django and fcgi on windows,
or will this functionality be integrated in django 1.7 (would be nice).

Thanks

anton


Russell Keith-Magee

unread,
Apr 8, 2014, 6:13:21 PM4/8/14
to Django Users
There *is* no future for FCGI on Django, on Windows or any other operating system. We've deprecated support for FCGI, and will be removing support for FCGI in the Django 1.9 release.

Third party projects may choose to maintain support for FCGI wrappers to Django, but that will be outside the official project.

If you want to deploy a Django site, you should be using WSGI. A wide range of servers and service providers support WSGI; However. I can't comment on which ones are especially good or bad under Windows.

Yours,
Russ Magee %-)

anton

unread,
Apr 10, 2014, 3:31:47 PM4/10/14
to django...@googlegroups.com
Russell Keith-Magee wrote:

> On Wed, Apr 9, 2014 at 1:09 AM, anton <ant...@gmx.de> wrote:
>
>> Hi ,
>>
>> I use:
>> - windows 7 64 bit
>> - python 2.7.6 (32bit)
>> - apache 2.4.9 (32bit vc9 build from apachelounge)
>> - django 1.6.2
>> - flup for fcgi ( noted as prerequisite in django docs)
>>
>> I use flup for running django as fcgi,
>> unfortunately I have the problem that
.. snip snip cot off
>>
>> So what is the future for django and fcgi on windows,
>> or will this functionality be integrated in django 1.7 (would be nice).
>>
>
> There *is* no future for FCGI on Django, on Windows or any other operating
> system. We've deprecated support for FCGI, and will be removing support
> for FCGI in the Django 1.9 release.
>
> Third party projects may choose to maintain support for FCGI wrappers to
> Django, but that will be outside the official project.
>
> If you want to deploy a Django site, you should be using WSGI. A wide
> range of servers and service providers support WSGI; However. I can't
> comment on which ones are especially good or bad under Windows.
>
> Yours,
> Russ Magee %-)
>

Hi Russ,

thanks for the advise, I didn't know that fcgi is deprecated.
I thought its nicer to use so I can have different
apps ( = parts of my web intranet portal) running as
- complete independent django instances
- with different ( = independent) databases

So if I have to do some more critical changes in one part of my
web portal I can shutdown only the one fcgi service do the work
and start it later again.

-> the rest of the services are not touched.

I am not sure if this is possible with wsgi.

I use apache 2.4.9 on windows with the modwsgi
but I am unsure about the modwsgi for apache
(http://code.google.com/p/modwsgi/)
because the last code change is from october 2012
so it seems a little bit "abandonware".

(I looked at uwsgi, but it runs only on Linux/unix)

Is there any (even "semi") official best way to run django on windows
(which is up to date)?

Or is windows officially not supported for production?

Thanks

Anton
of

Russell Keith-Magee

unread,
Apr 10, 2014, 9:06:59 PM4/10/14
to Django Users
To be clear - FCGI isn't deprecated; Django's support for FCGI is
deprecated. I'm sure FCGI will continue to be used; it just won't be
used or actively supported by Django.

> I thought its nicer to use so I can have different
> apps ( = parts of my web intranet portal) running as
> - complete independent django instances
> - with different ( = independent) databases
>
> So if I have to do some more critical changes in one part of my
> web portal I can shutdown only the one fcgi service do the work
> and start it later again.
>
> -> the rest of the services are not touched.
>
> I am not sure if this is possible with wsgi.

It certainly is - that's exactly what WSGI was designed to achieve.
Each "site" or "service" can have a separate WSGI definition inside a
single web server; each WSGI definition can point to a different
database, and/or a different Django instance, or even at a site
implemented in a different web framework.

> I use apache 2.4.9 on windows with the modwsgi
> but I am unsure about the modwsgi for apache
> (http://code.google.com/p/modwsgi/)
> because the last code change is from october 2012
> so it seems a little bit "abandon ware"

It hasn't been modified because it hasn't needed modification. To the
best of my knowledge, Graham Dumpleton is still actively supporting
mod_wsgi.

> (I looked at uwsgi, but it runs only on Linux/unix)
>
> Is there any (even "semi") official best way to run django on windows
> (which is up to date)?

> Or is windows officially not supported for production?

*Django* supports Windows; however, I'm not in a position to provide
advice on the selection of production web servers under Windows. My
completely uninformed suggestion would be to use Apache, but that's
only based on the fact that it has a long history. There may well be
better options.

Yours,
Russ Magee %-)

anton

unread,
Apr 14, 2014, 12:48:55 PM4/14/14
to django...@googlegroups.com
Hi

I did a test with modwsgi on windows with apache,
http and https work now both.

Thanks :-)

*BUT*: the modwsgi does not support Daemonmode on windows,
which means that I need to restart the whole apache Server every time
I update my django app.

For a real productionserver its a nightmare, if there are different apps
hosted.

Perhaps I find a solution .. :-(

Anton


Andre Terra

unread,
Apr 14, 2014, 1:47:12 PM4/14/14
to Django users
I've used nginx in windows with great results. In fact, I even compiled it on cygwin with additional modules (namely, to track large file uploads) and everything worked smoothly.


Cheers,
AT




--
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/lih3hn%24sn4%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.

anton

unread,
Apr 15, 2014, 4:16:03 PM4/15/14
to django...@googlegroups.com
I also looked at nginx which is quite nice,

but now I found the mod_authn_ntlm SSPI win32 module
for apache

http://www.apachelounge.com/viewtopic.php?p=25073

which finally alows me to do SingleSigneOn on windows,
and it works :-)

for nginx I did not find such a module
(I saw something outdated somewhere)

But you are right nginx is nice too

Anton

Mike Dewhirst

unread,
Apr 15, 2014, 6:06:37 PM4/15/14
to django...@googlegroups.com
On 16/04/2014 6:16 AM, anton wrote:
> I also looked at nginx which is quite nice,
>
> but now I found the mod_authn_ntlm SSPI win32 module
> for apache
>
> http://www.apachelounge.com/viewtopic.php?p=25073
>
> which finally alows me to do SingleSigneOn on windows,
> and it works :-)

I had a client who used single-signon for their staff convenience. It
was driven by their CEO. Their (php) intranet was hacked and all their
logins were compromised. Probably sold on the black market. They had to
dismantle single-signon and implement a new policy in a hurry to mandate
separate logins for different systems in case they are hacked in future.

It was ugly. My advice is to develop a contingency plan based on all
foreseeable hacks.

All the best

Mike
Reply all
Reply to author
Forward
0 new messages