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.
Related
We are developing an application using Vue.js and Django. The essence of the application: accept user requests from the form, send them for approval to the backend and send an answer to the frontend. On the localhost everything is already organized and working. Now our frontend is on firebase and I want to deploy my backend part somewhere. So, can I use firebase for deploying my part? Š’ecause I met different ambiguous answers to this question
You cant, I guess you are using Django Rest Framework with Vue.js. So you need deploy your back-end to some machine. You can choose any hosting which can propose you Linux machine. GoogleCloud, DigitalOcean, AWS, Heroku and a lot of others..
I like AWS (In your case as a new user you can run free EC2 for 12-month, if you do not need a lot of performance)
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,
i'ev finished making a chatbot web application using Django and python3 and during the development phase i was using the:
python3 manage.py runserver
to see the results and test the application. Now i want for the application to entered like any other website publicly using URL.
any recommendation for deploying the django project?
thank you?
Depends on your hosting provider. Heroku is a good choice, it has a free pricing tier but that tier brings the VMs down if not used regularly.
https://devcenter.heroku.com/articles/deploying-python
It may be a good idea to start with the official documentation: https://docs.djangoproject.com/en/1.10/howto/deployment/
I have been working with Azure's web app service using Resource Manager to deploy a Django app. It has been working in fits and starts. I really like the auto-deployment from GitHub but I have been frustrated by the ability to work with the underlying machine. There is a "Console" tool through the Azure portal but it has limited functionality and when there is an internal server error on my app, I can't find the server output log.
Can someone share insight into how to view the server logs?
Azure web apps have a number of logs however, the applications logs provided out of the box only support Asp.Net applications. That being said there is an article about django on web apps and how to store and view its logs here.
What'll you'll have to do, as described in the link, is to setup the django application to store its logs on the azure file system. Another option is to setup the django application to email the devs but the better option is to store the logs on the file system properly.
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.