#πŸ”’ Host website through network drive?

174 messages Β· Page 1 of 1 (latest)

quiet gulch
#

Is this possible to make easily?

maiden scrollBOT
#

@quiet gulch

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

void dew
#

does your website have some sort of backend like django , flask , etc ?

quiet gulch
#

Nicegui

#

The reason I am asking the question is because I do not know yet the IT limits for this company so I do not know what host I could use

novel saddle
#

Just plain HTML

void dew
#

when you say "host" do you mean locally ? or for everyone in the world ?

quiet gulch
#

locally

visual rampart
#

If u mean that u want to be able to host a website locally trough youre ipv4 you could just use iis

quiet gulch
#

without any computer running it

visual rampart
#

Ah nvm

void dew
#

the python code needs to run "somewhere"

novel saddle
#

If the network drive is 192.168.100.123 and its stored in a folder called "website" with all of your HTML files in there, then you can easily host it and access it on your browser: http://192.168.100.123/website/index.html

void dew
#

but they are using a backend framework

#

NiceGUI

novel saddle
#

yeah thats a problem

quiet gulch
#

Yeah

novel saddle
#

Could probably migrate it over to Flask

#

Then freeze it

#

!pip Frozen-Flask

maiden scrollBOT
#

Freezes a Flask application into a set of static files.

Released on <t:1707489133:D>.

void dew
#

but then that would make the dev process unnecessary complicated

novel saddle
#

Then take the "frozen" static files and "host" them

quiet gulch
#

Would that make the website accessible without anyone running the code?

novel saddle
#

Yes

austere valley
#

it dependsℒ️

#

if it needs a backend, you cant

quiet gulch
#

well it is letting the user upload a csv file and then will make some calculations and present the result

void dew
#

what does your web app do ? @quiet gulch

#

yeah no , that probably cant be converted to a static site imo

novel saddle
#

Then definitely can't be done

void dew
#

techinically you can write javascript and move all the logic to the browser and make it into a static site

but then you just writing javascript, no point of that nicegui framework

novel saddle
#

Ask your IT to provision you a VM for you to deploy your webapp to @quiet gulch

quiet gulch
#

ough haven't learned javascript yet

quiet gulch
visual rampart
#

The syntax is just unnecessarily long

void dew
#

but its not really a solution for this problem imo

quiet gulch
#

yeah exactly

austere valley
#

pain

quiet gulch
#

Ugh hopefully they just tell me I do not have that limited choices and the whole thing will be easy

#

otherwise what is my option? jupyter?

austere valley
#

imagine accidentally adding + + and not knowing where the issue is

