Re: Introducing myself and my first question

63 views
Skip to first unread message

Edward Chen

unread,
Jul 19, 2014, 9:48:37 PM7/19/14
to django...@googlegroups.com
Hi - I am kind of new myself, and I don't have all the answers to your questions, but here are some thoughts, and I could be wrong.

1.  You can set up your virtualenv anywhere you like.  The one I'm using right now is in ~/Envs/venv_for_my_project/  All you're doing with it is source/bin/activate.  As Two Scoops of Django recommends, just store the output of pip freeze in version control.

2. I am not using Eclipse, so I can't help there.  I am using PyCharm which has a nice integration with virtualenv and Django.  It's easy to start the server in debugging mode and set break points.  With Pycharm, I set it up once, pointing it to the location of my virtualenv, and haven't touched it since, even though I've added packages to my virtualenv.  The downside of PyCharm is that it costs money.

3. I don't think you can screw things up too much.  You may want to first do as much as possible via the command line in a terminal window and see if that works (for example, start and stop the server), then try the same thing through Eclipse's interface.  The worst that can happen is that your test server doesn't work.

 


On Sat, Jul 19, 2014 at 3:09 PM, Martin Torre Castro <mad...@gmail.com> wrote:
Hello,

my name is Martin and I'm a computer engineer from Spain. I'm going to start a new project with a colleague and I decided to use Django because we searched for free opensource tools and I'm in love with Python.

We have made a couple of tutorials (the official one and "Tango with django"). I've also bought the book "Two scoops of Django" for the 1.6 Django edition. We're starting the project soon as well as we finish the design, but I'm concerned about setting up the new environment. We're thinking of using:

  • postgresql
  • Python/Django [ of course ;-) ]
  • Eclipse/Pydev
  • Git
  • jQuery
I've been reading the Greenfield/Roy book and some web sites and I want to set up the environment with good practices by using virtualenvwrapper, virtualenv, pip, the requirements.txt files and so on.
I have made some mix for all this, but I would be grateful if someone could confirm us if we are on the right way, give us some advice or maybe tell us where on the internet we can find a good way of doing all this.

My preview for the whole setting up is next:

  1. We should start the installations by installing "sudo apt-get install virtualenvwrapper" . If I understand correctly, this installs virtualenv as well as an embedded pip.
  2. The virtualenv must be created ("virtualenv env") in the parent directory of the Eclipse workspace, I suppose. This is one point of confusion to me. I don't know either if I have to activate this every time I come back for developing resuming the work from days before. I completely understand that later from Eclipse I will give the python path inside the virtualenv, but don't know if must activate the virtualenv every time.
  3. Next step would be to install all the things we need (django, pillow, psycopg2) using a requirements.txt file. "pip install -r requirements.txt"
  4. We should create the new django project with a python django-admin.py startproject <project_name>
  5. Now I don't know if we should link the project to an already installed version of Eclipse or run the "git init" first. I understand that Eclipse and Git don't need to be installed inside the virtualenv. In fact, I've been reading and it seems that Eclipse can work OK just by being given the path inside the virtualenv where the python executable is located. I've also read that some people used to make different workspaces, but configuring the paths should be enough http://stackoverflow.com/questions/1145374/virtualenv-with-eclipse-galileo
From here I would just upload to github or bitbucket, maybe doing the whole thing from Eclipse would be easier. But the integration with Eclipse when we made tangowithdjango tutorial was the difficult point, because there is no option for importing a django project from Eclipse (Kepler version last time). We found easier to create the project from Eclipse, but we were not using a virtualenv for the tutorial.

I haven't used virtualenv before, so it's our second main obstacle, but I expect it will be easy when we get used to it (^_^) .

Please could someone help with some piece of advice, pros and cons of every option. Just don't want to do something now I will regret in future.

Thank you veeery much in advance.

PS: Some links visited:

--
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/f7332cab-26a7-45fe-a9f5-26831da6bdf4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Cal Leeming [Simplicity Media Ltd]

unread,
Jul 20, 2014, 8:40:34 AM7/20/14
to django...@googlegroups.com


On Saturday, July 19, 2014, Martin Torre Castro <mad...@gmail.com> wrote:
Hello,

