Skip to content
Sign UpLog In
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
2

How do I hide info or a file from the user

Foster_Bryant
Foster_Bryant

I have a json file with an api key and I don't want people to be able to see it but I still want to put it on repl.it.

3 years ago
You are viewing a single comment. View All
2
3
Vandesm14
Vandesm14

@Foster_Bryant Refer to this
You should create a .env file with the following:

APIKEY=<your token>

Example:

APIKEY=12301923102389

And you can reference the key by doing:

import os # Set apikey to the APIKEY in the environment variables apikey = os.environ["APIKEY"] # Print the key to check is works print(apikey)
3 years ago
1
Foster_Bryant
Foster_Bryant

@Vandesm14
thanks Ill count it as an answer once I test when I get back from school thanks

3 years ago
1
Foster_Bryant
Foster_Bryant

@Vandesm14
How would I do this through a python file if I want to hide json

3 years ago
1
Foster_Bryant
Foster_Bryant

@Vandesm14
thanks for the example I will count this as the answer and I will test it later thanks

3 years ago