Deploying website along with web application - django

I'm in the process of researching possible ways to deploy web site along with a web application. I'm using Python/Django with gunicorn as the webserver and AngularJS (front-end) for the web application, which will be deployed on some PaaS like Heroku.
The web site (mainly used for marketing purposes), what are some recommending ways to deploy this site along with the web application? My concern is that users hitting the site will slow down performance for users of the web application. If I'm using Django for the web application backend, is it ok to use Django for the web site and deploy it...say on a different port/server? Perhaps use nginx to serve just static content for the site? What are some best practices out there on solving this? Many thanks

If your "web site" is all static files, could you load it all up into a single folder and have it served directly by nginx?
Alternatively, you could look at something like CloudFlare

Related

Can a Django project be hosted in Firebase? If yes, give me an idea

I know to host my Django projects in pythonanywhere or something else. But, I need to know is that possible to host a Django project in Firebase Hosting Services.
Firebase Hosting only supports static content. It does not give you a way to run any backend code. You can use Firebase Hosting to proxy some requests to a Cloud Functions backend, but Cloud Functions provides its own way of handling HTTP requests.

Django website running on Azure web app extremely slow

I have a django web app which I have deployed to an Azure web app (running on the B1 app service plan). The website works as intended, except for the loading time which can routinely take up to 10 minutes to load a single page (even with cached static files).
While I have not correctly set up a web hosting platform and are instead simply running the server using the default manage.py system, the website still should not be running this slowly. Is there a simple way to fix this problem?
If you running with manage.py, it may possible that you face performance issue or django web server thread issue. For performance you must configure django application with Apache2or IIS server.
Django web server is for debugging purpose only.
Recommend you to use Azure web services fir website.
Since your code runs normally on the local side, I suggest you try to change from FastCGI to httpPlatformHandler in your web.config file.You could follow this
tutorial.
In addition, please refer to this official doc to troubleshooting the performance of your Azure web app.
Optimize your code, where is blocking. I am also running website on Azure but never face slowly response even in free instance.

upload django site to the web hosting service

Hello im about the finish my first ever django website and I dont know how to upload it to the internet Bcuz I want to buy a web hosting service and to run django server I need to run a command python manage.py runserver and how is the web hosting service gonna do it? how should I upload my django website?
It's not easy to host a django project on a shared host. At least it come with a lot of problems that you have to face.
And you will need to use hostings that support a django project (Not only python). Django comes with requirements that not many hostings provide therefore i highly recommend to go with a VPS (Ubuntu for example) and host it yourself.
There is a lot of great docs for hosting a django project on a VPS and a lot of cloud services provide services for django.
Example:
How To Serve Django Applications with uWSGI and Nginx on Ubuntu 16.04
if you are fresher you need to create your on hosting service in your computer,
that is best idea for beginner,

Django app and Wordpress page on same VServer but different domains

I have one virtual server with 2 domains configured. One domain should host a wordpress page and the other domain will be a django web application.
I did some research, but I am confused. I know that for Wordpress Apache is the way to go. But for Django I often read that Nginx is the best setup.
My question is: What is the best practice in terms of web server setup when hosting 2 domains on the same (virtual) server, where one domain hosts a wordpress page and the other domain hosts a django web application?
My answer is based upon my own server. You can use Wordpress with Nginx without any problems. Personnaly, I have 2 Wordpress website and a Django web application on the same server with Nginx.
I used these documentations to set up all of this :
https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-nginx-on-ubuntu-14-04
https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-debian-8#create-a-gunicorn-systemd-service-file
I hope that this will be useful for you,
Best regards

Can I deploy CakePHP web application and BottlePy base WebServices API on same server?

I have a CakePHP based web application deployed on Apache (LAMP stack). Now I am doing a Web Services API using bottlePy that will expose services to be consumed by an Android application. The thing is both the applications will be working of the same MySql DB tables and reading/writing to the same. The reason its been done this way is because the CakaPHP based application is already available and was done a while back. Now we have a need to do an Android app and hence need to expose a Web Services API and since I am more comfortable with Python I would rather use. But before I dive deep in this direction I wanted to get answer to the following:
Can I have both the CakePHP web app and BottlePy based Web Services API served from the same Apache server? If not what will be an alternate?
Will two different apps accessing the same MySQL DB cause any issues in terms of locks, data integrity etc?
Anything else I need to be careful about?
So, I have implemented it anyways and it has been working great. I guess that answers the question, that yes it can be done.
I have both cakephp and bottlepy app served from same apache server.
I havent seen any issues and data gets written from both cakephp web app and bottlepy web api connected to android app.
Getting cakephp and bottlepy served from same apache server was a bit tricky but I got it working. I am not a webserver expert so dont know if the problems I faced were trivial or I solved something difficult. In either case it is working. If you face similar issues, let me know and I will post a detailed reply on how I did the setup.