Turning Django web app to a Desktop app - django

I am very comfortable with Django, and I was wondering about whether there is some way to convert a Django web app into a Desktop app (may be not 100%), so that I can distribute it to users, instead of learning a GUI framework.
Thanks

Maybe not exactly what you are looking for, but if you really, really don't want to learn a GUI framework, in your place I'd consider packaging your Django web application with a small web server in the distributable package, with the Django app configured to run on localhost on the web server. Then I'd include a script that launches a browser pointing at the starting page of your Django app as the "executable".
If not configured properly this could be considered weak from a security point of view.

Related

Best way to create a Mobile App out of a Django website

What is the best/efficient way of creating a mobile app out of a Django site. I understand that perhaps using React to and connect to a DJANGO API, but assuming I don't know React, can I somehow convert DJANGO site into a Phone Appp?
Short answer - You shouldn't because there are better ways to build mobile apps with Django as your backend.
Long answer - You could use webview in android to wrap your web application. Depending on you app, you might need to use some native code to build any of your floating action buttons, bottom navigation, toolbars etc while keeping the rest of your Django app wrapped in the webview. The downside is that your app will lack real performance gains or full native features that you’d be able to utilise.
You could also convert it to a Progressive Web App which will be your django app given some super powers to be able to provide content when a user is offline on both desktop and mobile. Check out Django PWA for this.

Access backend APIs in Angular/React/Vue(front-end) and DJango/Node/Java/ASP.NET(back-end)

I have searched a lot but could not find any satisfying answer.
I want to know if any IDE provides an environment for web development using Angular and Django. And how to access Django APIs in angular.
please tell me.
I will be thankful for your guidance.
The first thing that comes in mind is Visual Studio Code. It is very versatile and easy to set up for starting web development.
https://code.visualstudio.com/docs/nodejs/angular-tutorial
You have a lot of extensions which can make your life easier in developing by just typing in the search Angular. You'll finde code highlighter, debugger for chrome etc...
same goes to Django, fast easy set up, good extensions and you are ready to go.
I was not familiar with web development at that time. My question was about accessing APIs in frontend. All IDEs and Editors can be used for frontend and backend development.
The main point to keep in mind is that your frontend will have its own server and backend will have its own server that will compile and react to changes you made in your code.
Let's say your frontend server serves on localhost with port:8888 and your backend server serves your APIs on localhost with port 8000
By running both server at the same time you can access APIs in your frontend with backend routes like:
'localhost:8000/login'
localhost:8000/user/user_id

Is it reliable to build desktop applications using web frameworks like Django?

Is it reliable to build desktop applications using web frameworks like Django?
The idea is to
build the interface with HTML, CSS, and JavaScript
use Python and Django for backend operations (calculations, storage and databases, etc)
and then run a server locally so that
the interaction with the application is done through the browser
other local devices can access the application by connecting to the device on which the server is running.
If that is possible and yields a reliable experience, then
is the development server that comes with Django enough? If no, what servers are most suitable for our purpose? Is Nginx good for example?
what database should be used? PostgreSQL, MySQL, etc? The app will need to store a large number of entries.
I've never done this, but I can't see why not. You can use the Django REST Framework to create an API that your desktop application can talk to, in exactly the same way as you might with a JavaScript single page app.
But no, you should not use the dev server for production, even in a limited scenario like this. Apache/mod_wsgi or nginx/gunicorn are simple to set up and deploy.
For the database, it makes no difference. The Django core devs prefer postgres, but you should use whatever you are comfortable with.
You are asking for a webApp, so yes you can. Is not use the Django server, instead is very common use nginx for Django, and the best database is postgres for Django.
If you want to pass your project like a desktop app is better use Django server and SQLite for avoid create a new database server.
Database
I find this answer explaining why is postgres better for Django

Incorporating react redux into django

I've built out a basic django application, and I'm looking to incorporate react+redux into the app. I've come across several react+redux templates like the react-redux-starter-kit and redux-webpack-es6-boilerplate:
These are awesome, except they both run node servers. I'm wondering:
Does there exist some sort of a tutorial or template that has the same features (webpack, Hot Module Replacement, linting, testing, abides by Fractal Project Structure guidelines, etc...) but does not run a node server, so I can just copy it into my django application (I realize I'd have to do a fair bit of configuration to get everything working smoothly).
Is it ok to run the webpack server within my django application? (Basically node would be running within django) Are there any downsides in doing this?
I've tried altering the above two templates, but they are pretty dense and complicated. Any advice would be very much appreciated!
I don't see any reason to mixing up django and react app.
I would prever leave them as two independent parts of your application: SPA (react + redux) + API (django)
If you already have django app and just need to add some react pages into, then build react app as static files and place it outside your django project, and configure your reverse proxy server (nginx) to load those new pages as static pages (react).

Apache/wsgi/django configuration

We have two django applications running on the same server that interact with an API that uses oauth. They function as expected, communicating with each other, when run under the django development server. However, when deployed using apache/wsgi they don't work together.
(To be more specific, one application is an instance of the Indivo server; the other one is a custom application that interacts with Indivo.)
What is the best way to trouble shoot this?
Make sure that the Django instances are working by themselves first. For example, one app could be started under Apache, and the other using ./manage.py runserver. Reverse which one is running using Apache and verify that all works as expected.
Use the Apache error logs to look for errors such as failed requests.
Since one of your apps appears to implement a web API, use something like the Google Chrome Postman App to exercise the site from a web browser.
Learn how to use the Django logging framework to log information about your apps as they execute.