Recommended dev environment for a Django project deployed to Linode

2013-09-16 Thread Jorge Arevalo
Hello,

I'm going to start a project based on (Geo)Django + PostgreSQL/PostGIS + 
OpenLayers/LeafLet + Bootstrap/Foundation. The project will be deployed to 
a Linode box. That box will be created with something like 
this: https://manager.linode.com/linodes/deploy/linode393074?StackScriptID=6482

My work box is a MacBook with Mac OS X 10.6.8. There will be 2 people 
working on the web app (me and another guy). I have almost total freedom to 
choose, so I want to choose wisely. The whole point is that these 
constraints should be satisfied:

- I need a reliable way to upload the application to the test/production 
environments. At least the production environment will be a Linode box. I 
just don't want to upload files via FTP, or manually copy them with rsync, 
or any other practice easily subject to errors. How do the professional 
django developers set up their environment in order to deploy the app?

- I'm not sure about which IDE/editor choose. I don't want to start an 
editor war, and I've used several options in the past. My main interest is: 
I want to focus on develop. If Eclipse/Aptana/Eric/PyCharm/any IDE can be 
easily "linked" to my environment, that's my choice. For example, if I can 
deploy my app to test/production environment with a couple of clicks or 
commands, thanks to a plugin or script, that's great. Like deploying to 
Heroku or EC2, but with Linode. Is there any IDE specially friendly with 
this kind of development environment?

- The other(s) developer(s) must be up&running ASAP. They can't spend half 
a day installing and configuring stuff to start being productive. I guess a 
VirtualBox machine + Vagrant would be a good choice here. But, would it 
make more difficult the deployment cycle? And using a virtual machine to 
just open the IDE and develop sounds like a resource waste to me. Is there 
any other solution?

I think I should use, at least, VirtualEnv, VirtualEnvWrapper and PIP, like 
I've read in these useful links

http://www.slideshare.net/ryan_blunden/virtualenv-and-pip-isolated-python-environments
http://www.slideshare.net/ajdiaz/isolated-development-in-python

But I'd like to know the opinion of Djanjo experts / hard "pythonistas". 
Any suggestion is strongly appreciated.

Many thanks in advance, and best regards

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Recommended dev environment for a Django project deployed to Linode

2013-09-16 Thread Jorge Arevalo

On Monday, September 16, 2013 7:33:49 PM UTC+2, Jorge Arevalo wrote:
>
> Hello,
>
> I'm going to start a project based on (Geo)Django + PostgreSQL/PostGIS + 
> OpenLayers/LeafLet + Bootstrap/Foundation. The project will be deployed to 
> a Linode box. That box will be created with something like this: 
> https://manager.linode.com/linodes/deploy/linode393074?StackScriptID=6482
>
> My work box is a MacBook with Mac OS X 10.6.8. There will be 2 people 
> working on the web app (me and another guy). I have almost total freedom to 
> choose, so I want to choose wisely. The whole point is that these 
> constraints should be satisfied:
>
> - I need a reliable way to upload the application to the test/production 
> environments. At least the production environment will be a Linode box. I 
> just don't want to upload files via FTP, or manually copy them with rsync, 
> or any other practice easily subject to errors. How do the professional 
> django developers set up their environment in order to deploy the app?
>
> - I'm not sure about which IDE/editor choose. I don't want to start an 
> editor war, and I've used several options in the past. My main interest is: 
> I want to focus on develop. If Eclipse/Aptana/Eric/PyCharm/any IDE can be 
> easily "linked" to my environment, that's my choice. For example, if I can 
> deploy my app to test/production environment with a couple of clicks or 
> commands, thanks to a plugin or script, that's great. Like deploying to 
> Heroku or EC2, but with Linode. Is there any IDE specially friendly with 
> this kind of development environment?
>
> - The other(s) developer(s) must be up&running ASAP. They can't spend half 
> a day installing and configuring stuff to start being productive. I guess a 
> VirtualBox machine + Vagrant would be a good choice here. But, would it 
> make more difficult the deployment cycle? And using a virtual machine to 
> just open the IDE and develop sounds like a resource waste to me. Is there 
> any other solution?
>
> I think I should use, at least, VirtualEnv, VirtualEnvWrapper and PIP, 
> like I've read in these useful links
>
>
> http://www.slideshare.net/ryan_blunden/virtualenv-and-pip-isolated-python-environments
> http://www.slideshare.net/ajdiaz/isolated-development-in-python
>
> But I'd like to know the opinion of Djanjo experts / hard "pythonistas". 
> Any suggestion is strongly appreciated.
>
> Many thanks in advance, and best regards
>
>
Sorry, the first link (from linode) requires login. It was a link to the 
description of a StakScript that does this in a Linode box: 

