Windows with Plesk Panel installs ActiveState Python 2.5.0 - any thoughts? - python

I expect to run Pylons on a Windows Server 2003 and IIS 6 on a Virtual Private Server (VPS). Most work with the VPS is done through the Plesk 8.6 panel. The Plesk panel has a lot of maintenance advantages for us. However, this Plesk configuration installs ActiveState Python 2.5.0. The Parallels Plesk documents for 8.6 and version 9 insist that only this configuration should be installed.
I'm not eager to settle for the baseline 2.5.0. but don't see any safe upgrade path. How has ActiveState Python 2.5.0 been for other users? Can you replace the Parallels\Plesk\Additional\Python
with another distribution? I don't want to break Plesk, please.
Previously, I followed these instructions, Serving a Pylons app with IIS - Pylons Cookbook
Using the default web site IP address, I had Python 2.6.3 installing the ISAPI-WSGI dll in IIS so that I successfully ran Pylons in a virutalenv through IIS using the IP address, no domain name. I would be so happy if I could run this successful configuration for my domains while I must use Plesk.
Tips and solutions appreciated.

The default Python install location is something like c:\python26. I think it's likely you could install the latest python there, without it conflicting with the ActiveState Python. (You may have to deal with path issues or conflicts over which copy 'owns' python source files in Explorer, though.)

Related

Why do I need to create a virtual environment for my public Django application?

I've been running my Django project (website) in my local virtual environment. However I now want to go live and make the website public - so I've created my remote server on Digital Ocean, and have been following it's tutorial on settings up Django. However I've reached this point in the tutorial where it says to create a virtual environment. I thought virtual environments were only used for testing your application offline? Why do I need a virtual environment for my application running on a remote server?
I'm not really familiar with Digital Ocean, but creating a virtualenv should not be strictly required.
It is still a good idea and I'd recommend doing it though.
It will prevent packages required for your application that you install to your virtual environment from messing up other Python applications requirements.
For example, let's say your application requires coolpackage 0.9.12, and another application requires coolpackage 1.1.6. If there are breaking changes going from 0.9.12 to 1.1.6, installing coolpackage 1.1.6 will break your first application.
Also, keep in mind that some functionality of your operating system might require specific versions of Python packages (which might even have been installed by some other means than pip) that you could break in this way.

Parallel Python install on Media Temple DV server

