Python Forum
Nginx Setup Django Postgresql Eclipse - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Nginx Setup Django Postgresql Eclipse (/thread-2595.html)



Nginx Setup Django Postgresql Eclipse - Adelton - Mar-27-2017

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


RE: Nginx Setup Django Postgresql Eclipse - nilamo - Mar-27-2017

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?


RE: Nginx Setup Django Postgresql Eclipse - Adelton - Mar-27-2017

yes I am talking about virtualenv


RE: Nginx Setup Django Postgresql Eclipse - snippsat - Mar-27-2017

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/