"A Linode.com StackScript shell script that configures a complete web 
environment with Apache, PostgreSQL/MySQL/MongoDB, Python, mod_wsgi, 
virtualenv and Django.

Optionally creates a PostgreSQL/MySQL user and database and installs 
MongoDB NoSQL database.

By default, it creates a VirtualHost using the reverse DNS of your Linode's 
primary IP and sets up a sample Django project in the /srv directory.

Installs common system and dev utilities, sets up postfix loopback, 
Uncomplicated Firewall and Fail2Ban.

Writes command output to /root/stackscript.log and records /etc changes 
using etckeeper and git. When completed notifies via email.

This StackScript is a mashup of nigma's excellent system setup StackScripts 
(https://github.com/nigma/StackScripts) and a92bz53/steakknife's etckeeper 
StackScript (https://gist.github.com/steakknife/3452111)."
 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Recommended dev environment for a Django project deployed to Linode

2013-09-25 Thread Jorge Arevalo
Hello,

First of all, many thanks for your response. Sorry for the delay answering 
this. I was in a business trip. 

So, you basically have 2 environments: your own machine, and the Linode 
box. You make the development and testing in your machine, and Linode is 
for production purposes. And you connect both environments via dvcs 
push/pull. Right?

I like it because it's simple and doesn't seem to be specially prone to 
errors. I'd just like to add a third scenario here, to end up with:

- Development environment: my own machine (Mac OS X) with all the software 
stack installed.
- Testing environment: my new addition. I would like to put this 
environment outside of my machine
- Production environment: the Linode box.

I can do the communication via push/pull, if there's no other way to 
"deploy" software to production with Python/Django (it's simple, I like 
it). And maybe I can have 2 urls (testing and production) in the Linode 
box. Testing just accessible to developers and testers, and production open 
to normal users. Does it make sense?

Thanks again

On Tuesday, September 17, 2013 3:50:55 PM UTC+2, Vernon D. Cole wrote:
>
>
> I installed a client for my favourite distributed version control system 
> on my Linode instance.  I have a private repository on a public IP.  
> (github, bitbucket, or launchpad will work, depending on your dvcs of 
> choice -- I have used all three, and other times I have used a private dvcs 
> host, including my Linode server itself.) I "cloned" a "checkout" of my 
> django system to the Linode. When I am happy from testing a new version of 
> my application:  I push it to the repository,  log in to my Linode using 
> ssh, and do a pull.  Easy and error free.  (My django environment is almost 
> exactly like yours with PostGIS, etc.)
> --
>
> On Monday, September 16, 2013 6:33:49 PM UTC+1, Jorge Arevalo wrote:
>>
>> Hello,
>>
>> I'm going to start a project based on (Geo)Django + PostgreSQL/PostGIS + 
>> OpenLayers/LeafLet + Bootstrap/Foundation. The project will be deployed to 
>> a Linode box. That box will be created with something like this: 
>> https://manager.linode.com/linodes/deploy/linode393074?StackScriptID=6482
>>
>> My work box is a MacBook with Mac OS X 10.6.8. There will be 2 people 
>> working on the web app (me and another guy). I have almost total freedom to 
>> choose, so I want to choose wisely. The whole point is that these 
>> constraints should be satisfied:
>>
>> - I need a reliable way to upload the application to the test/production 
>> environments. At least the production environment will be a Linode box. I 
>> just don't want to upload files via FTP, or manually copy them with rsync, 
>> or any other practice easily subject to errors. How do the professional 
>> django developers set up their environment in order to deploy the app?
>>
>> - I'm not sure about which IDE/editor choose. I don't want to start an 
>> editor war, and I've used several options in the past. My main interest is: 
>> I want to focus on develop. If Eclipse/Aptana/Eric/PyCharm/any IDE can be 
>> easily "linked" to my environment, that's my choice. For example, if I can 
>> deploy my app to test/production environment with a couple of clicks or 
>> commands, thanks to a plugin or script, that's great. Like deploying to 
>> Heroku or EC2, but with Linode. Is there any IDE specially friendly with 
>> this kind of development environment?
>>
>> - The other(s) developer(s) must be up&running ASAP. They can't spend 
>> half a day installing and configuring stuff to start being productive. I 
>> guess a VirtualBox machine + Vagrant would be a good choice here. But, 
>> would it make more difficult the deployment cycle? And using a virtual 
>> machine to just open the IDE and develop sounds like a resource waste to 
>> me. Is there any other solution?
>>
>> I think I should use, at least, VirtualEnv, VirtualEnvWrapper and PIP, 
>> like I've read in these useful links
>>
>>
>> http://www.slideshare.net/ryan_blunden/virtualenv-and-pip-isolated-python-environments
>> http://www.slideshare.net/ajdiaz/isolated-development-in-python
>>
>> But I'd like to know the opinion of Djanjo experts / hard "pythonistas". 
>> Any suggestion is strongly appreciated.
>>
>> Many thanks in advance, and best regards
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Recommended dev environment for a Django project deployed to Linode

2013-09-25 Thread Jorge Arevalo
Fine. I don't think my boss is going to pay for PyCharm license, so I'll 
probably go for Eclipse now (I don't really like it too much, but if works, 
it's ok for me)

About virtualenv, is there any method to provide something like a script to 
create a virtualenv, install the needed software and have a working 
environment in a few commands? Something like "vagrantfile for 
virtualenv" http://docs.vagrantup.com/v2/vagrantfile/index.html

Again, many thanks for your useful insights

On Tuesday, September 17, 2013 4:29:14 PM UTC+2, Vernon D. Cole wrote:
>
> Answering the other half of your question:  The choice of IDE is not 
> nearly as important as its ease of integration with your dvcs.  If you are 
> already familiar with a good one, don't change.
>
> On my present project, my boss and I are both using PyCharm, and my other 
> co-worker is using Eclipse, since he is more comfortable (and therefore, 
> more productive) with it. Both IDE's have good integration with git (my 
> least favourite dvcs, but the boss's choice) and our sharing is done using 
> a group private repository on github.  This is on Ubuntu Linux, it all 
> works well.   In the evening hours, I use PyCharm on Windows 7 to 
> contribute to an open source project hosted on bitbucket using mercurial. 
> Both projects end up being tested on the same Linode.
>
> Yes, use virtualenv.  I also made the mistake of thinking of it as a 
> virtual computer.  It is not.  It is only a method of separating Python 
> library directories so that you can experiment with different 
> configurations easily.  It does not slow anything down, and actually makes 
> installation of packages easier.  Use virtualenvwrapper to make switching 
> environments easy.  PyCharm also supports virtual environments as well as 
> django projects. It is commercial, and suffers from a few Java 
> idiosyncrasies, but the boss paid for the license ;-) so I don't mind.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Recommended dev environment for a Django project deployed to Linode

2013-10-09 Thread Jorge Arevalo
Thanks both for the suggestions! (and sorry for the delay, I was on a 
business trip). Looks like there's a lot of things to learn. I'll probably 
use a staging machine, like suggested. And now I'm between Eclipse, emacs 
and PyCharm. Time to work!

On Wednesday, September 25, 2013 9:48:26 PM UTC+2, Vernon D. Cole wrote:
>
> Yes, I like to have three levels, too.  I call the middle one "staging".  
> You can tear it down and build it up again as many times as needed to get 
> it right.
>
> A ten-year-old PC will work fine for staging practice. Blow the dust out 
> (the dust affects cooling and leads to poor reliability), load Ubuntu, and 
> park it in an unused corner somewhere.  My home-office Linux box is a Dell 
> desktop purchased at a University surplus sale for $20 six or seven years 
> ago. It runs Apache, MySQL, Asterisk, and the Python program that regulates 
> the lights and heat in our Iguana enclosure. The most expensive component 
> (other than the iguana) is a $50 UPS.  Much easier than trying to make your 
> production machine do double duty.
>
> I use a structured settings module to switch back-and-forth between the 
> three levels.  Look at the manage.py and the formhub/settings directory in 
> https://github.com/vernondcole/formhub for an example how to do that.   
> Also look at requirements.pip in that repository for an idea how to load 
> most of the prerequisites automatically. Documentation is in the wiki of 
> https://github.com/modilabs/formhub/wiki/_pages .  (Formhub is a django 
> system used to receive generic survey data taken using android devices 
> offline.)
>
>
>
>
> On Wed, Sep 25, 2013 at 12:49 PM, Bill Freeman 
> > wrote:
>
>> I guess that it's what you're used to.  I'm perfectly happy with emacs 
>> (less so with vi or vim, but still happy enough).  I'm happy with emac's 
>> python mode, css mode, etc.  There's even supposed to be help for Django 
>> templates now.  I'm using the Espresso add-on for JavaScript.  It's not 
>> everything that the IDEs offer, but I don't have to keep re-learning how to 
>> do things.  vim has some pretty good syntax support too.  I certainly 
>> wouldn't pay for something.  And having installed eclipse, it makes emacs 
>> look light weight.
>>
>> Indeed, I, too, tend to develop and test on my laptop, when I'm happy, 
>> check in my chaanges (mercurial), push to the linode, ssh in, update to 
>> head, and touch the wsgi script file (IIRC).  In a pinch I can directly 
>> edit on the linode, using vim through ssh, or emacs tramp mode over ssh, 
>> or, if you want to install your favorite X based editor on the linode, 
>> through a ssh -Y tunnel.
>>
>> Bill, the curmudgeon
>>
>>
>> On Wed, Sep 25, 2013 at 2:06 PM, Jorge Arevalo 
>> 
>> > wrote:
>>
>>> Fine. I don't think my boss is going to pay for PyCharm license, so I'll 
>>> probably go for Eclipse now (I don't really like it too much, but if works, 
>>> it's ok for me)
>>>
>>> About virtualenv, is there any method to provide something like a script 
>>> to create a virtualenv, install the needed software and have a working 
>>> environment in a few commands? Something like "vagrantfile for virtualenv" 
>>> http://docs.vagrantup.com/v2/vagrantfile/index.html
>>>
>>> Again, many thanks for your useful insights
>>>
>>>
>>> On Tuesday, September 17, 2013 4:29:14 PM UTC+2, Vernon D. Cole wrote:
>>>>
>>>> Answering the other half of your question:  The choice of IDE is not 
>>>> nearly as important as its ease of integration with your dvcs.  If you are 
>>>> already familiar with a good one, don't change.
>>>>
>>>> On my present project, my boss and I are both using PyCharm, and my 
>>>> other co-worker is using Eclipse, since he is more comfortable (and 
>>>> therefore, more productive) with it. Both IDE's have good integration with 
>>>> git (my least favourite dvcs, but the boss's choice) and our sharing is 
>>>> done using a group private repository on github.  This is on Ubuntu Linux, 
>>>> it all works well.   In the evening hours, I use PyCharm on Windows 7 to 
>>>> contribute to an open source project hosted on bitbucket using mercurial. 
>>>> Both projects end up being tested on the same Linode.
>>>>
>>>> Yes, use virtualenv.  I also made the mistake of thinking of it as a 
>>>> virtual computer.  It is not.  It is only a method

Re: Recommended dev environment for a Django project deployed to Linode

2013-10-09 Thread Jorge Arevalo
Tested. Works great. Thanks a lot!

On Thursday, September 26, 2013 1:13:58 AM UTC+2, Cal Leeming [Simplicity 
Media Ltd] wrote:
>
> +1 for virtualenvwrapper, don't know how I survived without this!!
>
> Cal
>
>
> On Wed, Sep 25, 2013 at 9:59 PM, Roberto López López 
> 
> > wrote:
>
>>  
>> Check virtualenvwrapper
>>
>> http://virtualenvwrapper.readthedocs.org/en/latest/
>>
>>
>>
>>
>> On 09/25/2013 08:06 PM, Jorge Arevalo wrote:
>>  
>> Fine. I don't think my boss is going to pay for PyCharm license, so I'll 
>> probably go for Eclipse now (I don't really like it too much, but if works, 
>> it's ok for me) 
>>
>>  About virtualenv, is there any method to provide something like a 
>> script to create a virtualenv, install the needed software and have a 
>> working environment in a few commands? Something like "vagrantfile for 
>> virtualenv" http://docs.vagrantup.com/v2/vagrantfile/index.html
>>
>>  Again, many thanks for your useful insights
>>
>> On Tuesday, September 17, 2013 4:29:14 PM UTC+2, Vernon D. Cole wrote: 
>>>
>>>  Answering the other half of your question:  The choice of IDE is not 
>>> nearly as important as its ease of integration with your dvcs.  If you are 
>>> already familiar with a good one, don't change.
>>>
>>> On my present project, my boss and I are both using PyCharm, and my 
>>> other co-worker is using Eclipse, since he is more comfortable (and 
>>> therefore, more productive) with it. Both IDE's have good integration with 
>>> git (my least favourite dvcs, but the boss's choice) and our sharing is 
>>> done using a group private repository on github.  This is on Ubuntu Linux, 
>>> it all works well.   In the evening hours, I use PyCharm on Windows 7 to 
>>> contribute to an open source project hosted on bitbucket using mercurial. 
>>> Both projects end up being tested on the same Linode.
>>>
>>> Yes, use virtualenv.  I also made the mistake of thinking of it as a 
>>> virtual computer.  It is not.  It is only a method of separating Python 
>>> library directories so that you can experiment with different 
>>> configurations easily.  It does not slow anything down, and actually makes 
>>> installation of packages easier.  Use virtualenvwrapper to make switching 
>>> environments easy.  PyCharm also supports virtual environments as well as 
>>> django projects. It is commercial, and suffers from a few Java 
>>> idiosyncrasies, but the boss paid for the license ;-) so I don't mind.
>>>
>>>-- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>> -- 
>>
>> Roberto López López
>> System Developer
>> Parallab, Uni Computing+47 55584091
>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7d351100-bf3a-48a7-8001-822c909b7cde%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Recommended dev environment for a Django project deployed to Linode

2013-10-09 Thread Jorge Arevalo
Yep. VirtualEnvWrapper looks like a winner. And thanks for the suggestion 
about the requirements.txt

On Thursday, September 26, 2013 1:36:21 PM UTC+2, Dump wrote:
>
> I have the same stack, GeoDjango + PostGIS (and all its dependencies like 
> GDAL, Proj, GEOS, etc). My notebook runs Debian (also I have a Mac Book 
> Pro, but I prefer to work on Linux) and I use Digital Ocean to host my 
> projects, also running Debian boxes. Since Debian keeps an older version of 
> PostGIS, I have created my own .deb package of PostGIS 2.1. 
>
> IMHO VirtualEnv and VirtualEnvWrapper is the best way to keep your 
> environment updated with the same versions. I also keep a requirements.txt 
> file into the project (I use Git and Bitbucket) with the output of pip 
> freeze command.  
>
> best regards,
>
>
> On 25 September 2013 15:01, Jorge Arevalo 
> > wrote:
>
>> Hello,
>>
>> First of all, many thanks for your response. Sorry for the delay 
>> answering this. I was in a business trip. 
>>
>> So, you basically have 2 environments: your own machine, and the Linode 
>> box. You make the development and testing in your machine, and Linode is 
>> for production purposes. And you connect both environments via dvcs 
>> push/pull. Right?
>>
>> I like it because it's simple and doesn't seem to be specially prone to 
>> errors. I'd just like to add a third scenario here, to end up with:
>>
>> - Development environment: my own machine (Mac OS X) with all the 
>> software stack installed.
>> - Testing environment: my new addition. I would like to put this 
>> environment outside of my machine
>> - Production environment: the Linode box.
>>
>> I can do the communication via push/pull, if there's no other way to 
>> "deploy" software to production with Python/Django (it's simple, I like 
>> it). And maybe I can have 2 urls (testing and production) in the Linode 
>> box. Testing just accessible to developers and testers, and production open 
>> to normal users. Does it make sense?
>>
>> Thanks again
>>
>> On Tuesday, September 17, 2013 3:50:55 PM UTC+2, Vernon D. Cole wrote:
>>>
>>>
>>> I installed a client for my favourite distributed version control system 
>>> on my Linode instance.  I have a private repository on a public IP.  
>>> (github, bitbucket, or launchpad will work, depending on your dvcs of 
>>> choice -- I have used all three, and other times I have used a private dvcs 
>>> host, including my Linode server itself.) I "cloned" a "checkout" of my 
>>> django system to the Linode. When I am happy from testing a new version of 
>>> my application:  I push it to the repository,  log in to my Linode using 
>>> ssh, and do a pull.  Easy and error free.  (My django environment is almost 
>>> exactly like yours with PostGIS, etc.)
>>> --
>>>
>>> On Monday, September 16, 2013 6:33:49 PM UTC+1, Jorge Arevalo wrote:
>>>>
>>>> Hello,
>>>>
>>>> I'm going to start a project based on (Geo)Django + PostgreSQL/PostGIS 
>>>> + OpenLayers/LeafLet + Bootstrap/Foundation. The project will be deployed 
>>>> to a Linode box. That box will be created with something like this: 
>>>> https://manager.linode.**com/linodes/deploy/**
>>>> linode393074?StackScriptID=**6482<https://manager.linode.com/linodes/deploy/linode393074?StackScriptID=6482>
>>>>
>>>> My work box is a MacBook with Mac OS X 10.6.8. There will be 2 people 
>>>> working on the web app (me and another guy). I have almost total freedom 
>>>> to 
>>>> choose, so I want to choose wisely. The whole point is that these 
>>>> constraints should be satisfied:
>>>>
>>>> - I need a reliable way to upload the application to the 
>>>> test/production environments. At least the production environment will be 
>>>> a 
>>>> Linode box. I just don't want to upload files via FTP, or manually copy 
>>>> them with rsync, or any other practice easily subject to errors. How do 
>>>> the 
>>>> professional django developers set up their environment in order to deploy 
>>>> the app?
>>>>
>>>> - I'm not sure about which IDE/editor choose. I don't want to start an 
>>>> editor war, and I've used several options in the past. My main interest 
>>>> is: 
>>>> I want to focus on develop. If Eclipse/Aptana/Eric/PyCharm/**any IDE 
>>>> ca

Re: Recommended dev environment for a Django project deployed to Linode

2013-10-09 Thread Jorge Arevalo
Interesting! I'm downloading it. Many thanks!

On Thursday, September 26, 2013 7:54:55 PM UTC+2, Ezequiel wrote:
>
> On Wednesday, September 25, 2013 3:06:55 PM UTC-3, Jorge Arevalo wrote:
>
>> Fine. I don't think my boss is going to pay for PyCharm license, so I'll 
>> probably go for Eclipse now (I don't really like it too much, but if works, 
>> it's ok for me)
>>
>
> PyCharm, which is my favorite IDE, has now a Free Community Edition: 
> https://twitter.com/pycharm/status/382549991165673472
>
> Best,
> Ezequiel
> http://flickrock.com/mikelpierre
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3899d79b-7f64-451a-9ef3-f29a4d375956%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Strange behavior with Django 1.5.4 and syncbd/South (missing model fields)

2014-03-27 Thread Jorge Arevalo
Hello,

I have a strange problem trying to transform my model fields to
PostgreSQL tables.

The problem is described here:
http://stackoverflow.com/questions/22545252/django-1-5-4-syncdb-not-creating-some-fields-in-postgresql-9-1-postgis-2-tables

I don't want to duplicate content, so I just send the link. If this
isn't correct, please accept my apologies. I will describe the problem
here too.

Anyway, many thanks in advance.

Best regards,

-- 
Jorge Arevalo
Freelance developer

http://about.me/jorgeas80

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMhtMNO2NXkMRQ6rY7f7E7EB7_3to28TyvGPZq19AZObvkeyOw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django 1.5.4 sql generation just generates one model field (PostgreSQL)

2014-04-03 Thread Jorge Arevalo
Hello,

I have this dummy models.py

from django.db import models

class Foo(models.Model):
bar = models.IntegerField(),
// more integer fields here...
xyz = models.IntegerField()

And I want to know the SQL code generated for PostgreSQL, executing:

python manage.py sqlall myapp

No south involved. Just Django 1.5.4. And this is the SQL output

BEGIN;
CREATE TABLE "myapp_foo" (
"id" serial NOT NULL PRIMARY KEY,
"xyz" integer NOT NULL
)
;

COMMIT;

Just the internal id and the last specified field were generated. The rest 
are ignored. No matter how many fields or what fields. Just takes the last 
one, and generates that output.

Does it make any sense? I'm running Django 1.5.4 under a virtualenv, using 
Python 2.7 in Ubuntu 12.04. This is the complete output of pip freeze in my 
virtualenv

Django==1.5.4
Jinja2==2.7.1
MarkupSafe==0.18
PIL==1.1.7
Pygments==1.6
Sphinx==1.1.3
Unipath==1.0
argparse==1.2.1
distribute==0.6.24
django-admin-tools==0.5.1
django-appconf==0.6
django-bootstrap3==2.0.0
django-colorful==0.1.3
django-compressor==1.3
django-extensions==1.2.5
django-geojson==2.1.1
django-guardian==1.1.1
django-leaflet==0.8.2
django-model-utils==1.5.0
django-secure==1.0
django-sorting==0.1
django-waffle==0.9.2
docutils==0.11
feedparser==5.1.3
psycopg2==2.5.1
requests==2.0.1
six==1.4.1
wsgiref==0.1.2

This is just... weird. Any clues?

Many thanks in advance

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3ab753c1-96eb-4386-b031-dbc61aeeec9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 1.5.4 sql generation just generates one model field (PostgreSQL)

2014-04-03 Thread Jorge Arevalo
Absolutely! It's working now. What a stupid mistake... Many thanks!

On Friday, April 4, 2014 12:34:38 AM UTC+2, François Schiettecatte wrote:
>
> You have a comma at the end of this: 
>
> bar = models.IntegerField(), 
>
> Could that be the issue? 
>
> François 
>
> On Apr 3, 2014, at 6:24 PM, Jorge Arevalo 
> > 
> wrote: 
>
> > Hello, 
> > 
> > I have this dummy models.py 
> > 
> > from django.db import models 
> > 
> > class Foo(models.Model): 
> > bar = models.IntegerField(), 
> > // more integer fields here... 
> > xyz = models.IntegerField() 
> > 
> > And I want to know the SQL code generated for PostgreSQL, executing: 
> > 
> > python manage.py sqlall myapp 
> > 
> > No south involved. Just Django 1.5.4. And this is the SQL output 
> > 
> > BEGIN; 
> > CREATE TABLE "myapp_foo" ( 
> > "id" serial NOT NULL PRIMARY KEY, 
> > "xyz" integer NOT NULL 
> > ) 
> > ; 
> > 
> > COMMIT; 
> > 
> > Just the internal id and the last specified field were generated. The 
> rest are ignored. No matter how many fields or what fields. Just takes the 
> last one, and generates that output. 
> > 
> > Does it make any sense? I'm running Django 1.5.4 under a virtualenv, 
> using Python 2.7 in Ubuntu 12.04. This is the complete output of pip freeze 
> in my virtualenv 
> > 
> > Django==1.5.4 
> > Jinja2==2.7.1 
> > MarkupSafe==0.18 
> > PIL==1.1.7 
> > Pygments==1.6 
> > Sphinx==1.1.3 
> > Unipath==1.0 
> > argparse==1.2.1 
> > distribute==0.6.24 
> > django-admin-tools==0.5.1 
> > django-appconf==0.6 
> > django-bootstrap3==2.0.0 
> > django-colorful==0.1.3 
> > django-compressor==1.3 
> > django-extensions==1.2.5 
> > django-geojson==2.1.1 
> > django-guardian==1.1.1 
> > django-leaflet==0.8.2 
> > django-model-utils==1.5.0 
> > django-secure==1.0 
> > django-sorting==0.1 
> > django-waffle==0.9.2 
> > docutils==0.11 
> > feedparser==5.1.3 
> > psycopg2==2.5.1 
> > requests==2.0.1 
> > six==1.4.1 
> > wsgiref==0.1.2 
> > 
> > This is just... weird. Any clues? 
> > 
> > Many thanks in advance 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "Django users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to django-users...@googlegroups.com . 
> > To post to this group, send email to 
> > django...@googlegroups.com. 
>
> > Visit this group at http://groups.google.com/group/django-users. 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/3ab753c1-96eb-4386-b031-dbc61aeeec9d%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1fc68467-c63b-4cdb-a435-45a8c45510ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Error with GeoDjango serializer and ForeignKey field

2014-04-06 Thread Jorge Arevalo
(Sorry for the cross posting. I'm not sure about the best place to put my 
question. So, I put it in StackOverflow too. And I know that a post that 
contains just a link to another page can be considered spam. So, I C&P the 
content here)

I have a problem with *Django 1.5.4*. I put the question in StackOverflow 
instead ofhttp://gis.stackexchange.com/ because I'm almost 100% sure is not 
a GIS related problem.

Here is my set up:

My *models.py*

from django.contrib.auth.models import Userfrom django.contrib.gis.db import 
models as gismodels
# This models a region of interest, using a polygonclass ROI(gismodels.Model):
label = models.CharField(max_length=256, default='ROI')
area = models.FloatField(default=0.0)
geom = gismodels.PolygonField(srid=4326)
when = models.DateTimeField(default=datetime.now())
user = models.ForeignKey(User, null=True)

objects = gismodels.GeoManager()

def __unicode__(self):
return unicode(self.label)

class Meta:
ordering = ['when']

class Indicator(models.Model):
name = models.TextField()
color = models.TextField()
measurement_units = models.CharField(max_length=100)
algorithm = models.CharField(max_length=256)
data_origin = models.TextField()

class Series(models.Model):
roi = models.ForeignKey(ROI)
indicator = models.ForeignKey(Indicator)

As you can see, *Series model contains a reference to ROI model*

My *settings.py*

SERIALIZATION_MODULES = {
'geojson': 'djgeojson.serializers'}

I'm using django-geojson 
 to *serialize my ROI objects into GeoJSON*. I want to use this serializer 
to send a GeoJSON to my clients. So, my views.py looks like this

My *views.py*

@login_requireddef get_rois(request):
rois_query = ROI.objects.filter(user=request.user)

polygons = json.loads(serializers.serialize('geojson', rois_query))

return HttpResponse(json.dumps(polygons), mimetype='application/json')

The problem: *I'm getting this error in serialize call*

AttributeError: 'ROI' object has no attribute 'roi'

The *relevant part of the error stack* is this

File 
"/home/vagrant/.virtualenvs/myapp/local/lib/python2.7/site-packages/django/core/serializers/__init__.py",
 line 122, in serialize
s.serialize(queryset, **options)
  File 
"/home/vagrant/.virtualenvs/myapp/local/lib/python2.7/site-packages/djgeojson/serializers.py",
 line 349, in serialize
self.serialize_queryset(queryset)
  File 
"/home/vagrant/.virtualenvs/myapp/local/lib/python2.7/site-packages/djgeojson/serializers.py",
 line 321, in serialize_queryset
self.handle_reverse_field(obj, field, field_name)
  File 
"/home/vagrant/.virtualenvs/myapp/local/lib/python2.7/site-packages/djgeojson/serializers.py",
 line 243, in handle_reverse_field
values = [reverse_value(related) for related in getattr(obj, 
field_name).iterator()]

Looking at the stack, looks like there's a problem resolving the *reverse 
reference* of ROI to Series. Series has a roi field pointing to ROI, and I 
think the serializer thinks the roi field belongs to ROI class (incorrect) 
instead of to Series (correct). The expression *infinite loop* comes to my 
mind.

Besides, *if I delete the roi field from Series model class, it works*

I'm not sure about if it's a bug of django-geojson plugin (using the last 
version) or something wrong with my code (most likely). I've tried with the 
default json serializer, and still getting the same error. And also tried 
to inherit all model classes from gismodels instead of models. No effect.

Any clues?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d0a7a029-c1c6-4b1d-8901-90efde84e72e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error with GeoDjango serializer and ForeignKey field

2014-04-08 Thread Jorge Arevalo
On Sunday, April 6, 2014 11:13:30 PM UTC+2, Jorge Arevalo wrote:
>
> (Sorry for the cross posting. I'm not sure about the best place to put my 
> question. So, I put it in StackOverflow too. And I know that a post that 
> contains just a link to another page can be considered spam. So, I C&P the 
> content here)
>
> I have a problem with *Django 1.5.4*. I put the question in StackOverflow 
> instead ofhttp://gis.stackexchange.com/ because I'm almost 100% sure is 
> not a GIS related problem.
>
> Here is my set up:
>
> My *models.py*
>
> from django.contrib.auth.models import Userfrom django.contrib.gis.db import 
> models as gismodels
> # This models a region of interest, using a polygonclass ROI(gismodels.Model):
> label = models.CharField(max_length=256, default='ROI')
> area = models.FloatField(default=0.0)
> geom = gismodels.PolygonField(srid=4326)
> when = models.DateTimeField(default=datetime.now())
> user = models.ForeignKey(User, null=True)
>
> objects = gismodels.GeoManager()
>
> def __unicode__(self):
> return unicode(self.label)
>
> class Meta:
> ordering = ['when']
>
> class Indicator(models.Model):
> name = models.TextField()
> color = models.TextField()
> measurement_units = models.CharField(max_length=100)
> algorithm = models.CharField(max_length=256)
> data_origin = models.TextField()
>
> class Series(models.Model):
> roi = models.ForeignKey(ROI)
> indicator = models.ForeignKey(Indicator)
>
> As you can see, *Series model contains a reference to ROI model*
>
> My *settings.py*
>
> SERIALIZATION_MODULES = {
> 'geojson': 'djgeojson.serializers'}
>
> I'm using django-geojson <https://github.com/makinacorpus/django-geojson>
>  to *serialize my ROI objects into GeoJSON*. I want to use this 
> serializer to send a GeoJSON to my clients. So, my views.py looks like this
>
> My *views.py*
>
> @login_requireddef get_rois(request):
> rois_query = ROI.objects.filter(user=request.user)
>
> polygons = json.loads(serializers.serialize('geojson', rois_query))
>
> return HttpResponse(json.dumps(polygons), mimetype='application/json')
>
> The problem: *I'm getting this error in serialize call*
>
> AttributeError: 'ROI' object has no attribute 'roi'
>
> The *relevant part of the error stack* is this
>
> File 
> "/home/vagrant/.virtualenvs/myapp/local/lib/python2.7/site-packages/django/core/serializers/__init__.py",
>  line 122, in serialize
> s.serialize(queryset, **options)
>   File 
> "/home/vagrant/.virtualenvs/myapp/local/lib/python2.7/site-packages/djgeojson/serializers.py",
>  line 349, in serialize
> self.serialize_queryset(queryset)
>   File 
> "/home/vagrant/.virtualenvs/myapp/local/lib/python2.7/site-packages/djgeojson/serializers.py",
>  line 321, in serialize_queryset
> self.handle_reverse_field(obj, field, field_name)
>   File 
> "/home/vagrant/.virtualenvs/myapp/local/lib/python2.7/site-packages/djgeojson/serializers.py",
>  line 243, in handle_reverse_field
> values = [reverse_value(related) for related in getattr(obj, 
> field_name).iterator()]
>
> Looking at the stack, looks like there's a problem resolving the *reverse 
> reference* of ROI to Series. Series has a roi field pointing to ROI, and 
> I think the serializer thinks the roi field belongs to ROI class 
> (incorrect) instead of to Series (correct). The expression *infinite loop* 
> comes 
> to my mind.
>
> Besides, *if I delete the roi field from Series model class, it works*
>
> I'm not sure about if it's a bug of django-geojson plugin (using the last 
> version) or something wrong with my code (most likely). I've tried with the 
> default json serializer, and still getting the same error. And also tried 
> to inherit all model classes from gismodels instead of models. No effect.
>
> Any clues?
>

Ok, I managed to solve it. Looks like there is a bug in the django-geojson 
plugin <https://github.com/makinacorpus/django-geojson/issues/23>. It can't 
handle the backward relations. So, I just told Django to *avoid the 
backward relation creation* between ROI and 
Series<https://docs.djangoproject.com/en/1.5/ref/models/fields/#django.db.models.ForeignKey.related_name>

class Series(gismodels.Model):
# Prevents django to create a backwards relation between ROI and Series
roi = models.ForeignKey(ROI, related_name='+')
indicator = models.ForeignKey(Indicator)


 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/482c97aa-3827-4efa-80b9-9fa1359821d0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.