• This PPT explains three things
1. How to install Django framework on
Windows 8 64 bit OS?
2. How to configure aptana Stu...
How to install Django
framework on Windows 8 64
bit OS with Aptana?
Haris NP
haris@baabtra.com
www.facebook.com/haris.np
9...
Steps
• Install Python 2.7
• Install MySQL for Python (You need to install
the corresponding driver for your DBMS)
• Insta...
Step 1: Python installation
• Down load Python from the following link
– http://www.python.org/ftp/python/2.7.5/python2.7....
• Python 2.7 and Python 3.3
• In order to verify that Python is installed
properly, type python in the command
prompt. As we have added to the
environ...
Step 2: MySQL-Python-1.2.3 install
• Download the mysql driver for python from
the following link
http://www.codegood.com/...
• Double click on the EXE file
Now you might get this error
• Python version 2.7 required, which was not
found in the registry – Windows 8 64 Bit OS
Reason
• Setup is looking for the Python installation
registry value InstallPath
inHKEY_LOCAL_MACHINESOFTWAREWow64
32NodeP...
What to do?
• Open Run (Window + R)
• Type regedit
• Go to Wow6432Node as shown
• Click Edit  New  Key
• Create Folder Python
• Repeat the same steps by choosing the folder
Python
• Create the folder structure
• Python  PythonCore  2.7 InstallPa...
• Double click on (Default) as shown

