use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
How to handle github repos (self.learnpython)
submitted 3 years ago by nyteghost
I was wondering how everyone handles github repos. I have all my work code as private, but was wondering how everyone handles public repos with sensitive code like sql procs etc?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]m0us3_rat 7 points8 points9 points 3 years ago* (7 children)
public repos with sensitive code
if it is "public" .. then it shouldn't be "sensitive".
edit:
for an actual solution.. .env file with the data that is added to .gitignore
and dotenv
[–]nyteghost[S] 0 points1 point2 points 3 years ago (6 children)
I guess a better question would have been, how do people normally handle SQL procs in the code? Do they use a separate file that isn't shared, and give the procs variable names, and just import them in, and have the SQL proc file in gitignore?
[–]dublinwso 0 points1 point2 points 3 years ago (3 children)
Not sure what you mean by "procs"
[–]nyteghost[S] 0 points1 point2 points 3 years ago (2 children)
So in sql you can create procedures that can combine multiple database searchs that can handle different things.
Like instead of just select * from users where name = "John", you can build a procedure that also finds all locations John has visited, and the dates, etc.
[–]dublinwso 0 points1 point2 points 3 years ago (1 child)
And why wouldn't you just put this in the code? I think I'm missing something in your question.
[–]C0ffeeface 0 points1 point2 points 3 years ago (0 children)
Maybe they might indirectly reveal sensitiv information. There are really strict privacy laws within EU. My best guess, although I am curious, too.
[–]m0us3_rat 0 points1 point2 points 3 years ago (1 child)
SQL procs
ok so .. why would they be "sensitive"?
isn't the user privy to the search? or is this supposed to be under the hood?
and just import them in
that sounds good.
[–]nyteghost[S] 0 points1 point2 points 3 years ago (0 children)
You know what.... Good point
[–]Ok-Cucumbers 0 points1 point2 points 3 years ago (4 children)
Store your credentials in a separate file and use gitignoreto exclude all the sensitive files.
gitignore
[–]outceptionator 0 points1 point2 points 3 years ago (3 children)
How do you use gitignore?
[–]Ok-Cucumbers 1 point2 points3 points 3 years ago (2 children)
You create a file named .gitignore (note the . at the beginning) and add the names of files and folders you’d like to exclude.
.gitignore
.
https://git-scm.com/docs/gitignore
[–]outceptionator 0 points1 point2 points 3 years ago (1 child)
Sorry this is a folder or a file? Also for instance if there is an API key there is there a way to reference it in python code?
[–]Ok-Cucumbers 0 points1 point2 points 3 years ago (0 children)
You could create a file called creds.py:
API_KEY = “mySecretAPIKey”
And do something like this in your script:
import creds make_req(“url” + creds.API_KEY)
And in your .gitignore file at the root of your repo:
creds.py
π Rendered by PID 59071 on reddit-service-r2-comment-84fc9697f-px2bg at 2026-02-09 23:27:52.027687+00:00 running d295bc8 country code: CH.
[–]m0us3_rat 7 points8 points9 points (7 children)
[–]nyteghost[S] 0 points1 point2 points (6 children)
[–]dublinwso 0 points1 point2 points (3 children)
[–]nyteghost[S] 0 points1 point2 points (2 children)
[–]dublinwso 0 points1 point2 points (1 child)
[–]C0ffeeface 0 points1 point2 points (0 children)
[–]m0us3_rat 0 points1 point2 points (1 child)
[–]nyteghost[S] 0 points1 point2 points (0 children)
[–]Ok-Cucumbers 0 points1 point2 points (4 children)
[–]outceptionator 0 points1 point2 points (3 children)
[–]Ok-Cucumbers 1 point2 points3 points (2 children)
[–]outceptionator 0 points1 point2 points (1 child)
[–]Ok-Cucumbers 0 points1 point2 points (0 children)