For Workers & Pages, what is the name of the domain?
notapplicable.com
What is the issue or error you’re encountering
I cannot find a page in the support section the explains how to manually create config files.
What steps have you taken to resolve the issue?
I understand if I install npm or whatever it’s called I can use a command to create and upload my application and it does the thing where it automagically creates the configuration files and all that. With there being a method of directly uploading “drag and drop” my application it would be nice to know what configuration files I need, what options are available, etc so that I can create these directly in my application folder. I hate command line. I hate having to remember a bunch of cheat code lines to type out in a world of GUIs.
Could you be more specific? I uploaded a simple Python “hello world” index.py file. I don’t see where to specify that I’m running Python or that I want to use the v2 buildtime
Drag-and-drop upload assumes you’re uploading an already-built app. It doesn’t go through the CI process or use any build system. The idea is that you build it locally, then upload the output folder.
If you’re hoping to run Python at request-time for server-side rendering, you need Python Workers and I don’t think that works in Pages Functions at this time.
This URL states there are 2 runtimes; v1 and v2 - both support Python. I do not know how to specify either runtime or language when dragging and dropping my application.
The build system takes your source code and builds the final app. Cloudflare’s build system can pull your code straight from Github, run any build scripts, generate the app, run tests, and deploy it. You can use this as part of an automated build and deployment pipeline, to create an exactly-reproduceable environment that doesn’t depend on anyone’s particular computer. The build system is basically a virtual machine running Linux and supports various languages and tools.
When you do a direct upload, you’re not using this. You run the build on your own computer and upload the final app. This is easier for a solo developer, but not so much for a team.
A simple app, like a static website, may not need any kind of build process at all; it could just be files that need to be uploaded to a server. You can also use a different automated build system like Github Actions or something running on your own infrastructure.
The runtime is where your app lives and runs once it’s deployed. The Cloudflare Pages runtime is Javascript. It’s based on Workers, which is getting support for Python, but it can’t run a Python script. It can serve static files and run server-side Javascript code.
I’m not part of a team. I just want to code an app myself, upload it, and it work. Maybe that’s not what this is. I need to be able to run PHP or Phyton web apps and I need what Cloudflare offers as far scalability (to handle high traffic.) The link I mentioned above states Cloudflare Pages has support for PHP on Buildtime v1, and Python on both v1 & v2. If you can’t run either through Cloudflare Pages what is the documentation talking about?
You can’t run PHP or Python web apps on Cloudflare Pages. You can certainly run them on a server and put Cloudflare in front of it for all the features it offers.
As I explained, the documentation is talking about the build system, not the runtime. You can use Python or PHP scripts in your build pipeline.
Out of scope: [The last time I built an application was in 2006. I just had someone setup a server for me with WHM and the rest was simply just putting my PHP files in a public folder on the server and everything worked. I really need to find a mentor or someone to help baby step me through this but that’s proving to be difficult as well.]
I’m trying to grasp the concept of what is going on here but keep coming up blank. I’ve watched a ton of YouTube videos and I’m just outright struggling to understand.
You can still do that, but you’ll need a server set up for PHP hosting, same as before. The “edge” or “serverless” platforms like Cloudflare Pages don’t do PHP.
i40, I want to use Cloudflare Pages/Workers solely for a web application. I need this luxury of auto-scaling. I see Pages does html/css/javascript/images just fine. It looks like Workers only does javascript/typescript. So if I’m understanding this correctly, the source code for workers is hidden so it’s essentially your logic/oop? So instead of having a PHP file with a class that dynamically outputs your html data before the page is output to the browser you would essentially have an index.html file that would make a call to Worker that would return the data and… idk .innerHTML the body of your index file?
A Worker can run remotely and return the HTML just like a PHP-based app. You can do this in conjuction with client-side code, or not. It’s just a different server-side technology. You can certainly have all of your code in a Worker just like you would with a PHP server. The difference is there is no actual “server” that you deal with, and it runs Javascript code rather than PHP.
(There is growing support for Python and Rust, but that’s very new and I’d not mess with it until you learn the basics.)
I’m cool with Javascript. I already know quite a bit of it. I just need 2 things: to be able to make a web app and for it to scale automatically. This is why I really need a tutor. I get hung up one one thing and it takes me hours/days to figure it out.
Do you think I should delete this thread? I don’t think it will help anyone and I’m not sure if it’s frowned upon to delete threads.
You should probably look at a framework for developing a web app, rather than diving into the deep end. Astro for example is very nice, and comes with support for running on Cloudflare Pages. If you’re already familiar with Javascript you’ll do fine.