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.
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
- sudo django-admin startproject project_name
- cd project_name
- python manage.py runserver or python manage.py runserver 8008
- Goto browser โ> localhost:8000 (8000 is default port)
- [Answered ]-Foreign method access in django template
- [Answered ]-WSGI as AuthFormProvider
- [Answered ]-Why does django date filter gives me entries from the next day as welll
- [Answered ]-Minimal developer setup of sorl-thumbnail with Django 1.7
- [Answered ]-Using two models on the same Admin page
Source:stackexchange.com