#
> "a" + + "b"
'aNaN'``` who did this
#

who hurt you

visual rampart
#

Never said it didnt suck, just said its not that hard to learn

#

Its the first language i learned

void dew
austere valley
void dew
#

or java

quiet gulch
visual rampart
quiet gulch
#

I need some of my colleagues to be able to access it

#

and I want to make it as simple as possible for them

void dew
#

for dev phase , you should do it on your local machine

as for deployment , asking the admin to get you some VM to host it should be the way to go

quiet gulch
#

So instead of them having to know how to run the code and change either the file name or change the code to match the new file name I wanted them to be able to just upload the file through a website

visual rampart
#

If u deploy that website somewhere else can u access it from the network?

visual rampart
#

Like can someone open it like they would when its in ur network drive?

#

Idk this backend so

void dew
#

( usually you dont do stuff like this yourself , you might not be familiar with the network / gear. People are there for reasons )

quiet gulch
#

Yeah I mean doing my first programming job working alone on the projects:/

visual rampart
#

Also is there a specific reason ur hosting on a network drive?

void dew
#

your company has a system admin right ?

quiet gulch
#

Yeah that isn't working here

#

since the company I am working for is a small part of a huge buissness

novel saddle
#

oh then, why not host it in the cloud?

void dew
# quiet gulch Yeah that isn't working here

ok so the bottom line is , your app has a python backend , that python code needs to run somewhere everytime someone accesses it
so when you mean "deploy your web app" , that means you need some sort of computer to run that python code

do you have such a computer where you can deploy to locally ?
if you want the app to be accessible 24x7 , the computer needs to be on 24x7

quiet gulch
#

No that is the problem

void dew
# quiet gulch No that is the problem

you dont need a full PC dedicated to this one thing , any PC should which already is running "should" work , like your network server that hosts the network drive in the first place

for example , even your personal PC could also work , but its not really a good solution for various reasons like the app wont be accessible when you log out of your PC , you PC would have unnecessary software eating up small resources , it would write to your storage drive which might not be ideal

if this all doesnt work for you , then your option would probably be deploying in cloud as Qoyyuum suggested above
and it will most likely cost you a little bit of money

quiet gulch
#

Oh what have I given myself into

austere valley
#

just get yourself out of it

quiet gulch
#

Yeah it does not seem to be a choice to have it running all the time on a PC

#

So the question is should I drop the whole website idea? and try to find another solution that could make it easy for them to use?

#

Is Jupyter an option for this? @novel saddle you know my project from before

novel saddle
#

But it sounds like something that can be done with Streamlit

#

Or Taipy

void dew
novel saddle
quiet gulch
#

Yeah cause that would lead into such complexity

#

needing all of them to install all libraries

#

and something to run the code in

void dew
# quiet gulch needing all of them to install all libraries

you can stuff all the requirements in a requirements.txt file , and pip will install all the libraries with the correct version with just 1 command
and if you make a GUI , the python code will run on their own machine

you can technically bundle your python code and the interpreter into a .exe app , but windows flags those exe as virus for no reason
so you can just have them install python 1 time and then after that , they can use your app like a regular app

but this is a very shady way to do it imo

quiet gulch
#

how do you mean make a GUI

#

Sorry

#

I mean for what should I use to make a GUI

void dew
quiet gulch
#

Yeah that was my first idea until someone told me it would work running as a website

void dew
#

i mean , if you can get every employee to install python and then give your python code to them

any solution will work , website , GUI

#

you can probably even give them your current script and tell them to run it , and go to a specific URL in browser , they can use the app

quiet gulch
#

Yeah okay but saul

#

That means I would be able to add the app into the network driver right?

#

and they could just double click it there?

void dew
#

no , python needs to be installed on their computer ,the python code needs to be on their computer , they need to double click the app in their computer
network drive has nothing to do here

#

network drive is just a pendrive , a pendrive cannot run apps

quiet gulch
#

Why would they not be able to open it via the network drive?

#

I have the code laying there right now?

void dew
#

you mean , the python code will be on the network drive ?

quiet gulch
#

Yeah exactly

void dew
#

sure ig, the python code is probably fine living on the network drive

#

i havent tried it myself , so i cant gurantee it , you can try and find out

novel saddle
#

The users would still need to pip install the dependencies

#

But thats a one-off thing

#

Until the requirements change

void dew
#

fwiw if you have that deep allowance to the company network to the point where company doesnt care what you do on local network

you can just check who is hosting the network drive , and ask if you can run a docker container on there too

with a docker container , you dont need to worry about any of this , it will act as your server and people can just go to that URL and use the app as you initially intended

quiet gulch
#

Really?

#

Using a docker container

#

would mean I could have them upload the file in the frontend and still have the backend working?

void dew
quiet gulch
#

so that would mean I still need something that runs it 24/7? or what

void dew
#

network drive that you see in your PC is a hard disk connected to another computer in the network , and that computer has some software / setup that makes it appear as a network drive

#

so its still a computer at the end of the day

#

which can also run other apps if you want

quiet gulch
#

So yeah you are right, I should just ask about it

#

@void dew I should try bringing another computer after lunch maybe and try some

#

Is docker free? or would I need to pay

void dew
#

it enables you to run different apps in isolated containers

#

so you dont mess with system stuff

quiet gulch
#

Oh okay

#

Because if that works it would be so good for me

#

cause this discussion has given me multiple heartattacks

void dew
#

thats just how deployment be πŸ˜‚

quiet gulch
#

Okay that is quite a relief to hear

#

It feels hard, first ever permanent employee

#

and working alone with the project with no one in the company that knows any programming

void dew
#

oof

quiet gulch
#

That is why I need to come here for these questions

#

Okay I wrote a list

#

From best to worst scenario from my understanding of this discussion

#
  1. have the app running on the same computer that runs the network device and using docker container
#
  1. Host it via some other company? Then the problem with backend not working is back I guess
#
  1. Use Tkinter and make a GUI and make it an exe and put it in the network device
#

@void dew

novel saddle
#

The 2nd point can be done with a docker container too and deploy that to fly.io or render.com

#

I'd say the cloud hosting one is probably the best option. So all users can access it from anywhere and anytime on any machine

void dew
#

1, 2 will do pretty much the same thing , the backend will run on a computer
in first case the computer will be your own company's PC , in second case ,the computer will be a computer in cloud
and the URLs will be little bit different in each case
and most importantly , option 1 is pretty much "free" , option 2 will cost you little bit of money

1 ,2 are the most hassle free options that do exactly what you want them to do ( user goes to a website , uploads a CSV file , gets the new converted CSV file without having to worry about any installation or whatever)

option 1 will be a bit more involved than option 2 because not only you have to make the docker app , you also have to install docker on the network drive's host PC , set it up to serve the apps ( sure its a 1 time setup thing ) and secure it , maybe lock the access to certain computers if you want

option 3 is the most complicated of all

there are 2 option in option 3 , a and b

option 3.a is that you bundle your script and python as an exe and give it to users , but this exe will be marked as a virus by their antivirus ( you can whitelist the app one time and this wont be a problem anymore)

option 3.b is that you setup python and the dependancies individually on everyone's computer , and then you tell them to use the app by double clicking the python file in the network drive

option 3a and 3b can be a website too if you want (you tell your users to run the python app , and then go to a certain URL in their browser) , you dont have to rewrite the whole UI for GUI

quiet gulch
#

Hmm maybe I am making it hard on myself

#

Yeah right the marked as virus..

#

Otherwise it would be super simple

#

I call for a quick meeting and give them all it as in option 3b

#

cause NiceGui opens the website automaticly on running the code

#

and then they would just need to upload the file

void dew
#

my suggestion is , if money is not an issue , option 2 is the most easiest to setup
if money is an issue , option 1 is the most eaasiest

option 3 should be a last resort

void dew
#

believe me that setting up software on every single individual's PC is not fun

#

if the PCs are beefy resource wise , you can use option 3 along with docker , that could also be an option

quiet gulch
#

but having a constant payment that needs to get paid

void dew
quiet tapir
quiet gulch
#

How much money are we talking for option 2?

#

I guess I still can tell the option to my boss

void dew
# quiet gulch but having a constant payment that needs to get paid

if i were in your place
i would try the option 1 , because i am open to experimenting and i am okay with investing some time in learning this new thing ( which will be hosting with docker for you )

i would say you can dedicate 1 full day to this , and get your app up and running by the end of the day most likely

void dew
quiet gulch
#

for me

void dew
maiden scrollBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.