Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows support #1

Open
ipmb opened this issue Oct 21, 2022 · 1 comment
Open

Windows support #1

ipmb opened this issue Oct 21, 2022 · 1 comment
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@ipmb
Copy link
Member

ipmb commented Oct 21, 2022

I'd like to support Windows (gunicorn doesn't work there), but I don't have any experience running Django on it.

How are folks deploying Django projects to Windows? Is waitress the app server of choice or something else?

@ipmb ipmb added help wanted Extra attention is needed question Further information is requested labels Oct 21, 2022
@kokhoor
Copy link

kokhoor commented Oct 22, 2022

I have deployed django using waitress + WhiteNoise running as a Windows Service, but it hasn't really undergone any stress / performance testing, as the no of users are still quite low, but we found the performance reasonable, but more importantly, the setup was simple. Below is a snippet if it helps (may not run as it is as I had taken off some bits customized for our folders).

import os

from waitress.server import create_server
from whitenoise import WhiteNoise

from [YOUR_SETTINGS_APP_FOLDER].wsgi import application

BASE_DIR = os.path.dirname(os.path.abspath(__file__))
static_folder = os.path.join(BASE_DIR, 'static')

application = WhiteNoise(application, root=static_folder)
application.add_files(static_folder)
server = create_server(application, host='0.0.0.0', port=80)
server.run()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants