DEV Community

Cover image for Step-by-step procedure to post your Django project on GitHub
Akhil Chand
Akhil Chand

Posted on

Step-by-step procedure to post your Django project on GitHub

  • Open your project folder.

  • Create a virtual environment

  • Virtual environment isolates our project. Anything we install within the virtual environment does not affect the rest

of the computer and vice-versa.

  • on cmd: vitualenv . (to install virtual environment)

  • Activate the virtual environment by running activate.bat files within the scripts folder.

git status git commands

  • git init

This creates a .git folder on our project folder that means git is initialized.

  • git status

This shows all the folders that are not added to git.

  • git add -all

This adds all the files to git.

  • git commit -m "commit message"

This commits all folders to git.

  • git log

This shows the log of all commits in our repository. This displays most recent commits first.

  • Now we need to push our existing repository. First, we will need to add push our remote origin which is our remote
    repository that we created on GitHub. Copy the HTTPs web URL and paste in cmd.

  • git remote add origin weburl

  • Now, we will need to push our local repository to our remote repository or GitHub account we use.

  • git push -u origin master

  • In case we get an error 'failed to push some reps to weburl, run below commands

  • git pull --rebase origin master

  • git push origin master

  • Now we can see your project on your GitHub repository.

                     *** THANK YOU ***
    

Top comments (9)

Collapse
 
arung86 profile image
Arun Kumar G

@akhil I dint follow you on setting up the virtual environments,
are you talking about any VM ware kind of software and where is the .bat files and which one are you referring to

Collapse
 
akhilchand profile image
Akhil Chand

Hello Arun, This batch file(activate.bat) found in the Scripts folder created when we create a virtual environment for our Django project. This helps to keep dependencies required by different projects separate by creating isolated Python virtual environments for them.

Collapse
 
shivakrishnavaraprasad profile image
shiva krishna vara prasad

Clear | Crisp | Short | Direct
Thanks man @akhilchand

Collapse
 
akhilchand profile image
Akhil Chand

Thank you Shiva. I appreciate.

Collapse
 
amanchauhan112 profile image
amanchauhan112 • Edited

I watched so many videos but didn't worked but this worked :)
Thank You Akhil.

Collapse
 
akhilchand profile image
Akhil Chand

Great to hear :)

Collapse
 
jakemulhern profile image
Jake Mulhern

Very easy to follow. Much appreciated!

Collapse
 
nagaveni999 profile image
Nagaveni M S • Edited

@akhil thank you so much,I was able to correct my mistake and create it.

Collapse
 
akhilchand profile image
Akhil Chand

Glad to hear :)
It’s @akhilchand πŸ˜„