07 March 2014

Starting with Django in Ubuntu - Installation

16 comments

Installing django in UbuntuHi Guys, Today we are going to setup our Ubuntu system for Django Development, as you all know that Django is a free and open source web application framework, written in Python, which follows the model–view–controller architectural pattern. Django's installation is somewhat tricky for beginners as it required many things to take care of. Don't worry, In this post I will cover each and every thing that required for Django installation and I will guide you, how to set up your first project in Django . So lets get started.


How to Install Django in Ubuntu


Step 1. Install pip : pip is a package management system used to install and manage software packages written in Python. It is prefered over easyinstall in python. You can read more about pip from Here.

$ sudo apt-get install python-pip

Step 2. Install virtualenv using pip : virtualenv is a tool to create isolated Python environments. You can read more about virtualenv from Here.

$ pip install virtualenv

Step 3. Install virtualenvwrapper using pip : virtualenvwrappers is used for creating and deleting virtual environments and otherwise managing your development workflow, making it easier to work on more than one project at a time without introducing conflicts in their dependencies. Read more about virtualenvwrapper from Here

$ pip install virtualenvwrapper

Step 4. Go to Home folder using following command and create django folder.

$ cd && mkdir django

Step 5. Create virtual python environment in this folder.

$ cd django
$ virtualenv --no-site-package django_test

Note: Above command create django_test virtual environment in django folder.

Step 6. Activate your virtual environment using following command

$ source django_test/bin/activate


Note: If you are seeing prompt like this in your terminal, then you are going good.

Step 7. Install Django

(django_test)$ pip install django

Step 8. Create first django project

(django_test)$ cd django_test
(django_test)$ django-admin.py startproject django_project

Step 9. Start your project

(django_test)$ cd django_project
(django_test)$python manage.py runserver
Validating models...

0 errors found
March 08, 2014 - 05:14:37
Django version 1.6.2, using settings 'django_project.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

Note: copy & paste http://127.0.0.1:8000/ in your browser and you will see the following page


Step 10. Deactivate your virtual python environment using following command

(django_test)$ deactivate
$

Hurray! We have successfully setup and run our first django project. In next part we will see the use of virtualenvwrapper and setup our first app. Hope fully you have enjoyed post.

Have a nice day and Enjoy :)


If You Liked This Post Please Take a Time To Share This Post

You May Also Like...

