nginx

How to download file using django as backend and nginx

How to download file using django as backend and nginx Question: I have a filefield in a document model from which i can upload files like this document=models.FileField(max_length=350 ,validators=[FileExtensionValidator(extensions)]) uploading is working good, now i want to implement download feature for the frontend, but only those files which are uploaded by the user. using url …

Total answers: 1

How do I configure nginx to serve static files from an AWS S3 bucket?

How do I configure nginx to serve static files from an AWS S3 bucket? Question: I’m currently deploying a simple flask web application with nginx as my reverse proxy sitting between my WSGI and users. However, I don’t want to store static files(specifically images) on my VPS because storage space will start to get expensive …

Total answers: 1

Static files not loading using nginx and docker

Static files not loading using nginx and docker Question: I’m having approximately the same error as in this question, as concerning Django, all my pages are loaded correctly but not my static files. I guess it has something to do with an error in my configuration files, however even though I’ve been searching for quite …

Total answers: 1

Gunicorn: UndefinedTable: relation "user" does not exist

Gunicorn: UndefinedTable: relation "user" does not exist Question: Here is the scenario, I’m deploying the Django app on an ec2 instance. I’m following this guide Digitalocean deployment guide. when I run my app using python manange.py runserver 0.0.0.0:800 and access the admin portal via http://server-ip-address:8000. everything works fine. But when I run gunicorn –bind 0.0.0.0:8000 …

Total answers: 2

missing http headers in web server

missing http headers in web server Question: Am using BaseHTTPRequestHandler http server and copy/pasted the code from the interwebs. Here’s the part where the response/header is set class S(BaseHTTPRequestHandler): def _set_response(self): self.send_response(200) self.send_header(‘Content-type’, ‘text/html’) self.end_headers() But when calling the server with curl the response is: curl: (1) Received HTTP/0.9 when not allowed When calling through …

Total answers: 2

Dryscrape "Can Not Find XVFB" Error on Nginx & Ubuntu Server 18.04

Dryscrape "Can Not Find XVFB" Error on Nginx & Ubuntu Server 18.04 Question: I need a help about Dryscrape and XVFB. I’m using Dryscrape on my Flask application for web scraping from a javascript page. If I serve it with python3 main.py and the app config app.run(host="0.0.0.0") everything works great at port 5000. But I …

Total answers: 1

What is the difference between the two ways for launching flask?

What is the difference between the two ways for launching flask? Question: I have used two ways to launch a Flask application use python app.py directly use gunicorn -w 1 -b localhost:5000 app:app Then I printed the call stacks,I know the second way is better because it uses a wsgi server and can be used …

Total answers: 1

Deploy a flask application alongside a Django application with uwsgi + nginx

Deploy a flask application alongside a Django application with uwsgi + nginx Question: I’m trying to deploy a simple flask app in a server where is currently deployed a django app. The django app works okay, but with the flask app shows 404 error, although I’ve done the correct settings and I don’t see any …

Total answers: 1

Django and Flask on same nginx server

Django and Flask on same nginx server Question: I currently have a Djago app running on my main site when I visit mysite.com. However, I’d like mysite.com/flaskapp to run a separate Flask application. I’m able to set up two nginx site-enabled config files and run each app on a different port but, for various reasons, …

Total answers: 1