Skip to content

Hello World from uwsgi to test virtualenvironments.

License

Notifications You must be signed in to change notification settings

MarcelFox/hello-wsgi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hello-wsgi:

It's a simple 'hello world' app based on uwsgi and Python3.


Deploy?

You must set up a virtualenv with Python3 and uwsgi. It'll be easier if you use virtualenvwrapper:

# mkvirtualenv --python="/usr/bin/python3" -i uwsgi venv

Ok, now what?

You must have noticed that if you've used virtualenvwrapper to create a new venv, it will activate your venv for you. So, once inside your venv, all you have to do is run our 'uwsgi.ini' file:

# uwsgi --ini="uwsgi.ini"

Running, but...

I have to explain it all, right? Ok, ok! If you got no errors, then go to your web browser and check http://localhost:8080 .

It's important to take a look at our 'uwsgi.ini' file:


[uwsgi]

chdir           = %v
#               '%v' indicated the vassals directory (pwd)

pidfile         = /tmp/uwsgi.pid
#               You can kill it using 'kill $(cat /tmp/uwsgi.pid)'

http            = 0.0.0.0:8080
#               You can use a socket file instead:
#               socket         = /tmp/uwsgi.sock

chmod-socket    = 666

module         = hello
#               Instead of 'module' you can also use:
#               wsgi-file       = hello.py


vacuum          = true
#               'vacuum' will clear the socket file 

daemonize       = hello_daemon.log                                 

Beyond:

pip install flask

=)


That's all folks!

About

Hello World from uwsgi to test virtualenvironments.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages