Getting that key off from repo

For today, the plan is to get SQLite onto my computer, and try to get whispering wall interacting with that database to retrieve my script lines. 
FYI: The plan went completely sideways as I tried to get my secret_key off from github.
      1)delete settings.py from repo but not local
      2)force push origin master of pythonanywhere repo
      3)remove original key from settings.py and replace with snark
      4)tell gitignore to NOT ignore settings.py
      5)push new settings.py to git repo
      6)put settings.py back into gitignore
      7)change secret key back
      8)Find out at a later date if I could have just changed my key and ignored     
         doing any of this 

pictured: The result of shutting down my bash(s) because I couldn't exit vim while trying to change the gitignore file



 

First step, go to my Learn SQL the hard way to see setup instructions.
-- I always try to do "apt-get install" if I can rather then download.  If it's available it's just way faster, and it seems like there's way less problems if I let Linux do all the installing instead of me fumbling with it.  I'm sure that practicing installing from source, or download is important, but right now, I want Whispering Wall up on my site. 

$ mkdir project_WW
$ cd project_WW
$ . ~/venvs/noodles/bin/activate  <--- enter my python virtual env.
$ sudo apt-get install sqlite3 libsqlite3-dev

2) Look at Zeds instructions again, and run the test he gives us.
3) Go to pythonanywhere and get a copy of my code for getting script lines into the db.
4) Oh shit I never took my secret key off the file on github!
    a) go to github, delete secret key, and commit to master
    b) check that key is no longer on github somewhere.
    c) it is, and the process to remove it is to remove the whole file, and reload
    d) look up if changing this secret key will do any harm
           * at this point my site is not affected by a change in key
    e) change the secret key, cross my fingers and push the shiny red button

5) I want to see how to delete that key from git repo for future projects
 
    decision: it would be easier to remove the file completely from repo, commit a settings.py without secret key,  then change one in master back to key.
     **  I have my settings.py on my gitignore to avoid issues like this, but I totally forgot about that damn secret key **
   g) removed the settings.py file from git repo with:
      $ git rm --cached mysite/settings.py
      then went through a bunch of stuff to get merge conflicts figured out,
      had to commit changes, pull changes, get everything conflicted sorted
      then:
      found out I have to force the push to get it to remove the file
      $ git push origin +master
     
Now it's removed, and I'm getting crazy merge conflicts.
So, I rewrite git ignore....  I HATE VIM.   
    you can't use the commands if you are in any mode ... for example INSERT
    so you have to exit those first before trying the :<command>  
    it will just dingaling at you and pretend your an idiot who doesn't know 
    how to type otherwise. 
*save and quit* :wq
I had to remove the .gitignore.swp file created from not remembering how Vim works...
      $ rm .gitignore.swp
Now I push the mysite/settings.py file into the repo
      $ git add mysite/settings.py
      $ git commit -m "starting a trash fire"
      $ git push

Now I check status.  No errors this time.
Next remodify gitignore so that it does not track the settings.py
back to Vim...  *ugggghhhh*

for fun, check out this reddit thread on vim:
      https://www.reddit.com/r/programming/comments/5vha40/how_the_hell_do_i_exit_a_beginners_guide_to_vim/


Lunch and back to messing with Whispering Wall.


Comments

Popular posts from this blog

playing with color in powershell python

JavaScript Ascii animation with while loops and console.log

playing with trigonometry sin in pygame