Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I am currently working on an app or rather preparing everything. However, I have a question regarding backend and frontend. For the frontend, I was thinking about working with Dart/Flutter, since I'm planning to release the app for iOS and Android. For the backend, I would actually like to use Python, since I also have experience with the programming language.
I want to build an artificial intelligence into my app, which can receive an input from the user via the frontend connection, do something with it and pass this processed information back to the frontend and thus to the user as output. I hope you can understand all this. So, in general, it just has to be able to pass the information between the Dart files (Flutter) and the Python files.
In fact, I don't really have any experience with linking a frontend with a backend. Now I just wanted to ask if all this is possible at all and if Flutter or Dart and Python are even "compatible" with each other, maybe with plugins or something? I don't want to do without Flutter for my app, so if that's not possible, which programming language could I use instead of Python for programming an artificial intelligence?
Maybe one of you already has experience in this area or with my problem and could help me? I am looking forward to your opinions and suggestions for help or also experiences.
Kind regards and thanks in advance!
I'm a Fullstack developer and I have worked on a bunch of these projects with Front-end and Back-end components.
Essentially what you would do is have your Front-end make get requests to a server. Your Front-end client would be in Flutter or Dart and the server would be an HTTP API. Flask, for example, is one framework that let's you make web applications with Python. You are making an API for your client to call.
I can't speak as much to Flutter or Dart because I'm a React.js developer, but you would host your client on one website and then host a server on another website and simply make get and post requests on the server.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
We have legacy .exe solution running on industrial client's desktops that I need to port over to Google App Engine. All clients will have the same version of the app, no code customization. We need to be sure that data will not be leaked between different clients of the new GAE app or be snooped on by some external party.
So I have a couple of questions that I hope someone will be able to help me out.
Option 1: Use namespaces to separate client's data. This seems quite robust at the Datastore level; without the proper namespace data would not be served. Since we have the company name of each user, I would presume this would be quite secure against leaks.
Q1: Which precautions do I need to take to avoid someone guessing or hacking at URLs to get to unauthorized data?
Option 2: We could have a separate instance of the code and datastore for each client. This would give the optimal separation between clients.
Q2: Is there a tool or API to "clone" a given GAE app to many clients? We would feed the list of clients and update the code to all those instances in one go.
Thanks!
Which precautions do I need to take to avoid someone guessing or hacking at URLs to get to unauthorized data?
Namespaces are not a security mechanism for Datastore. A user with access to one partition in a project has access to all partitions in the project. Namespaces provide a way to organize your entities within a project.
Is there a tool or API to "clone" a given GAE app to many clients? We would feed the list of clients and update the code to all those instances in one go.
To have completely isolated instances of services, you can create new projects programmatically using the Cloud Resource Manager API and access resources across projects.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I'm building my first ever web-app in python, haven't even decided on a framework yet,
does it make sense to start out with a MySQL database to manage users and credentials?
or is it a completely ridiculous way to approach it?
what are some existing solutions and best practices for managing user credentials?
The answer is, as always, it depends. There are many ways to build a web app in Python so you'll first need to decide on what you want to build or what technology you want to learn.
If you just want to focus on a Python backend as a learning exercise then you could use Flask which can run as a server and includes many modules to help you get started including managing users. If you plan to expose your app publicly though it is generally recommended to use Apache or some other battle tested server which can route the requests to Flask.
There are other Python frameworks like bottle which I believe is meant to be even simpler than Flask and Django which is more complicated but has more features. It all depends on what you want to do. You can also look at things like dash if you're end goal has a data analysis flavor.
One thing to note though is that managing user credentials is not trivial. It can be a useful exercise if you like to learn and tinker, but to do it correctly youll need to learn about salting passwords, cryptographically secure hashing, session management, https (and ideally which ciphers should be deprecated), how to protect against sql injection (good to know how to do this anyway if you don't already), cross site scripting, CORS, etc. The list goes on. None of these things are exclusively just for managing user credentials but you should understand all the ways things can go south on you.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I want to build REST API (or GraphQL API) which I want to connect with Angular (2+) to build some nice web application.
Which framework should I choose to get started with and why? DjangoREST or ExpressJS ?
Which one of them is easier to get connected with front-end frameworks?
I know python as well as JavaScript. I also have experience with django as well as some JavaScript front-end frameworks like Angular. So, it wouldn't be that difficult to get started with nodejs or either of them.
Which of then is easier and better?
In short, Django for quick development and Express for full-stack,
scalable solutions.
Django provides better, easier security without as much experience. In the case of Express, it takes so much experience and confidence to get the same security from Node.JS
Django uses the MVT (Model View Template) design pattern and Express uses event-driven programming in which the entire architecture is driven by “events” or user choices. MVT is excellent for server-side development, on the other hand, event-driven programming is rather than separating client and server sides.
Django uses an in-house template system, so you won't hang to choosing the right one. With Express, a fully open system you may spend a lot amount of time to choose the perfect one for you.
Django is more structured to work around. It tells you how to do whereas express gives you the flexibility to do it in your way. For example, you need to use Django's ORM to interact with the database, but in the case of Express, you can choose any tool you like.
Express gives you freedom. So, if you’re experienced, there is a space to create whatever you want from scratch. Django gives you a lot of solutions with a vast template and library system, which is great for productivity but not enough for the vision.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I want to build a webapp with Python back-end. The front-end of the webapp will just have a simple input box where the user puts an address. Then, on the back-end I want to scrape content from the webpage in that address and then process that data. This data processing might become quite heavy.
I'm quite experienced with Python, although with webapps, hosting, and so on, I have zero experience. I bought a domain name and hosting on namecheap, even though I just found out that maybe I won't be needing to use their hosting, as someone in /r/webhosting recommended me to use AWS instead. This was the methodology I was recommended to follow:
switch to AWS (or Azure)
create python lambda/function to do whatever you want to do with this request...
put lambda behind api-gateway
put Cloudfront in front of api-gateway (optional but hey..)
I have seen tutorials to point the namecheap domain into an EC2 instance. But how do I go about doing this with Lambda? Is it the same principle? Can you point me to any tutorials that might teach me how to handle this? Is Lambda actually the optimal solution for this?
Thanks!
This is a great starting point: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-quick-start.html
Aws sam handles creation and deployment of your Lambda and API Gateway. To have your API/web app exposed to a custom domain, you will need to create a AWS ACM SSL certificate and create a custom domain on your API Gateway. Basically it will create a hidden Cloudfront Distribution that you can use to setup your DNS.
Good luck!
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I am working on a homework project for a Networking class where we have to build a simple web based chat server in either C/C++ or Python. I chose Python because I thought it would be an easier language to implement the project in. We can use any material we find on the web, because it most likely won't have all the functionality that the project requires. In fact, the professor actually encouraged us to use material from the web including tutorials. He's not testing us on our ability to code rather our ability to implement networking code, and whether or not we fully understand the processes involved.
The project must handle multiple clients, and must be able to support multiple browsers, chrome, firefox, etc. A user needs to be able to type in an IP Address and a Port in the browser to connect. I just can't find any material to work with. I have found a little in C but nothing in Python.
Does anyone know of any complete tutorials out there? There are plenty for client/server command-based chats, but no browser based chats.
You can look at using TornadIO. Its a python implementation of Socket.io, for Tornado, Tornado is an event-driven python web server.
https://github.com/MrJoes/tornadio2
http://www.tornadoweb.org/
Socket.io is a cross-browser solution to socket/socket-like connections from the web client to the server. This will pretty much give you all the tools you need to do a chat server since it supports pub-sub subscriptions and messages. The nice thing about using socket.io for your purposes is that it tries a number of transports in order to ensure that new and old browsers can all communicate: Websocket, Flashsocket, xhr polling, jsonp, htmlfile. They all are attempted and used in a way that looks the same to the client.
Tornadio2 is the newer version that is compatible with the newer Socket.io 0.7+. This version added a lot of features that broke compatibility with 0.6. However, the original TornadIO contains a chatroom example which you could review and translate pretty easily to the newer version to get you started:
https://github.com/MrJoes/tornadio/tree/master/examples/chatroom
As far as I can understand, the home work given is let people gets hands on activity with network programming. So might take a look at www.twistedmatrix.com, few example use case of twisted
Chat comet site using python and twisted,
http://lists.canonical.org/pipermail/kragen-hacks/2005-April/000409.html,
http://code.google.com/p/twisted-chat-example/.
This one uses plain socket programming http://code.activestate.com/recipes/531824-chat-server-client-using-selectselect/,
http://ankurs.com/2008/05/creating-a-simple-chat-application-with-python/.
This one is based on gevent.
For simple chat room emulation without use of socket programming, here is the example gummi.
A real life use case at sourceforge.