Downloading and finally executing Flask to make it work or connecting to the web - flask

It appears that the program is already installed in Pycharm. I even created a blog about how to do it with pictures.
Nonetheless, it has been a nightmare getting to execute and finally connect on the web.
What code am I missing, I did it all thru Pycharm.

Yes, in order to Install Flask to do web apps. You must pay Pycharm Pro. This is true if you have a windows laptop or desktop. I am not certain about other programs where you can do Python web apps for free. But I will research that.

Related

Apache webserver with app using GDAL not working on windows

I am trying to deploy a django project using POSTGIS on my windows 11 PC with Apache 2.4.
The web page is working as long as I am not using 'django.contrib.gis'.
When I add 'django.contrib.gis' to my INSTALLED_APPS and define GDAL_LIBRARY_PATH to point to my gdal installation things stop working.
Specifically, trying to access the web app ends up in infinitely loading the page. Weird enough there are no errors in the apache error log. The apache service starts fine.
As far as I can see gdal install is correct as the app is working fine on the same machine with the same python environment with the django development server.
Actually, I have the same issue with other python libraries that need some dlls, like opencv.
So my guess is that it is a security related issue, but I do not find any clues on how to solve it.
Any ideas?
I tried also to grant rights to the directory where gdal is install in apache conf. But no luck.

Deploy Django project with MSSQL DB in Local Server

I am new in Django and this will be my very FIRST Times web deploying. So I am trying to deploy my project to the local server and My project stack is Django with MSSQL so obviously I will need Window.
I was read the documentation and I think I will need WSGI and As the documentation say to deploy with gunicron or uWSGI but both are supported for Unix and not for window. So How can I start this one? This will be the first question.
I would like to know whether I am doing is correct or not.
Now I copy my project to the local server and when I try to run my project like python manage.py runserver it asks me to install Django and other but I thought this environment is working at well my computer and all of the needed application is already installed in the environment. So I still need to install all of my needed apps like Django to this environment again?
If u have any tutorial or can guide me to some useful site, I will be very very appreciated.
Anything u want to know further, Just let me know.
Thanks.

Django Deployment on windows

I am learning python and Django now. I have a question related to deploying Django project on windows 7. I know how to start the test server in django and see the project. But I have to do start the server manually every time I restart the PC. Also I have to keep the terminal window open.
Consider the below scenario for php projects.
We copy and paste the php files in htdocs or www folder in apache server and access them using the respected url. Web Server is running in the background. We dont have to start the server on windows restart.
Is something similar possible with Django on apache or any other server?
If yes, how should I go about it?
Thanks in advance.
For anyone stumbling around for an answer to a similar problem with deploying Django on a Windows server, here is a guide
Deploy Django with Apache and mod_wsgi on Windows Server 2019
To have Apache24 service automatically run on startup, make the changes in Windows Services dialog.

Trouble with Django-Kronos

I have a weird problem with Django-Kronos.
I've got it running successfully on my local machine and on our development server. However, on the production server, I can't get kronos to acknowledge my cron.py file. When I run installtasks, it runs but says "0 tasks installed". I've also tried running the tasks manually and kronos tells me the task doesn't exist.
We use git to push everything through to the server, so all the files and the structures are identical between the three locations. I've also checked and the cron.py file exists and has exactly the same content as the working servers.
The only differences between the servers is that the production server is running Postgres (SQlite on the dev server) and it's Ubuntu 12.10, whereas the dev server is 12.01.
Kronos is functioning properly, but it's not picking up our cron.py file for some reason....
Any got any ideas?!
Well, unfortunately, our solution was to scrap Django-Kronos altogether and create a custom management command which we're running from the crontab.
This happens when one of import you are trying to make is not there, your production system might be missing some Python package which is included in your cron.py.

bitnami django, solution to restarting service?

Hey I use installed bitnami django 1.3.0,
but whenever I add changes to urls.py or views.py in my system due to some error. The error won't disappear after refresh.
I have to restart my bitnami Service, "stop" and then "start" it, which is time consuming, I feel like I'm coding C# apps in visual studio. Sometimes even that doesn't work, I have to sometimes restart my computer and then I suddenly realize "oh wow, the error is solved now!"
Any solution to this? Why does everything require a runserver / restart?
You can use Apache for deploy your application in production but use the Django server for development. You will need to configure your application for being served by apache later (modifying the settings.py and the apache configuration file) but during the development you won't need to restart the server for every change.
Everything requires a restart because of the way that the python process operates. It does not reload the file when it's changed (outside of runserver..which is an anomaly, and just there for convenience)
Python execution isn't like PHP execution in that way, and your code isn't dynamically loaded on every page refresh, it's loaded on every server restart.
Hope that helps.