Connect with us

django

How to Upload our django project to github

Published

on

Hi in this article we will learn about how to upload our django project to github in an easy and understandable way. So lets start by first open up github and login there. Just create a new repository there by clicking on new button in the left side bar on github. Just like this:

Then just go ahead and name your repository anything you want, in my case i will name it as personal site using django. So lets go ahead and do that. After you created your repository you will see something like this.

Don’t worry if you haven’t see the readme.md file, i have initiated it manually, you don’t need to do that in the first place, You have your repository created. Now go ahead and open up your command prompt and open your django project in there and activate your virtual environment. You will see something like this.

Till now we have created our repository on github and we also activated our virtual environment where we have our project created. Now lets type git commands.

Initializing git:

In order to use git we first need to initialize git. For this we will type:

git init

You will a list of files that are not commited to git for now. Lets now type another command to add your files to git.

git add .

Once you do that you will see nothing but all of our files will be commited to git.

Now if you type git status you will a bunch of files coloured green, this means that our all files are now commited to our local git repository but now we will push these changes to our github. For this now lets connect our local git repository with the remote github repository.

Remote git Repo:

To connect our remote repository with our local repository we need to type the following command:

git remote add origin <repo ul>

You will find the repo url in the your github repository, Just like the one below:

just the copy the highlighted url and paste it into your cmd with the preceding command git remote add origin url, and here replace the word url with the url that you have copied from your remote repository.

Once you type the command above you will see something like this.

Now you have successfully connected your local repository with your remote github repository.

Now it is time to tell our repo that who is commiting changes. for this type the commands below:

git config --global user.email "Your email"
git config --global user.name "Your username"

Lets now commit changes into your repository:

Commit changes to git:

git commit -m "first commit"

Now it is time to commit our changes into remote repo.

Pushing changes to github:

To push changes onto our remote github repository first we must be connected to our remote repository that i showed you above how to do that. Now lets push our code to github by using the following command

git push origin master

Congratulations your code has been successfully added to your github repository. Now if you refresh github then you will see the changes there. I have also created a tutorial on how to create a personal website using django. Make sure to checkout that as well. You can find that tutorial here. and if you have any question feel free to ask in the comment section i will definitely answer.

if you want to learn more why it is important to use github then you must checkout this article here  it will tell you why it is important for programmers to use github. Thanks for reading this comprehensive article on how to upload our django project to github if you like the article then please tell me in the comment section and if you have some suggestions regarding to make quality of my articles better then feel free to tell me in the comment section as well. Thanks.

Continue Reading
1 Comment

1 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

django

How to Connect django to mysql in ubuntu[2020]

Published

on

By

Connect Django to MySQL is required because the database that comes with Django by negligence is sqlite3. Sqlite3 is a database that can be used inside small apps and outlines. But when it comes to exhibiting some high-quality apps/web apps in Django, then it became wanted to connect it with a good database that can handle a large amount of data. In this post, we are working to do that.

To rise connecting our Django project to the database, you should oblige python, Django and XMPP server installed on your system.

To install xampp on your system, you require to download the app and next install it inside your system. Here is an expeditious guide to installing xampp on your ubuntu running system.

You can likewise install the virtual environment and Django by following this example.

If you have Django and xampp installed on your system, suddenly you can start to connect Django to MySQL.

Create a new project in Django:

To build a new project in Django, just type the following commands in your terminal.

Django-admin start project MySQL connection

Open up xampp and run everything the services.

Once you do that, just go to localhost/PHPMyAdmin and generate a new database.

I will name it as MySQL connection, and you can name it whatever you need.

Once you function to create, then you are good to go. You don’t need to change anything there.

Startup settings.py file inside your Django project and move to the following part.

By default, our Django project is pointing to the sqlite3 database, and we require to improve this in order to manage a MySQL database. So let us go ahead and replace all of this text to the following code.

Once you change these settings, then you are good to go.

Now Save all the settings and open up the terminal and type the following command.

python manage.py migrate

Everything is running fine, and if you go to PHPMyAdmin, then you would reasonably see something like this.

You see that all the tables are favourably created. Thanks for reading this comprehensive post. If you have any question, you can ask me in the comment section. Thanks.

Continue Reading

django

5 amazing books to read as a django developer [2020]

Published

on

By

Hi, in this chapter, I will talk about five superb books to learn as a Django developer in 2020. So let us perceive started.

As you all might now that books play a significant role in learning anything weather, it is about the the stock market or any other field like programming. So as readers have a significant role in learning to program quickly and efficiently, we will be discussing five amazi////////ng books to read as a Django developer in 2020 because Django is a high-level framework. If you want to master it, then you should probably go with the books written by Django experts to learn the important topics of Django.

