question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cannot use custom uwsgi.ini in flask app

See original GitHub issue

Hi tiangolo!

I’ve been working around with your docker image to deploy my python application. Things were fine until I tried customizing uwsgi.ini file.

First of all, following is my flask project architecture.

screen shot 2018-02-07 at 4 45 49 pm

Inside my Dockerfile includes following lines.

FROM tiangolo/uwsgi-nginx-flask:python3.6
COPY ./app /app
COPY ./app/conf/nginx.conf /etc/nginx/
COPY ./uwsgi.ini /app/uwsgi.ini
COPY ./requirements.txt /app/
RUN pip install -r /app/requirements.txt
ENV UWSGI_INI /app/uwsgi.ini

and I also tried with following Dockerfile.

FROM tiangolo/uwsgi-nginx-flask:python3.6
COPY ./app /app
COPY ./app/conf/nginx.conf /etc/nginx/
COPY ./uwsgi.ini /app/uwsgi.ini
COPY ./requirements.txt /app/
RUN pip install -r /app/requirements.txt
ENV UWSGI_INI /app/uwsgi.ini
WORKDIR /app

My custom uwsgi.ini is as follows.

[uwsgi]
module = main
callable = app
lazy-apps = true
processes = 1

If I run a docker container with above image, I see following logs.

screen shot 2018-02-07 at 4 57 35 pm

Thanks in advance!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Jun 29, 2018

If it can help, I solved by replace :

from flask.ext.mongoengine import MongoEngine

by :

from flask_mongoengine import MongoEngine

1reaction
higeecommented, Feb 18, 2018

Thanks for the comment!! I’ll go over the links you’ve attached! And since I’m done with this specific issue, I think it’s better to close it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can not reach Flask app served with uWSGI and Nginx
Then I use this command to start the app: uwsgi --ini uwsgi.ini. The message returned is. WSGI app 0 (mountpoint='') ready in 9...
Read more >
uWSGI cannot find “application” using Flask and Virtualenv
This is the error im getting using uwsgi on my webserver *** Operational MODE: single process *** ModuleNotFoundError: No module named 'app' ...
Read more >
How To Serve Flask Applications with uWSGI ... - DigitalOcean
In this guide, we will be setting up a simple Python application using the Flask microframework on Ubuntu 18.04. The bulk of this...
Read more >
Deploy Flask Applications with uWSGI and Nginx
Host Python apps on your own server. Set up uWSGI to serve your app concurrently while handling incoming traffic with Nginx.
Read more >
Serving Flask Applications with uWSGI - jdhao's digital space
Save this file as uwsgi.ini (or whatever you like), and then run the application using uwsgi --ini uwsgi.ini . If the extension of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found