[Answered ]-How to run Django after Ubuntu 14.04 install

1๐Ÿ‘

โœ…

pip install django It will install into global and in any directory django-admin.py startproject to create your Django project.

So after installing django you can import django from the python shell

Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> 

So as @Filly suggested use virtualenv is best for working with django and installing packages

pip install virtualenv==1.11.6 

after installing try below commands

virtualenv source/bin/activate

And after you are in virtual environment. Here you can install any packages Django or whatever it ll lie in environment only.

๐Ÿ‘คRaja Simon

1๐Ÿ‘

Django can work without virtual env in ubuntu

install django

sudo pip install django==1.7 
or 
Sudo pip install django==1.8

The path of django installation module repo

python -c "import sys; sys.path = sys.path[1:]; import django;
print(django.__path__)"

Now goto terminal

$ python


>>> import django
>>> django.VERSION

Now start a django project

  1. sudo django-admin startproject project_name
  2. cd project_name
  3. python manage.py runserver or python manage.py runserver 8008
  4. Goto browser โ€“> localhost:8000 (8000 is default port)
๐Ÿ‘คSiddharth Kumar

Leave a comment