Showing posts with label Github. Show all posts
Showing posts with label Github. Show all posts

29 Mar 2019

Feature request for python's requests library

Recently as apart of day job I had to count the number of API requests were made to keep check of throttling limits. As a standard for python codebase, requests library has been used.
I wrote some code which will maintain the API URLs and their respective counts.
That got thing done.

After a while I realized, there should be a way to intercept the request. Just like in there is middleware in Django for request. Then checked the documentation of requests and found event-hooks.

Going through the docs found out that hook is available only for response.  And they have intentions to add other hooks as well mentioned in TODO.
Found this opportunity to contribute one of the best libraries of python and without any delay I created github issue

Hopefully library maintainers will have a look and will add as a feature request officially.

10 Oct 2013

Make existing project as a github repository

Recently i was working on side project on Django and then decided to put it on the github.
First of all you need to create a repository on github with same name as folder you want to put on git.
Then follow following steps :

Step 1: >> git init

Step 2: >> git add .

Step 3: >> git commit -m "setup commit"
               above command will print list of all files.

Step 4:  >>git remote add origin https://github.com/username/reponame.git

Step 5 : >> git push origin master

       if error :
                  To https://github.com/navyad/pollsite.git  ! [rejected]        master -> master (non-fast-forward) error: failed to push some refs to 'https://github.com/navyad/pollsite.git' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes (e.g. 'git pull') before pushing again.  See the 'Note about fast-forwards' section of 'git push --help' for details.
       then :
              >> git pull origin master
       
Step 6: >>git push origin master
       

Its done , you can check the git repo.