i have some reasons witch i am stuck to use django on windows machine. i was wondering how to configure django on a windows sesrver 2012 r2 with iis 8.5. so i followed the tutorial here.
i did what the tutorial says and it is pretty much straight forward what i am gonna do for any kind of application i want to run with iis.
but i get the following error the fastcgi process exited unexpectedly.
here is what i have provided as executable for wfastcgi module:
E:\venvs\...\Scripts\python.exe|E:\venvs\...\Lib\site-packages\wfastcgi.py
i removed the wfastcgi.py part after | from handler mapping and error changed to script processor could not find the config for fastcgi configuration and i figured out the error must be related to the wfastcgi.py file. but i could not find the issue here. so i was wondering what can be the issue? and what are my options are here.
has any one been able to use django on a windows machine?? jsut in case my python version is python 3.6
I had the exact same problem as you but managed to solve this by using Python 3.4.2 version. Follow the exact steps as described in this tutorial Django with IIS and avoid using Python 3.5 or above because it seems that there are compatibility issues. The stack I used was IIS version 10, Windows 10, Python 3.4.2 and Django 1.11.2.
Upgrading wfastcgi to the latest version
pip install wfastcgi --upgrade
solved it for me: Python 3.6.6, wfastcgi 3.0.0
In my Case I was facing the same issue i.e. enter image description here
Mine is a Django App used for APIs that queries data from back-end platforms. This issue was only for specific filters that the API was using in queries while for other values in filters it worked great.
My Config file did not have a fastCgi tag and I added below mentioned part to top of system.webServer in config file. Yes off course it gave few errors here and there corresponding to activityTimeout and requestTimeout. Tried increasing up-to 900 and 601 respectively and then it worked for me. But could not understand cause of the issue as query that API was running for which i was facing this issue was not taking that long at all. I would like to understand that.
<fastCgi>
<application fullPath="D:\Python34\python.exe|D:\Python34\Scripts\wfastcgi.py"
arguments=""
maxInstances="4"
idleTimeout="300"
activityTimeout="900"
requestTimeout="601"
instanceMaxRequests="10000"
protocol="NamedPipe"
flushNamedPipe="false">
</application>
</fastCgi>
Related
So I've been tasked with upgrading a Django server from 1.6.2 to the latest (~1.8), along with upgrading Python from 2.7.3 to 3.3. I suspect this is going to break quite a bit of code. (I even need to upgrade the Ubuntu installation from 12.04 to 14.04)
I would like to migrate my Django app from the server it's currently running on (Ubuntu 12.04) to a virtual machine, and use that environment as a sandbox to make changes.
Would anyone be so kind to provide guidance on django app migration? Please let me know if you'd like me to provide any specific details.
Thank you.
Edit: If anyone would like to vote down this question because they believe I haven't done enough research, I'm very happy to add missing information, if I know what you're looking for.
Django versions from 1.5 onwards has been designed so that the same code will work on both versions of Python as in the documentation thanks to them following the six compatibility layer.
You might face some issues with code that isn't strictly related to Django components like print statements and other such parts that might have been coded in. The official Python Porting Guide should held you with that.
Django 1.8 is a LTS (Long Term Release) so it's a good idea to upgrade to it. Migrating the database might be a bit of an issue considering it's from 2.7 to 3.4 but that's in all likelihood the place you'll find most issue with. The How to Migrate is a great resource.
If I recall correctly the directory structure is a bit different in 1.6 so you'll have to move some code and files manually. I suggest having the tutorial pages for both versions 1.6 and 1.8 open and comparing the directory structure.
Going through the first 2 pages of the tutorial should give you enough of an overview to migrate the database and the settings file. This should also help with migrations.
The 3rd and 4th pages should get you through migrating the views and urls files.
The only thing I'm not familiar with is the migration of the wsgi file which has configuration information, you should be able to find some basic information about that here.
Updating your Ubuntu however won't change or affect anything at all.
Also as has been said in the comments by jape and joel, it's a good idea to use virtualenv and git.
I would like to add another suggestion based on my own experience with pushing code to a Django server :
Download the code base to your local machine and work there and once you're done and the server is working well on your machine push it all to the server at once. That way you can isolate server machine specific issues from coding issues.
Firstly, the OS I am working in is Fedora 20.
It seems like every way that is mentioned using Django and Apache is either deprecated, or there is no documentation at all.
I have tried mod_wsgi, and I have it all installed, but there is conflicting documentation. One says you should have a django.wsgi (old Django has this), and more recent documentation say you should have wsgi.py. I have tried both methods and all sorts of different things in the httpd.conf file, nothing works, and it all comes back with Forbidden. Also when just trying the Hello World script it always return an internal server error.
I then tried uwsgi. I can use this to get a uwsgi server up, and this seems to basically work in a similar fashion to just using python3 manage.py runserver, so I installed mod_proxy_uwsgi module for Apache, and there is absolutely no documentation on using this, so I just did something like ProxyPass / wsgi//localhost:8000/ in the httpd.conf. All this does is also returning an internal server error.
The main answer I want is: How exactly do I deploy a Django 1.6 project that uses Python 3, onto Apache?
This didn't work for you? It is listed under Django 1.6... then again, Python 3.x is still kind of iffy for a lot of stuff.
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/modwsgi/
This has been resolved. As it turns out, SELinux was blocking httpd from accessing my Django project. I just used the following command then restarted the computer:
setsebool -P httpd_read_user_content 1
setsebool -P httpd_enable_homedirs 1
This will allow MOD_WSGI to work properly for deployment.
I am looking at getting python up and running with my WAMP setup.
I need it to test some py apps I am learning to build.
I see that Mod_wsgi project was terminated and that was pretty much the only way I found on how to run python on WAMP.
Can anyone advise how to get it up and running?
Thank you so much
mod_wsgi is an active, working project, and you have essentially answered your own question, you should use it.
You may have been thinking of mod_python, a different, discontinuted project that has been superseeded by mod_wsgi.
I would suggest you follow this guide.
I have been using this guide http://tinyurl.com/mercurial-iis to attempt to setup Mercurial on IIS 7. I have followed every step however when I try to access the site I get the following error:
Error Summary
HTTP Error 500.0 - Internal Server Error
There is a
problem with the resource you are
looking for, so it cannot be
displayed.
Detailed Error Information
Module IsapiModule
Notification ExecuteRequestHandler
Handler Mercurial-ISAPI
Error Code 0x8007007e
Requested URL http://localhost:81/
Physical Path C:\inetpub\hg
Logon Method Anonymous
Logon User Anonymous
I am using the following setup:
Windows Server 2008 SP2 x64 OS
IIS7
Python 2.6.6 32bit
Mercurial 1.7.5 32bit
pywin32-215
I would recommend dropping the ISAPI and try going down the CGI route. That's what we did - and it has been working flawlessly. It's not like the performance difference is going to be noticeable anyway.
Useful links:
http://www.jeremyskinner.co.uk/mercurial-on-iis7/ (we followed this guide almost religiously)
http://vampirebasic.blogspot.com/2009/06/running-mercurial-on-windows.html
http://www.endswithsaurus.com/2010/05/setting-up-and-configuring-mercurial-in.html
How to setup Mercurial and hgwebdir on IIS?
1.7.1+ changed a few things that aren't reflected in most of the links floating around. Try this tutorial that I posted a while back, it seems like a few people have been successful with it.
Has anyone tried using uWSGI with Cherokee? Can you share your experiences and what documents you relied upon the most? I am trying to get started from the documentation on both (uWSGI and Cherokee) websites. Nothing works yet. I am using Ubuntu 10.04.
Edit: To clarify, Cherokee has been working fine. I am getting the error message:
uWSGI Error, wsgi application not found
So something must be wrong with my configurations. Or maybe my application.
Yep, I just recently set this up in Ubuntu Lucid for a Pylons app.
First, I grabbed the latest cherokee from the team PPA.
https://launchpad.net/~cherokee-webserver/+archive/ppa
Next I installed the uwsgi latest into my virtualenv my app lives in via Pip which the uwsgi docs walk you through.
http://projects.unbit.it/uwsgi/wiki/Install
My app was already deployed via mod_wsgi so I was looking to reuse my .wsgi file. I ran into an issue getting the syntax for the uwsgi call right so I got some great help on their mailing list:
http://lists.unbit.it/pipermail/uwsgi/2010-June/000347.html
So I went through the docs in the cherokee cookbook and replaced the uwsgi line with a tweaked version of what was replied in my mailing list question.
It works pretty sweet and almost outperformed mod_wsgi 2x in testing hits to a simple pylons app served page.
Hope that helps.
I got cherokee + uwsgi + django running on lucid. It was a little tricky getting going (figuring out how to point uwsgi to the wsgi file was the hardest part for me, too), but I'm quite happy with the results. I documented the steps I took at http://blog.swwomm.com/2010/06/cherokee-django.html.
There seems to be an issue with the 'make' method of installation on the uwsgi docs. Use 'python uwsgiconfig.py --build' instead. That worked for me. Cherokee, Django running on Ubuntu 10.10.