0

I am trying to host my django app using heroku and waitress package in windows environment. I have defined the profile for running wsgi application . Where do I need to define the correct port and run the heroku app?

This is for a new windows server running django app and heroku. In the past, I have tried on defining various port numbers on procfile to run the app,but it not worked and shows error on permission.

Procfile:

web: waitress-serve --port=80  ACE:wsgi.application

I expect the django app to run on heroku inn browser, using command

-heroku local web

The output which I got is:

[OKAY] Loaded ENV .env File as KEY=VALUE Format
16:15:41 web.1   |  Traceback (most recent call last):
16:15:41 web.1   |    File "c:\users\ramakrishnan_k\appdata\local\programs\python\python36-32\lib\runpy.py", line 193, in _run_module_as_main
16:15:41 web.1   |      "__main__", mod_spec)
16:15:41 web.1   |    File "c:\users\ramakrishnan_k\appdata\local\programs\python\python36-32\lib\runpy.py", line 85, in _run_code
16:15:41 web.1   |      exec(code, run_globals)
16:15:41 web.1   |    File "C:\Users\ramakrishnan_k\AppData\Local\Programs\Python\Python36-32\Scripts\waitress-serve.exe\__main__.py", line 9, in <module>
16:15:41 web.1   |    File "c:\users\ramakrishnan_k\appdata\local\programs\python\python36-32\lib\site-packages\waitress\runner.py", line 279, in run
16:15:41 web.1   |      _serve(app, **kw)
16:15:41 web.1   |    File "c:\users\ramakrishnan_k\appdata\local\programs\python\python36-32\lib\site-packages\waitress\__init__.py", line 11, in serve
16:15:41 web.1   |      server = _server(app, **kw)
16:15:41 web.1   |    File "c:\users\ramakrishnan_k\appdata\local\programs\python\python36-32\lib\site-packages\waitress\server.py", line 85, in create_server
16:15:41 web.1   |      sockinfo=sockinfo)
16:15:41 web.1   |    File "c:\users\ramakrishnan_k\appdata\local\programs\python\python36-32\lib\site-packages\waitress\server.py", line 229, in __init__
16:15:41 web.1   |      self.bind_server_socket()
16:15:41 web.1   |    File "c:\users\ramakrishnan_k\appdata\local\programs\python\python36-32\lib\site-packages\waitress\server.py", line 360, in bind_server_socket
16:15:41 web.1   |      self.bind(sockaddr)
16:15:41 web.1   |    File "c:\users\ramakrishnan_k\appdata\local\programs\python\python36-32\lib\site-packages\waitress\wasyncore.py", line 369, in bind
16:15:41 web.1   |      return self.socket.bind(addr)
16:15:41 web.1   |  OSError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions
16:15:41 web.1   |  C:\Users\ramakrishnan_k\Desktop\Dock\static/ static path
16:15:41 web.1   |  C:\Users\ramakrishnan_k\Desktop\Dock\media media rooot
16:15:41 web.1   Exited with exit code 1

which is wrong.

The expected output as it should give u okay status with env and procfile status and run the heroku app in browser.

Sahil
  • 1,387
  • 14
  • 41
priya
  • 158
  • 5
  • 16
  • What does "using heroku... in windows environment" mean? I see that you're using [`heroku local`](https://devcenter.heroku.com/articles/heroku-local#run-your-app-locally-using-the-heroku-local-command-line-tool-start-your-app-locally), but I also see that you're on a Windows server, and that you're trying to use a standard HTTP port. Is this for development or production? – ChrisGPT was on strike Sep 06 '19 at 15:55
  • (I'm asking because `heroku` isn't a web server that you'd run on your own machine. It's a command-line tool meant to interact with the production platform-as-a-service product at heroku.com. `heroku local` _definitely_ isn't production-ready.) – ChrisGPT was on strike Sep 07 '19 at 14:05
  • runinng heroku in windows environment – priya Sep 09 '19 at 12:38
  • unable to fix socket error – priya Sep 09 '19 at 12:38
  • I still think you're misunderstanding what `heroku` is. It's not something that you should be running anywhere but in development. It doesn't "run on" Windows in the sense of being a web server. It's just a tool to interact with the service running on heroku.com. There are _very_ few valid reasons (I can't think of a single one) for trying to have it listen on port 80. – ChrisGPT was on strike Sep 09 '19 at 17:01
  • Are you trying to run your application on Windows like you might with IIS or Nginx? – ChrisGPT was on strike Sep 09 '19 at 17:02

0 Answers0