my name is Martin and I'm a computer engineer from Spain. I'm going to start a new project with a colleague and I decided to use Django because we searched for free opensource tools and I'm in love with Python.

Hello and welcome :)



We have made a couple of tutorials (the official one and "Tango with django"). I've also bought the book "Two scoops of Django" for the 1.6 Django edition. We're starting the project soon as well as we finish the design, but I'm concerned about setting up the new environment. We're thinking of using:

  • postgresql
  • Python/Django [ of course ;-) ]
  • Eclipse/Pydev
Consider using Sublime Text 2 instead. 
  • Git
  • jQuery
Remember that JS is a whole different beast.  Have a read of this (written by a well respected engineer), it's well worth the effort, you won't get it right the first time, but none of us ever do!

 
    I've been reading the Greenfield/Roy book and some web sites and I want to set up the environment with good practices by using virtualenvwrapper, virtualenv, pip, the requirements.txt files and so on.
    I have made some mix for all this, but I would be grateful if someone could confirm us if we are on the right way, give us some advice or maybe tell us where on the internet we can find a good way of doing all this.

    My preview for the whole setting up is next:

    1. We should start the installations by installing "sudo apt-get install virtualenvwrapper" . If I understand correctly, this installs virtualenv as well as an embedded pip.

    You can also use 'pip install virtualenvwrapper' to get a more up to date version, and just use 'apt-get install python-setup tools' to get pip.
    1. The virtualenv must be created ("virtualenv env") in the parent directory of the Eclipse workspace, I suppose. This is one point of confusion to me. I don't know either if I have to activate this every time I come back for developing resuming the work from days before. I completely understand that later from Eclipse I will give the python path inside the virtualenv, but don't know if must activate the virtualenv every time
    1. Next step would be to install all the things we need (django, pillow, psycopg2) using a requirements.txt file. "pip install -r requirements.txt"
    1. We should create the new django project with a python django-admin.py startproject <project_name>
    2. Now I don't know if we should link the project to an already installed version of Eclipse or run the "git init" first. I understand that Eclipse and Git don't need to be installed inside the virtualenv. In fact, I've been reading and it seems that Eclipse can work OK just by being given the path inside the virtualenv where the python executable is located. I've also read that some people used to make different workspaces, but configuring the paths should be enough http://stackoverflow.com/questions/1145374/virtualenv-with-eclipse-galileo
      Can't advise much on Eclipse, sorry. 
        From here I would just upload to github or bitbucket, maybe doing the whole thing from Eclipse would be easier. But the integration with Eclipse when we made tangowithdjango tutorial was the difficult point, because there is no option for importing a django project from Eclipse (Kepler version last time). We found easier to create the project from Eclipse, but we were not using a virtualenv for the tutorial.

        I haven't used virtualenv before, so it's our second main obstacle, but I expect it will be easy when we get used to it (^_^) .

        Please could someone help with some piece of advice, pros and cons of every option. Just don't want to do something now I will regret in future.

        It really depends on your own workflow and what works best for you. If your dev environment is on a windows or osx box but you're pushing to a Linux prod env, them you may wish to reconsider remote python execution to a local dev Linux box using something like active state python (otherwise known as remote debugging). 

        For a while I used a samba/nfs mount to a Linux VMware install locally then edited files over the mount and used a terminal inside VMware to execute the code, this worked but it's a poor workflow (trying to run git over samba gets real slow, and files can become damaged in transport)

        Truth be told, I can't give a 100% recommendation because even after 8 years I'm still not happy with my own workflow. The best advice I can give would be keep experimenting and find what works best for you. Do lots of reading, keep an open mind etc. 

        Much of this will depend on the IDE you use, as some won't have support for things like remote debugging, but this has been covered in 83748474 existing threads already, otherwise known as IDE wars!

        Hope this helps dude

        Ariel E. Isidro

        unread,
        Jul 20, 2014, 9:42:01 AM7/20/14
        to django...@googlegroups.com
        Hi Martin,

        I myself am new in Django, here's one tutorial I believe is worth visiting when setting up your environment:


        Good luck


        On Sun, Jul 20, 2014 at 6:09 AM, Martin Torre Castro <mad...@gmail.com> wrote:
        Hello,

        my name is Martin and I'm a computer engineer from Spain. I'm going to start a new project with a colleague and I decided to use Django because we searched for free opensource tools and I'm in love with Python.

        We have made a couple of tutorials (the official one and "Tango with django"). I've also bought the book "Two scoops of Django" for the 1.6 Django edition. We're starting the project soon as well as we finish the design, but I'm concerned about setting up the new environment. We're thinking of using:

        • postgresql
        • Python/Django [ of course ;-) ]
        • Eclipse/Pydev
        • Git
        • jQuery
        I've been reading the Greenfield/Roy book and some web sites and I want to set up the environment with good practices by using virtualenvwrapper, virtualenv, pip, the requirements.txt files and so on.
        I have made some mix for all this, but I would be grateful if someone could confirm us if we are on the right way, give us some advice or maybe tell us where on the internet we can find a good way of doing all this.

        My preview for the whole setting up is next:

        1. We should start the installations by installing "sudo apt-get install virtualenvwrapper" . If I understand correctly, this installs virtualenv as well as an embedded pip.
        1. The virtualenv must be created ("virtualenv env") in the parent directory of the Eclipse workspace, I suppose. This is one point of confusion to me. I don't know either if I have to activate this every time I come back for developing resuming the work from days before. I completely understand that later from Eclipse I will give the python path inside the virtualenv, but don't know if must activate the virtualenv every time.
        1. Next step would be to install all the things we need (django, pillow, psycopg2) using a requirements.txt file. "pip install -r requirements.txt"
        2. We should create the new django project with a python django-admin.py startproject <project_name>
        3. Now I don't know if we should link the project to an already installed version of Eclipse or run the "git init" first. I understand that Eclipse and Git don't need to be installed inside the virtualenv. In fact, I've been reading and it seems that Eclipse can work OK just by being given the path inside the virtualenv where the python executable is located. I've also read that some people used to make different workspaces, but configuring the paths should be enough http://stackoverflow.com/questions/1145374/virtualenv-with-eclipse-galileo
        From here I would just upload to github or bitbucket, maybe doing the whole thing from Eclipse would be easier. But the integration with Eclipse when we made tangowithdjango tutorial was the difficult point, because there is no option for importing a django project from Eclipse (Kepler version last time). We found easier to create the project from Eclipse, but we were not using a virtualenv for the tutorial.

        I haven't used virtualenv before, so it's our second main obstacle, but I expect it will be easy when we get used to it (^_^) .

        Please could someone help with some piece of advice, pros and cons of every option. Just don't want to do something now I will regret in future.

        --
        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/f7332cab-26a7-45fe-a9f5-26831da6bdf4%40googlegroups.com.
        For more options, visit https://groups.google.com/d/optout.



        --

        DISCLAIMER: This message is for the designated recipient only and may contain confidential and/or privileged information. If you have received it in error, please delete it and advise the sender immediately. You should not copy or use it for any other purpose, nor disclose its contents to any other person.

        Martin Torre Castro

        unread,
        Jul 21, 2014, 5:33:40 PM7/21/14
        to django...@googlegroups.com
        Thanks to you both.

        I know the URL, Ariel, and I will look at it when beginning the implementation.

        Thanks Cal for the comments. I've been heard very well about Sublime Text and I'm planning ot use it, not as a IDE, but for other issues as a complementary editor.

        Martin Torre Castro

        unread,
        Jul 21, 2014, 5:37:22 PM7/21/14
        to django...@googlegroups.com
        Thanks to you also, Chen, I read you the last, but not least. I looked at PyCharm's price but it seemed expensive for buying for being used by two people at developing.

        I take care of the 'pip freeze' tip. :-)


        On Sunday, 20 July 2014 03:48:37 UTC+2, Edward Chen wrote:

        Mario Gudelj

        unread,
        Jul 21, 2014, 8:30:57 PM7/21/14
        to django...@googlegroups.com
        Hey Martin,

        I can guarantee you that PyCharm is totally worth buying. It will speed up your development drastically and it works really well with Django. Autocompletion both in Python and template code, syntax highlighting in both, easy Option+Enter imports, navigation through code, refactoring. You name it has it. Just the merge tool is worth those $99. 

        Cheers,

        M


        Reply all
        Reply to author
        Forward
        0 new messages