Django Deployment in Local network

I have a Django application to deploy on my company’s server (local network).

I asked to create a Virtual Machine (Windows),

my questions are:

1- which is good for deployment, Windows or Linux VM?

2- Do I need to use any other software like Apache webserver or just I can run my Django server?

3- Is there anything I should do?

1 Like
  1. I have always found that deploying in Linux is easier (creates less confusion or issues) than Windows.

  2. You definitely should not use runserver. You didn’t specify how many people you expect to support, but I’d suggest either gunicorn or uwsgi. (You can get by with things in a smaller site that would cause bottlenecks or problems in larger sites.) Whether you want to run those behind something like Apache or nginx is a separate question.

  3. Definitely read Deploying Django | Django documentation | Django, and Deployment checklist | Django documentation | Django

1 Like

Many thanks
For how many users I think will be less than 50 one at a time.

so let’s say I am working on windows VM.

I think I don’t need to creat a new venv using python, I just copy my project files to this VM and install all requirements and run server.

is it right way to make in production my application?

It’s still safer to create a venv. If this is something going to be running for a while, that implies you’re going to want to keep the server patched. You may want to ensure you have more control over the application stack. It’s very low overhead and avoids a number of potential problems.

Hi, I had created this VM

I installed python and copied all my project files to this VM.
Afer running the server as :

python manage.py runserver 0.0.0.0:8888

the application works well inside the VM but when I try to access it from another PC it doesn’t open at all (11.4.6.25:8888)

This site can’t be reached 11.4.6.25 took too long to respond.

and when I run this application from my Pc it works on all other PCs and even in VM!

what is the problem here?

I found the problem solution
just go to Windows Firewall / Advance settings
and I opened a new port with 8888
Inbound Rules / New Rule, and add port number 8888.

Hey @smailt, actually I have the same deployment situation, my client’s server is a virtual server in local network Windows Server 2016 on VmWare ESXi. How did you configure Settings.py especially the database server and the mail server?

1 Like