• Copy paste the value from the registry
HKLM Software Python PythonCore
2.7  I...
• Double click on InstallGroup
• Change to the value in HKLM Software
Python PythonCore 2.7  InstallPath 
InstallGro...
• Rerun the MySQL-python-1.2.3.win32-py2.7
• Click next and click Finish
Verification
• Type import MySQLdb
Step 2: Install Django
• Download Django tar file from the following
location
https://www.djangoproject.com/download/1.5.
...
• Extract the files as shown
• Obtain the administrator command prompt
by typing Window + X
Allow the user control to make
changes on the computer
• From the administrator command prompt, Go
to the Django folder
• There will be a setup.py python file as shown
in the screen shot.
• In the command prompt, type the command
python setup.py install
• Press Enter
You can see something like this
Finally
• In order to verify that Django is installed,
please type import django in the python
command line as shown. If there is ...
• Now python and Django framework are
installed in your machine.
• Now for the IDE, you can install Aptana Studio.
Step3: Install Aptana Studio
• Download latest Aptana studio from
http://www.aptana.com/
• Double click the set up to inst...
Aptana Studio
Setting up Django in Aptana
• Go to Window  Preferences
• Click on Interpreter- Python under PyDev
Click on Auto Config
• It asks for which python folders to select as
shown
Select the options that are already
selected
• Click Ok and you can find
a screen shown
on the side
Click Apply
Click Ok
• Now you are ready to go 
First sample Django project
• Click on File  New  Other
• Select PyDev  PyDev Django Project
Click Next
• Provide the project name and click Next
• Select Django version as 1.4 or later. We had installed 1.5.5 (Refer
the initial slides)
• Database Type : mysql (You ca...
• After filling the form 
• Click Finish
• For verification, right click the project root
and Select Run As  PyDev: Django
Another possible error
• The interpreter configured does not exist in the
filesystem: C:Python33python.exe

• In my case t...
• Fix
• Go to Window  Preferences
Click on Auto Config
• Click OK
• Click Apply
• And then Ok.
• After that go to Project root folder Preference
• Click on “Click here to configure an interpreter
not listed”
• Remove Python 3.3 by clicking Remove
• Click Apply
• Click OK
Another Possible Error
• Traceback (most recent call last):
File "C:UsersadminDocumentsAptana Studio 3
WorkspaceBaabtraFir...
Reason
• Django was installed on Python 3.3. Now it
was reinstalled to Python 2.7. So we have to
reinstall the Django fram...
Final Verification
• New  Run As  PyDev: Django
• From the console, copy and paste
http://127.0.0.1:8000/ to a browser
Yes. It worked for you as well.
If this presentation helped you, please visit our
page facebook.com/baabtra and like it.

Thanks in advance.
www.baabtra.c...
Baabtra django framework installation and sample project using aptana
Baabtra django framework installation and sample project using aptana
Baabtra django framework installation and sample project using aptana
Baabtra django framework installation and sample project using aptana
Upcoming SlideShare
Loading in …5
×

Baabtra django framework installation and sample project using aptana

899 views

Published on

This explains the following questions.
1. How to install Aptana in Windows 8 64 bit os?
2. How to install Python in Windows 8 64 bit os?
3. How to install Django in Windows 8 64 bit os?
4. How to run a sample application in Django in Windows 8 64 bit os?
This will be useful for candidates who are learning Django framework.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
899
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Baabtra django framework installation and sample project using aptana

  1. 1. • This PPT explains three things 1. How to install Django framework on Windows 8 64 bit OS? 2. How to configure aptana Studio for using Django framework? 3. How to create a simple sample application using Django framework in Aptana Studio?
  2. 2. How to install Django framework on Windows 8 64 bit OS with Aptana? Haris NP haris@baabtra.com www.facebook.com/haris.np 9 twitter.com/np_haris in.linkedin.com/in/harisnp
  3. 3. Steps • Install Python 2.7 • Install MySQL for Python (You need to install the corresponding driver for your DBMS) • Install Django • Install Aptana
  4. 4. Step 1: Python installation • Down load Python from the following link – http://www.python.org/ftp/python/2.7.5/python2.7.5.msi (Please note that you should not install 64 bit version of the Python. If you install, you will get an error that MySQL is not a valid Win32 application). The idea is if you are using Python and MySQL, then you should use both Python and MySQL 32 bit. The 32 bit version of python will run in 64 bit operating system. – http://python.org/ftp/python/3.3.2/python3.3.2.amd64.msi (If you are using MySQL database, you can not use python 3.3.2 as there is no MySQL driver released for Python 3.3.2) – After installation, add the path of Python to the environment variables as shown in the screen shot
  5. 5. • Python 2.7 and Python 3.3
  6. 6. • In order to verify that Python is installed properly, type python in the command prompt. As we have added to the environment path, python command should execute from any folder in the computer
  7. 7. Step 2: MySQL-Python-1.2.3 install • Download the mysql driver for python from the following link http://www.codegood.com/download/10/ File Name : MySQL-python-1.2.3.win32py2.7.exe Or MySQL-python-1.2.4.win32-py2.7
  8. 8. • Double click on the EXE file
  9. 9. Now you might get this error • Python version 2.7 required, which was not found in the registry – Windows 8 64 Bit OS
  10. 10. Reason • Setup is looking for the Python installation registry value InstallPath inHKEY_LOCAL_MACHINESOFTWAREWow64 32NodePythonPythonCore2.7InstallPath. Notice the Wow6432Node, which is a registry compatibility layer used for 32-bit apps in Windows 8 64-bit
  11. 11. What to do? • Open Run (Window + R) • Type regedit
  12. 12. • Go to Wow6432Node as shown
  13. 13. • Click Edit  New  Key
  14. 14. • Create Folder Python
  15. 15. • Repeat the same steps by choosing the folder Python • Create the folder structure • Python  PythonCore  2.7 InstallPath InstallGroup
  16. 16. • Double click on (Default) as shown • Copy paste the value from the registry HKLM Software Python PythonCore 2.7  InstallPath
  17. 17. • Double click on InstallGroup • Change to the value in HKLM Software Python PythonCore 2.7  InstallPath  InstallGroup • In my case it is Python 2.7
  18. 18. • Rerun the MySQL-python-1.2.3.win32-py2.7
  19. 19. • Click next and click Finish
  20. 20. Verification • Type import MySQLdb
  21. 21. Step 2: Install Django • Download Django tar file from the following location https://www.djangoproject.com/download/1.5. 5/tarball/ • Copy and paste the tar file to C:Python33 (where you have installed your python) as shown in the attachment
  22. 22. • Extract the files as shown
  23. 23. • Obtain the administrator command prompt by typing Window + X Allow the user control to make changes on the computer
  24. 24. • From the administrator command prompt, Go to the Django folder
  25. 25. • There will be a setup.py python file as shown in the screen shot.
  26. 26. • In the command prompt, type the command python setup.py install • Press Enter
  27. 27. You can see something like this
  28. 28. Finally
  29. 29. • In order to verify that Django is installed, please type import django in the python command line as shown. If there is no error, you can confirm that it is installed successfully.
  30. 30. • Now python and Django framework are installed in your machine. • Now for the IDE, you can install Aptana Studio.
  31. 31. Step3: Install Aptana Studio • Download latest Aptana studio from http://www.aptana.com/ • Double click the set up to install Aptana Studio • It runs as a stand alone application.
  32. 32. Aptana Studio
  33. 33. Setting up Django in Aptana • Go to Window  Preferences
  34. 34. • Click on Interpreter- Python under PyDev
  35. 35. Click on Auto Config • It asks for which python folders to select as shown
  36. 36. Select the options that are already selected • Click Ok and you can find a screen shown on the side Click Apply Click Ok
  37. 37. • Now you are ready to go 
  38. 38. First sample Django project • Click on File  New  Other
  39. 39. • Select PyDev  PyDev Django Project
  40. 40. Click Next • Provide the project name and click Next
  41. 41. • Select Django version as 1.4 or later. We had installed 1.5.5 (Refer the initial slides) • Database Type : mysql (You can choose your database from the drop down list) • Database Host: localhost (you can give the IP address if you are using a different system) • Database Name: baabtra (Your database name) If you are using sqLite, the database will be created automatically. Other databases, you have to create the database before itself. • Port number 3306 (Your port number) • Username : root (Username for connecting to the database) • Password : ******(Your password for the username above for connecting to the database) • Please note that the above information will be stored in the configuration file for connecting to the database.
  42. 42. • After filling the form  • Click Finish
  43. 43. • For verification, right click the project root and Select Run As  PyDev: Django
  44. 44. Another possible error • The interpreter configured does not exist in the filesystem: C:Python33python.exe • In my case the error happened because I had installed Python 3.3 and when I tried to install Python-mysql connector, it was available only for Python 2.6. So I had to remove Python 3.3 and install 2.6.
  45. 45. • Fix • Go to Window  Preferences
  46. 46. Click on Auto Config • Click OK
  47. 47. • Click Apply • And then Ok. • After that go to Project root folder Preference
  48. 48. • Click on “Click here to configure an interpreter not listed” • Remove Python 3.3 by clicking Remove
  49. 49. • Click Apply • Click OK
  50. 50. Another Possible Error • Traceback (most recent call last): File "C:UsersadminDocumentsAptana Studio 3 WorkspaceBaabtraFirstDjangomanage.py", line 8, in <module> from django.core.management import execute_from_command_line ImportError: No module named django.core.management
  51. 51. Reason • Django was installed on Python 3.3. Now it was reinstalled to Python 2.7. So we have to reinstall the Django framework. • Follow the same steps as given in Step No.2 of this PPT
  52. 52. Final Verification • New  Run As  PyDev: Django
  53. 53. • From the console, copy and paste http://127.0.0.1:8000/ to a browser
  54. 54. Yes. It worked for you as well.
  55. 55. If this presentation helped you, please visit our page facebook.com/baabtra and like it. Thanks in advance. www.baabtra.com | www.massbaab.com |www.baab te.com

×