My no. 1 advice for Django beginners:

Before diving into the books list first let us discuss what should a beginner do when it was just starting Django development.

When You are starting in Django, then you should go with its Documentation.

Because Django has very comprehensive and clear Documentation and you could see a lot of Documentation. But that Documentation is written professionally, and as a beginner, you might be stuck. So here is the list of books you might concern when you are starting in Django development.

Learn through building projects in Django:

While you are learning programming, you might not follow some professional practices that will lead you to be good at it. So to understand the important stuff that you will need to use in some professional projects, you should start to learn to code by building projects.

I have some cool projects that I write about so that beginners in Django and intermediate level programmers get the benefit. Here is the list of some cool projects that I recommend you to start building with.

i – Create your website with Django: you can get the tutorial by clicking here.

ii – Create a resume builder website with Django: Here is the complete tutorial that you can follow.

iii – How to use bootstrap with Django: This post will teach you the best way to use bootstrap with your Django projects to make them responsive. Get it here.

Also,, I have prepared a list of projects that you can build right now. You can check that complete article here.

Now you can begin with the list of amazing books for you to be good at Django.

A list of 5 Amazing books you should read as a Django developer.

Book # 1:

Django for Beginners (best book in this list):

The best book on Django is Django for beginners by William S. Vincent. The reason why I kept this book on top of the list is that it is extremely summarized and also very comprehensively explained all the topics for beginners. This books starts from beginner teaching the basics of Django and then moves you around some high-level programming in Django framework whenever you feel comfortable in Django development. In short, it will teach everything you need to become a master in the Django framework.

Book # 2:

Django 2 web development Cook Book:

The next great book in this list is also a very great book for beginners. It is written by Jake Kronika, and it also covers a lot of beginners stuff. This book talks about Django 2, but the logic builds through this book can be used inside Django 3.

Book # 3:

Django 2 by Example:

This book is written by Antonio Mele, and it is one of my favourite books because it starts with build the projects and then by the end of building many projects taught in this you will eventually become a master in Django.

Book # 4:

Two Scoops of Django:

Another favourite book of mine is Two scoops of Django, and it is a bit older, it only talks about Django 1.8 but the logic you will learn in this book can be implied in the latest versions.

Book # 5:

The definitive guide to Django:

This book is also very informative if you want to learn Django web development from start to end. Once you finish reading and practising the lessons inside this book, then you will have a thorough understanding of how Django works.

I hope you have enjoyed a lot reading this tutorial now if you have any questions feel free to ask it in the comment section and I will definitely answer. You can also check out the post about Django books by data-flair here. Thanks.

Continue Reading

django

Amazing Project ideas for beginners in django [2020]

Published

on

By

django

Hi in this article i will introduce you some of my Amazing project ideas for beginners in django, So lets get Started

Remember one thing in mind you cannot proceed further without making projects and practicing much in the language or framework you are working right now because once you make some projects, eventually your knowledge will become clear and you will start doing what you want to do in programming.

Now you might know the importance of making projects in django. Lets Discuss some Amazing project ideas for beginners in django.

No 1: Build a TodoList App

While building this project you will learn quite a lot in django because it will give you in-depth knowledge of how everything fits up with each other in django because you will be using html, css and javascript with django for making your todolist app cool and you will learn a lot.

No 2: Build Your own Blog Using django:

The importance of building your own blog for being a programming is even more. Because by having a blog you can share your thoughts with other, and you will learn a lot by doing so. If you want to make a project using django then you should go with making your own blog.

No 3: Build a Personal website using django:

This is quite similar to the application above because you can embed your blog inside a static home page website as well. So here is my advice for creating your website.

Try to create a website with static homepage and create contact and about us pages. Then create a blog application and embed it inside your personal website. In this your website will look more professional and you will learn a lot of fundamentals of django by building this project as well. So go ahead and do that. I have a pretty great tutorial on this project and you can reference that tutorial as by going to the below link.

my personal website tutorial link: click here.

No 4: Build your own portfolio Website:

Let me introduce you what portfolio website really is:

A portfolio website is simply a website where you can show case your work. Try to make a website where you will be able to tell other people what you can do and post some of your projects their.

I have a comprehensive tutorial on this project as well, you can check that as well.

No 5: Build an Ecommerce Website:

Building an ecommerce website in django can be challenging and it will also helps you to make a strong logic about how to build an ecommerce website using django. Try to make a simple online shop and add cart options to it and then you can use this application to sell your projects online.

You can also read 12 project ideas by pythonistaplanet by clicking here

I hope you have quite a good knowledge of how to think for a project and start building it. If you have any question or query then feel free to ask in the comment section and i will definitely answer. Thanks.

Continue Reading

Trending