Python Forum

Full Version: Nginx Setup Django Postgresql Eclipse
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi There,

I am new to python and I have been having difficulties setting up a development environment .I want to setup a Django Project in eclipse using postgresql and nginx as server.I have downloaded nginx and postgresql as well.I having issues configuring the config file for nginx for static and dynamic content .I want to use a virtual environment for the project.Your help with regards to how to efficient setup a development environment would be much appreciated.Do I use uswgi or fastcgi for python.I think it is not possible to install uswgi on windows.

Thank you 

Adelton
When you say you're using a virtual environment, are you talking about virtualenv, or about a virtualized system using something like docker/virtualbox?

Because if it's the second, why would you need to install uswgi on windows?
yes I am talking about virtualenv
You don't mess with Nginx,Gunicorn,uWSGI on Windows.
You set up Django Project with PostgreSQL no problem this work fine in Windows.
So you work with Django build web-server all the way to the end,
if you happy with result and want to deploy now you installed eg Gunicorn,Nginx, on host server.
So now leave Window and the build in web server behind.

For Digital Ocean that use most,you start with a blank Linux Distro.
So as a demo how it look(install not all server setup):
ssh [email protected]

# Install Python and Ngnix
sudo apt-get update
sudo apt-get install python3-pip python3-dev nginx

# Make Virtual enviroment
mkdir whatip
cd whatip
sudo ufw allow 5000 #Open port
virtualenv ipenv
source ipenv/bin/activate
------------------
# Install Django Gunicorn PostgreSQL into Virtual enviroment
pip install gunicorn django psycopg2

/whatip/ipenv$ nano app_test.py
python app_test.py
# In browser:
http://xx.xx.250.200:5000/