how to run a gunicorn commad for this python app and

this is my file app.py on root folder
from app import create_app, db, socketio

if name == ’main’:
flaskapp = createapp(‘dev’)
with flaskapp.appcontext():
db.createall()
socketio.run(flask
app)

this is my directory structure
./app:
auth chats likes notifications pycache tags
blocks init.py main package_template static visitors

./app/auth:
forms.py pycache settingsroutes.py
_
init_.py resetroutes.py templates
models.py routes.py update_routes.py

./app/auth/pycache:
forms.cpython-37.pyc routes.cpython-37.pyc
init.cpython-37.pyc settingsroutes.cpython-37.pyc
models.cpython-37.pyc update
routes.cpython-37.pyc
reset_routes.cpython-37.pyc

./app/auth/templates:
404.html admin.html login.html reset.html setup.html
429.html forgot.html registration.html settings.html

./app/blocks:
forms.py init.py models.py pycache routes.py templates

./app/blocks/pycache:
init.cpython-37.pyc models.cpython-37.pyc routes.cpython-37.pyc

./app/blocks/templates:
blacklist.html

./app/chats:
forms.py init.py models.py pycache routes.py templates

./app/chats/pycache:
init.cpython-37.pyc models.cpython-37.pyc routes.cpython-37.pyc

./app/chats/templates:
chats.html

./app/likes:
forms.py init.py models.py pycache routes.py templates

./app/likes/pycache:
init.cpython-37.pyc models.cpython-37.pyc routes.cpython-37.pyc

./app/likes/templates:
whitelist.html

./app/main:
forms.py init.py models.py pycache routes.py templates

./app/main/pycache:
forms.cpython-37.pyc models.cpython-37.pyc
init.cpython-37.pyc routes.cpython-37.pyc

./app/main/templates:
home.html layout.html user_profile.html

./app/notifications:
forms.py init.py models.py pycache routes.py templates

./app/notifications/pycache:
init.cpython-37.pyc models.cpython-37.pyc routes.cpython-37.pyc

./app/notifications/templates:
notifications.html

./app/packagetemplate:
forms.py _
init__.py models.py routes.py

./app/pycache:
init.cpython-37.pyc

./app/static:
css favicon.ico img script

./app/static/css:
style.css

./app/static/img:
404-error-graphic.png background2.jpeg background.jpeg heart.png
429-error-graphic.png background3.jpeg Blank-Headshot.jpg

./app/static/script:
bio.js chats.js report.js
block.js filter.js sort.js
changeage.js like.js tags.js
change
gender.js locate.js togglepictures.js
change
loc.js notifications.js uploadviewpictures.js
change_preference.js polling.js

./app/tags:
forms.py init.py models.py pycache routes.py templates

./app/tags/pycache:
forms.cpython-37.pyc models.cpython-37.pyc
init.cpython-37.pyc routes.cpython-37.pyc

./app/tags/templates:
setuptags.html tagsmacros.html

./app/visitors:
forms.py init.py models.py pycache routes.py templates

./app/visitors/pycache:
init.cpython-37.pyc models.cpython-37.pyc routes.cpython-37.pyc

./app/visitors/templates:
visitors.html

./config:
dev.py prod.py test.py

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hello,

Have you managed to get this fixed?

I would recommend starting with this tutorial here:

https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04

by Justin Ellingwood
Django is a powerful web framework that can help you get your Python application or website off the ground. Django includes a simplified development server for testing your code locally, but for anything even slightly production related, a more secure and powerful web server...
Submit an Answer