Plesk on the MediaTemple DV servers uses Python 2.4 for stuff, so the 2.4 install can't be replaced but someone recommended installing a separate python 2.7 install since my app runs on that. I'm new to the whole server thing, so this is new territory. My sense is that I can create a new directory for the source files and use SSH to download the files to said directory and then cd into it and install python 2.7. Then I have to figure out how to make sure Apache knows to use Python 2.7 to run the django app in question. Does this sound correct?
Unless you can make a system wide change to your python installation, you would have to run Apache, python and Django in the same virtual environment. If it is not possible, use gunicorn (instead of apache) to run the Django app in a virtualenv (in a port different from Apache's). If this app runs in a subdomain, you should consider hosting the Django app in a PAAS (Heroku, Google App Engine, etc.) which allow you to easily switch running environments.
Never mind, sorted it. the important thing seemed to be to edit the etc/ld.so.conf by adding usr/local/lib, then running sbin/ldconfig, which then makes ld.so.conf look like:
include ld.so.conf.d/*.conf
/usr/local/lib
Donwload and then compile Python
and use make && make altinstall.

Running Heroku Cedar Locally using Vagrant

I would like to develop my Django Heroku app in an environment as close to Heroku's Cedar stack as possible using Vagrant.
The best solution I have found so far for building the mocked up environment is Eric Holmes' excellent https://github.com/ejholmes/vagrant-heroku. However, this vagrant box currently uses python 2.6.x instead of the Python 2.7.4 my app uses and Heroku defaults to.
The other resource I have found is Heroku's https://github.com/heroku/stack-images. I have not tried this yet, but it seems to offer a way of creating a cedar stack locally. It ends up with Python 2.7.2.
Which of these (or something else) is the best way to go? I have a development environment that works now -- and it uses all the same software that Heroku uses (PostgreSQL, Python 2.7.4, etc.) -- but I would like to simulate some of the other aspects of the Heroku environment (memory available, disk space, multi-machine architecture, etc.).
I am leaning towards using Eric Holmes' box and adding Python 2.7.4 per https://askubuntu.com/questions/101591/how-do-i-install-python-2-7-2-on-ubuntu. I'd offer a patch to Eric's work, but I'm no Rubyist/veewee...
Update 1: Another possible resource: https://github.com/torchbox/vagrant-django-base.
Update 2: I've decided to roll my own by adapting from the above sources and others. These are the files (Vagrantfile and vagrant_data/install.sh) that I am currently using with some success: https://gist.github.com/ErikEvenson/5801503. This gets me to Python 2.7.3 and PostgresSQL 9.2.4 on a Ubuntu 12.04 512MB box.
I'd like to split off the database server with a second box and get the app server on Ubuntu 10.04 with Python 2.7.4.
Update 3: My setup has evolved. This is my current vagrant config: https://gist.github.com/ErikEvenson/9763878.
Update 4: I made several updates to my setup this week. The latest is at https://gist.github.com/ErikEvenson/9763878. Of note:
Use NFS instead of virtualbox folder syncing - huge performance improvement.
Avoid guest addition bug in current virtualbox version.
Use newly available Vagrant Cloud for versioned base box.
Update 5: Several updates here -- mostly software versions. The latest is at https://gist.github.com/ErikEvenson/9763878. Of note:
Uses Vagrant 1.6.3
Uses PostgreSQL 9.3.3
Uses python 2.7.7 and installs it from source. python 2.7.3 is retained as the system python.
Locks down all dependency versions -- especially those installed via apt-get and npm.
Uses hashicorp/precise64 as a base box.
The file structure to use is something like this:
- Project directory
-- vagrant_data
--- db
---- install.sh
---- memcached.conf
---- pg_hba.conf
---- postgresql.conf
---- redis.conf
--- web
---- install.sh
-- Vagrantfile
Update 6: Turns vagrant-vbguest on since VirtualBox 4.3.14 fixes some bugs.
You could try Dokku which support Heroku buildpacks
You can see my solution to this at https://gist.github.com/ErikEvenson/9763878.

How do I setup a local Django development environment on Ubuntu?

Finally made the switch from Windows to Linux (Ubuntu). I am teaching myself Python + Django.
GOAL: I want to setup a local development environment where I can build a django application and run it locally before deploying it live online.
SO FAR: Python comes installed with Linux. Gedit does also. Ok great. After that I am lost.
I am not sure how to proceed. I am a total Linux noob. I am guessing I need apache running, mysql running, and django to run. I don't know how to setup these things to run or how to set the proper directories or what I need to link to what... really I am not even sure what the right questions are to ask.
Quick answer:
Just install django via their documentation, and you will not even need apache running as it will run its own server. You can use sqlite as a db and you won't even have to worry about mysql. This is if your goal is to learn django and get things running asap.
Otherwise, if you want to take the full route, you'll need to start learning a lot more (which isn't a bad thing). I'd say take a look at some of the slicehost guides for setting up apache, mysql in ubuntu:
http://articles.slicehost.com/2010/5/19/installing-apache-on-ubuntu
http://articles.slicehost.com/2011/3/10/installing-mysql-server-on-ubuntu
And then pick up with just installing django and going from there. The django tutorial is awesome. There's plenty of other documentation out there on the web & tutorials for setting up dev environments.
Assuming you have python
You can install pip:
easy_install pip
From now you can use pip to install your python libraries for example to install django
pip install django
For development I would prefer pydev, it has a support for django with the power of eclipse.

Easiest way to share work between backend and front end

Hey everyone,
I am expanding my team and I have recently added an additional front end engineer on my site. I am currently using django to run my site but my site is using a lot of plugins, namely: django-celery, django-mailer, django-notification, and django-socialregistration.
Let me describe my situation:
He is using Mac OS X, and I have no experience in installing stuff on mac os X or configuration on that platform
I believe that getting my backend to run on his computer might be somewhat troublesome, i.e. I have to install a bunch of plugins (which are not available on pip or easy_install as they are the latest version) and I have also made heavy modification to django-socialregistration which I am currently using by symlinking to the modified code in my repos in my python path
I tried to look into solutions like pip and easy_install but I have not been able to get them to install code from github
I think the easiest way is to get my backend working on his computer and then he just commiting to the repos. Any ideas how I can make this easy?
Another, free option, is to use VirtualBox. I would recommend installing the same OS on it as your production server. Then, he's developing in the same environment as the live site, and can just check into the repo the same as you. Hey, you may want to do the same on your end--then both of your environments are the same and also the same as the live site.
Get him to set up a virtual machine on his Mac, using VMWare Fusion or Parallels, running the same operating system that you currently use for your back end. If he prefers developing using Mac tools he can do still that by sharing his local changes to the virtual machine via a shared directory.
An alternative, if that's possible, would be to set up a testing/development environment on a machine with an OS you're familiar with, then install something like Dropbox on his local machine where he can develop the frontend code, and install Dropbox on that other environment with the backend components. Dropbox would sync his local changes to that testing environment for him to run the code on.
That way, he would be able to use that environment to test his code, you wouldn't need to set up a backend on his machine (or keep it up to date) and you'd still be getting the same functionality.
Again, if that's an option.

Categories