1 | Installation Steps
|
---|
2 | ******************
|
---|
3 |
|
---|
4 | sudo apt-get install python-pip python-dev build-essential
|
---|
5 |
|
---|
6 | sudo pip install django
|
---|
7 |
|
---|
8 | sudo pip install Django --upgrade
|
---|
9 |
|
---|
10 | (for latest Version)
|
---|
11 |
|
---|
12 | sudo apt-get install python-mysqldb
|
---|
13 |
|
---|
14 |
|
---|
15 | Creating A Project
|
---|
16 | ******************
|
---|
17 |
|
---|
18 | Enter into Folder where website Project needs to be created
|
---|
19 |
|
---|
20 | django-admin.py startproject itechtalents.com
|
---|
21 |
|
---|
22 | To Start Django Server
|
---|
23 |
|
---|
24 | python manage.py runserver
|
---|
25 |
|
---|
26 | Mysql
|
---|
27 | *****
|
---|
28 |
|
---|
29 | sudo apt-get install mysql
|
---|
30 |
|
---|
31 | mysql -u root -p
|
---|
32 |
|
---|
33 | mysql > create database django
|
---|
34 |
|
---|
35 | Configure Mysql DB in Django
|
---|
36 | ****************************
|
---|
37 |
|
---|
38 | Modify Settings.py in project and project (subfolder)
|
---|
39 |
|
---|
40 | DATABASES = {
|
---|
41 | 'default': {
|
---|
42 | 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
|
---|
43 | 'NAME': 'django', # Or path to database file if using sqlite3.
|
---|
44 | 'USER': 'root', # Not used with sqlite3.
|
---|
45 | 'PASSWORD': 'Support1', # Not used with sqlite3.
|
---|
46 | 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
|
---|
47 | 'PORT': '3306', # Set to empty string for default. Not used with sqlite3.
|
---|
48 | }
|
---|
49 |
|
---|
50 |
|
---|
51 |
|
---|
52 | If you are in ubuntu (linux/unix) you need to got to
|
---|
53 | 1) /usr/local/lib/python2.6/dist-packages
|
---|
54 | 2) when you do ls there will be directory called django.
|
---|
55 | 3) do rm -rf django.
|
---|
56 | By doing this django will be removed.Now you can install any version of django you want.
|
---|
57 |
|
---|
58 |
|
---|