Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django installation first time

I started learning DJango for the first time. I have some amount of basic knowledge of python but DJango is first for me. I started with the documentation page of django, but i am getting stuck where it asks for

python manage.py syncdb

At present i do not have any database, so i assumed that SQLite comes with django. Not sure how to go ahead? Also i have downloaded the virtualenv-1.7.1.2 and installed it as well with,

python virtualenv.py ENV

I am following this video tutorial, it asks me to use,

sudo pip install virtualenv

But when i write the above code, the output is,

sudo: pip: command not found

Help me out!!

like image 961
Sam007 Avatar asked Apr 08 '12 21:04

Sam007


People also ask

How install Django step by step?

Django can be installed easily using pip . In the command prompt, execute the following command: pip install django . This will download and install Django. After the installation has completed, you can verify your Django installation by executing django-admin --version in the command prompt.

Do we have to install Django every time?

No you don't have to reinstall Django each time you make a new project, hopefully. Once you have installed it using pip , you just have to enter django-admin startproject <project-name> to get started.

Can a beginner learn Django?

You don't need previous Python or web development experience to complete this book. It is intentionally written so that even a total beginner can follow along and feel the magic of writing their own web applications from scratch.


1 Answers

Do not use sudo with virtualenv this is the easiest way to multiple problems later.

Begin by installing virtualenv - sudo apt-get install python-virtualenv

Next, as your normal user run the following commands:

  1. $ virtualenv --no-site-packages django-env
  2. $ source django-env/bin/activate
  3. (django-env)$ pip install django
  4. (django-env)$ django-admin.py startproject myproject
  5. (django-env)$ cd myproject
  6. (django-env)/myproject$ nano settings.py
  7. In settings.py, after 'ENGINE:' type 'django.db.backends.sqlite3', (don't forget the comma)
  8. In settings.py, after the 'NAME:' type 'site.db', (again, don't forget the comma)
  9. Save the file, and exit the editor
  10. (django-env)/myproject$ python manage.py syncdb
like image 93
Burhan Khalid Avatar answered Sep 20 '22 04:09

Burhan Khalid