16 comments:

  1. Because of posts like this I surf the internet and when I found you, the time I felt I was wasting, just turned my thoughts around and now I am thinking I invested my time in something really interesting.

    ReplyDelete
  2. Really, these quotes are the holistic approach towards mindfulness. In fact, all of your posts are. Proudly saying I’m getting fruitfulness out of it what you write and share. Thank you so much to both of you.
    J2EE Training in Chennai
    JAVA Training in Chennai
    Linux Training in Chennai

    ReplyDelete
  3. Hi, and Thank you for explaining this in step wise manner, it helps me alot.
    Thank you once again...!
    web applications development,
    desktop application development,
    mobile application development,
    SEO Services

    ReplyDelete
  4. Assignmentservicerating is best reviews site.We at Top Quality Assignment believe that there is no shortcut to success and to attain success, hard work, dedication, and commitment must be present.my assignment help review best reviews site.

    ReplyDelete
  5. Kaçak bahis sektörüne dair tüm gelişmeler ve objektif yorumları paylaşıyoruz. İllegal bahisten para kazanmanız çok kolay. Kaçak iddaa siteleri

    Güvenilir bahis sitelerinin ortak özellikleri nelerdir? Güvenli ve sorunsuz bahis oynamak için bizleri takip edin. Güvenilir canlı bahis siteleri

    Bahis siteleri lisans ve kullandıkları altyapılarına göre sıralanmaktadır. Kaliteli bir bahis sitesinin mutlaka geçerli bir lisansı olmalıdır. kaliteli bahis siteleri

    ReplyDelete
  6. This is where you might have started your search for AllAssignmentHelp reviews.The previous consumers give their feedback on the website to let the other users know about the quality of their service.

    ReplyDelete
  7. Very usful post, Thanks for sharing. Keep your work. Domain and Hosting

    ReplyDelete
  8. If you are looking for the Software Engineering Help assignment then in this case you can opt for our Essay Writing.we provide the best online assignment help.We also provide law essay help for students across the globe. for more information contact us +16692714848.


    ReplyDelete
  9. With the growing number of people owning a companion animal, the demand for Veterinary Orthopaedic Implants Market is growing rapidly. People are willing to spend more on the health of their pets, which is strengthening the demand for the products used for the health and well-being of the animals.

    ReplyDelete
  10. Your post is very helpful and information is reliable, Django is very helpful to Ubuntu OS, because this features get a good output results. We provide the best Buy Essay Service in San Diego with all the required resources for essays help, so the quality they produce should be top class. Thank you for this wonderful information share and excellent information providing by your article. keep it up!!

    ReplyDelete
  11. This comment has been removed by the author.

    ReplyDelete
  12. Thanks for sharing this knowledgeable blog, really an excellent informative website. It's advantageous.
    Visit Here: B2B Marketing

    ReplyDelete

  13. I would want to take this opportunity to thank you for all of the hard work that you have put into ensuring the completion of this project without any problems.. how to get paint off vinyl floors

    ReplyDelete
  14. Starting with Django in Ubuntu can be an exciting journey for aspiring web developers. Django, a powerful Python framework, offers a seamless way to build robust and scalable web applications. If you're new to Django and using Ubuntu as your operating system, this guide will provide you with the necessary steps to get started.

    Firstly, it's important to ensure that you have Python installed on your Ubuntu machine. Django requires Python version 3 or above. You can check your Python version by opening a terminal and typing "python --version". If Python is not installed, you can install it by running the command "sudo apt-get install python3".

    Once you have Python installed, the next step is to set up a virtual environment for your Django project. A virtual environment allows you to isolate your project's dependencies from the system-wide packages. To create a virtual environment, open a terminal and navigate to your desired project directory. Then run the command "python3 -m venv myenv" where "myenv" is the name of your virtual environment.

    After creating the virtual environment, activate it by running the command "source myenv/bin/activate". You will notice that your terminal prompt changes to indicate that you are now working within the virtual environment.

    Now that we have our virtual environment set up, we can proceed with installing Django. In the activated virtual environment, run the command "pip install django". This will download and install the latest version of Django.

    Once Django is installed, you can start a new project by running the command "django-admin startproject myproject". Replace "myproject" with the desired name of your project.

    To verify that everything is set up correctly, navigate into your newly created project directory by running "cd myproject", and then start the development server using "python manage.py runserver".

    You should see output indicating that the development server has started successfully. Open your web browser and visit http://localhost:8000 to see the default Django welcome page.

    Congratulations! You have successfully started a Django project in Ubuntu. Now you can start building your web application by creating Django apps, defining models, and writing views and templates.

    Remember to always activate your virtual environment before working on your Django project by running the command "source myenv/bin/activate" in your project directory. This will ensure that you are using the correct Python interpreter and have access to the necessary dependencies.

    Happy coding with Django in Ubuntu! Most students are drawn to these types of articles and information, but they are unable to prepare for their exams, If you have been struggling with your exams and want assistance, students can pay professional test takers for hire and get higher grades on their examinations by providing them with the best available resources, including quality academic services.

    ReplyDelete
  15. Choosing the perfect name for your Boys Names is an exciting journey filled with endless possibilities. From timeless classics like James and William to unique and trendy options like Aiden and Liam, the world of boys names offers a diverse and charming array of choices. Each name carries its own story, heritage, and meaning, making it a reflection of your hopes and dreams for your little one. In this exploration of boys names, we'll delve into the rich tapestry of possibilities, from traditional favorites to modern gems, helping you discover the name that resonates most with your family and your little boy.

    ReplyDelete
  16. What incredible abilities you are exhibiting! I discovered a wealth of information. For anyone seeking assignment help, we are providing assignment help canberra, delivered on time by professional authors. It gives you the idea that you will study different areas and topics. we offer the best assistance to those approaching our assignment helpers.

    ReplyDelete