Discord.py website

Hey

wrote a little discord bot on glitch. (Python based used with discord.py). Now i want to create a configuration Website for the bot. When i add an index.html to my project it wont be “loaded”. It think its because glitch thinks it an pure python project. If i remove .env and glitch.json the html works fine.
How do I get both working on a single Glitch project?

.env (from a template):

GLITCH_DEBUGGER=true
# Environment Config

# store your secrets and config variables in here
# only invited collaborators will be able to see your .env values

# reference these in your code with process.env.SECRET

DISCORD_TOKEN=PASSWORD123
# note: .env is a shell file so there can't be spaces around =
utm_source=starter-botkit-discord
utm_medium=button
utm_campaign=glitchButton

glitch.json:

{
  "install": "pip3 install --user -r requirements.txt",
  "start": "PYTHONUNBUFFERED=true python3 discordbot.py",
  "watch": {
    "ignore": ["\\.pyc$"],
    "install": {
      "include": ["^requirements\\.txt$"]
    },
    "restart": {
      "include": ["\\.py$", "^start\\.sh"]
    },
    "throttle": 1000
  }
}

I can try an help you, using flask. @Dschogo

why dont you create another project @Dschogo

wanna do it in one project. Its easier to access files and configurations. Glitch only for testing, hosting should be elsewhere in the future

well I can try doing it with flask?

I think really the only way to do this would be with flask. Its easy to set up, here are some docs if you want to read more:
http://flask.palletsprojects.com/

@Dschogo so would you like help, using flask

thx for the quick answers… gonna look at it tomorrow

1 Like