Creating Your First Python Project

In the previous post we downloaded Eclipse and PyDev.  I also recommended signing up for GitHub or Bitbucket.  Why?  Because the best way to manage your code is by using a source control system.    Github and Bitbucket offer Private accounts for a reasonable fee and Public projects are free. 

When i start a new project (e.g. Django Web Site), i use the following approach:

  • Setup a New GitHub Repository (see this post)
  • Add the GitHub project to Eclipse
  • Use the Eclipse PyDev Perspective and start developing

For this example, instead of using a “new” GitHub project, we will import an existing project django project to provide some structure to the solution.   Open Eclipse (close the “Welcome Page” if it is still open) and select  Window>Open Perspective> Other ….   Next select “Git Repository Exploring”.  Ignore any warnings about git.

image

The easiest way to add a project to eclipse is to clone an existing git project.  Navigate to the following project.  In Eclipse, click “Clone a Git Repository”.  Paste the URL and enter your username and password for the git account..  Click Next and Next again.  You can default the project to your workspace or select a different folder. 

https://github.com/troyscott/django-definitive-guide

image image
image image

If everything has been entered correctly the project will be cloned in your workspace folder:  Expand the git repository project tree and select the “Working Directory”.  Right click the “Working Directory” and perform the following steps.  

  • Select “Import Projects …”
  • Select radio button:   “Import as general project “
  • Click Next and then Click Finish
  • Select Window>Open Perspective>Other
  • Select PyDev
image image
image image

You have now successfully added a Django Python project to Eclipse.   Its important to remember that creating the project in GitHub or BitBucket simplifies setting up the project in Eclipse.   Next post we will make some changes to the project commit the changes locally and then push the changes to the remote repository (e.g. GitHub).

image

Troy

Python Development with Eclipse

Hopefully this post will be one of many focusing on web development using python (django) and the latest technologies for deployment (veewee).     These days it doesn’t really matter (in most cases) what platform you develop on (Windows, Linux, Mac).  But if you are focusing on OpenSource development using Apache/Nginx, MySQL/Postgres and Python/PHP/Perl  your solution should be deployed to a Linux environment.    However, the reality is that most of use Windows or Mac computers.   Secondly when it comes to using GUI based applications i still find Windows to be a better choice over Linux.   If your comfortable with vim or e-macs then their isn’t much value using a tool like Eclipse.

Configuring your environment for web development is an involved process.  So today we are just going to start with some basics by setting up a Python environment for Windows.   First of all, I recommend getting a git account at GitHub or BitBucket. This will be important in future posts and is also part of the “big” picture

Download and install the following:

Check out your Pyhton Install by opening a command prompt:

 image

If this works, open Eclipse and set your workspace (use the default).  Browse to the PyDev plugin at the Eclipse Marketplace or use the “drag to install button” below.  Yes you can literally drag the image below to Eclipse and it will install PyDev:

.

Here is an example of using the feature on Eclipse Marketplace:

image

Configure the python install by clicking Window>Preferences>PyDev :

image

Select the “Python Interpreter” and click “New”.  Set the “Interpreter Name” to something like “python27”.   Browse to the python executable (python.exe) which should be located in “C:\Python27\.  This could vary depending where you installed python.  It will then prompt you to select the folders for the system path.   Use the default settings and click OK. Click OK to exist the Preferences.  The python environment almost ready to go. 

image 

Next post will focus creating a python which will be cloned from a public GitHub repository.

Troy

“What’s Your Style” for SharePoint 2013

Getting started with SharePoint content in 2013 is a lot more intuitive.  Lets face it the first time you bring up the SharePoint site your users are going to want to start creating document libraries, wikis, blogs and possibly apply some simple styling to the site.

There is a lot for variety in SharePoint 2013 for Site Styles.  Its no longer the boring selection of odd pastel or primary color combinations.   Check out the Style option by selecting “What’s your style?” tile on the home page:

image image

Just click on the style you like and SharePoint will let you “try it out”.   If you like the preview then you can apply the style to the site:

image image

Select “Yes, keep it” to apply the new style.

Troy