Code Monkey home page Code Monkey logo

flask-server-generator's Introduction

Python Flask Server Generator

Generate server code and automatically define page functions and route in flask!

How to set up and use:

  1. Download the repo and run build.cmd (or run from source since u need python anyways to run flask)
  2. Create the HTML files that you want to be on the website (into code)

3. Download and install python, and flask:

Install python

  • Go to the python website and download python 3.X (newest possible, currently 3.11 as of writing this)
  • Run the installer file
  • Make sure to install pip in the installer options

Install flask

  • Open run prompt by pressing WIN + R
  • Type cmd and hit enter
  • In cmd type:
pip install flask
  1. Move compiled generator to code/ from dist/
  2. run the generator
  3. Run START SERVER or open terminal (cmd or powershell) in code/ and type:
flask run

6. Connect to the website by:

  1. Opening your internet browser
  2. Going to your own website at:
http://127.0.0.1:5000/
  1. You are done! (Noone else can go there right now, look up some tutorial or something ill update this readme when i figure how to host on public ip with flask)

Features:

  • Only need to code html
  • Automatically generate python-flask server
  • Automatically route all html files based on their name
  • Automatically return html code from their corresponding files
  • Automatically send html page to client web-browsers
  • Is pro gamer
  • Logging in generator
  • Username auth support (no psw yet)
  • Some cofiguratio options i generator
  • NEVER have to open app.py!!!
  • Automatically port forward / host on public address (thats ur problem)

How tf does it work?

It just appends code to app.py and then it all works! Ur welcome!!!

Notes:

HTML File structure:

  • The script gets all files ending with .html, so only files that it can include in website end in .html
  • The root page filename is empty by default (just ".html")
  • To require login add %auth=True% somewehere in the filename (eg. home%auth=True%.html) or enable force-auth in config
  • 404 page and login page cannot require auth (for obvious reasons)
  • The login page must be called login.html, to make sure it works copy the one already in he repo and edit that (dont edit the form that might break it)
  • The 404 page must be called 404.html
  • The server logs all logins and 404 pages (if the user isint logged in it will display as UNKNOWN)
  • Make sure to change the app.secret_key if ur actually using this

CSS:

  • Reading css FILES isint supported (i guess) since idk how flask works with css
  • U can still include css in ur html code!

La Script:

  • it may not be 100% reliable...
  • Havent done large scale testing on it, thats why its on github!

Example site:

  • You can use this to learn how html works i guess!
  • Im bad at html so someone else can make a better one

Usage:

  • If you use it without credit i will come to ur house (dont remove the comments)
  • I know where you live

This is really simple... Learn to code if u actually need this lol, its just for fun!

flask-server-generator's People

Contributors

omena0 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.