I need help with Python Tools for Visual Studio 2010 and Django

996 views
Skip to first unread message

JJ Zolper

unread,
Jan 22, 2012, 11:22:00 PM1/22/12
to django...@googlegroups.com
Hello everyone,

I was able to install Django to my machine and before I was using the command prompt. Django's path is in my Windows 7 64 bit Enterprise Environment variable. Python worked fine as well too. I also installed IPython because I heard it was useful but I haven't tried that yet. Everything has been good so far. I would like some input on what I am currently trying now.

I have gone ahead and installed IronPython. I already had Visual Studio 2010 on my computer so I was using that. I also installed Python Tools for Visual Studio. As I mentioned before I already have Python 2.7.2 installed.


It shows the options pane for Python Tools for Visual Studio. I was able to see that PT4VS (Python Tools for Visual Studio) was correctly including the location of the Python install at C:/Python27/python.py. Everything looked good there as it seems that Python was incorporated into PT4VS. I was trying to continue through the tutorial but I was having problems. I tried this command: python manage.py runserver but I only recieved a traceback error.

Additionally in PT4VS there is a field for a startup script. I wrote one and here it is:

import os
import IPython
import django
os.chdir('c:\\MTDevelopment\\Django\\newartists')

This so that I could change my directory to where my startproject was set with all the django web framework files. Also to import IPython and django as you see here. That seemed to work as I anticipated.

What I am asking you is why am I not able to get the full power of Django? In my command prompt I wasn't inside the python interpreter and ran the Django commands and everything worked fine. However, I was under the impression that with a Python interpreter in VS that I could have everything come in in a start up script and just go on my way coding with Django having set the directory to the location of my startproject?

When I type: django and IPython into my PT4VS now I see:

>>> IPython
<module 'IPython' from 'C:\Python27\lib\site-packages\ipython-0.11-py2.7.egg\IPython\__init__.pyc'>
>>> django
<module 'django' from 'C:\Python27\lib\site-packages\django-1.3.1-py2.7.egg\django\__init__.pyc'>

so it is imported it correctly I think but I'm not able to use it. I've been working hard on teaching myself how to get all this set up and any help from you all would make my time working on this a lot easier!

Thanks so much,

JJ Zolper

Sam Lai

unread,
Jan 23, 2012, 7:17:59 AM1/23/12
to django...@googlegroups.com
On 23 January 2012 15:22, JJ Zolper <cod...@madtrak.com> wrote:
> Hello everyone,
>
> I was able to install Django to my machine and before I was using the
> command prompt. Django's path is in my Windows 7 64 bit Enterprise
> Environment variable. Python worked fine as well too. I also installed
> IPython because I heard it was useful but I haven't tried that yet.
> Everything has been good so far. I would like some input on what I am
> currently trying now.
>
> I have gone ahead and installed IronPython. I already had Visual Studio 2010
> on my computer so I was using that. I also installed Python Tools for Visual
> Studio. As I mentioned before I already have Python 2.7.2 installed.
>
> I was able to see the image/window in step 3
> here: http://pytools.codeplex.com/wikipage?title=Installation%20-%20details&referringTitle=Home
>
> It shows the options pane for Python Tools for Visual Studio. I was able to
> see that PT4VS (Python Tools for Visual Studio) was correctly including the
> location of the Python install at C:/Python27/python.py. Everything looked
> good there as it seems that Python was incorporated into PT4VS. I was trying
> to continue through the tutorial but I was having problems. I tried this
> command: python manage.py runserver but I only recieved a traceback error.

You've left out the most important bit - the actual traceback error. What is it?

If it can't find something, then it could be a PYTHONPATH issue.
Google tells me PT4VS may not support the usual way modules are
discovered (http://pytools.codeplex.com/discussions/254602), although
that should affect IronPython only, and not CPython (possibly
intellisense as well).

Inside PT4VS, in the interactive window, type in the following and
paste the result -

import sys
print sys.path

> Additionally in PT4VS there is a field for a startup script. I wrote one and
> here it is:
>
> import os
> import IPython
> import django
> os.chdir('c:\\MTDevelopment\\Django\\newartists')
>
> This so that I could change my directory to where my startproject was set
> with all the django web framework files. Also to import IPython and django
> as you see here. That seemed to work as I anticipated.

This smells like a hack. Your default working directory should already
be the directory your app is in. If it isn't, you need to check your
project settings (you are using a Python VS project right?).

> What I am asking you is why am I not able to get the full power of Django?
> In my command prompt I wasn't inside the python interpreter and ran the
> Django commands and everything worked fine. However, I was under the
> impression that with a Python interpreter in VS that I could have everything
> come in in a start up script and just go on my way coding with Django having
> set the directory to the location of my startproject?
>
> When I type: django and IPython into my PT4VS now I see:
>
>>>> IPython
> <module 'IPython' from
> 'C:\Python27\lib\site-packages\ipython-0.11-py2.7.egg\IPython\__init__.pyc'>
>>>> django
> <module 'django' from
> 'C:\Python27\lib\site-packages\django-1.3.1-py2.7.egg\django\__init__.pyc'>
>
> so it is imported it correctly I think but I'm not able to use it. I've been
> working hard on teaching myself how to get all this set up and any help from
> you all would make my time working on this a lot easier!
>
> Thanks so much,
>
> JJ Zolper
>

> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/P5AJ334Yr8YJ.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

JJ Zolper

unread,
Jan 23, 2012, 1:11:48 PM1/23/12
to django...@googlegroups.com
Here is the error:

>>> python manage.py runserver
  File "<stdin>", line 1
    python manage.py runserver
                ^
SyntaxError: invalid syntax
>>> 


You've left out the most important bit - the actual traceback error. What is it?

If it can't find something, then it could be a PYTHONPATH issue.
Google tells me PT4VS may not support the usual way modules are
discovered (http://pytools.codeplex.com/discussions/254602), although
that should affect IronPython only, and not CPython (possibly
intellisense as well).

Inside PT4VS, in the interactive window, type in the following and
paste the result -

import sys
print sys.path



I'm not too familiar with these things yet. Are you saying CPython might be better if I want to work in Visual Studio with the setup I am trying?



Here is the response to


import sys
print sys.path 

it is:

>>> import sys
... 
>>> print sys.path
['c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE', 'C:\\Python27\\lib\\site-packages\\setuptools-0.6c11-py2.7.egg', 'C:\\Python27\\lib\\site-packages\\ipython-0.11-py2.7.egg', 'C:\\Python27\\lib\\site-packages\\django-1.3.1-py2.7.egg', 'C:\\Windows\\system32\\python27.zip', 'C:\\Python27\\DLLs', 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27', 'C:\\Python27\\lib\\site-packages', 'c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\Extensions\\Microsoft\\Python Tools for Visual Studio\\1.1', 'C:\\Python27\\lib\\site-packages\\ipython-0.11-py2.7.egg\\IPython\\extensions']


This smells like a hack. Your default working directory should already
be the directory your app is in. If it isn't, you need to check your
project settings (you are using a Python VS project right?). 


Well I have no idea how I am hacking here...
But I didin't start a new project just through visual studio. I had already within the cmd prompt run the "startproject" command naming "mysite" to be "newartists." That was done at an earlier time so I just wanted to move to that directory within the python interpreter....

Well I didn't use a Python VS project because the files were already created but if I start a new Python file I'll most likely just pick my options within Visual Studio. That would make the most sense.

Thanks,

JJ Zolper

Andre Terra

unread,
Jan 23, 2012, 1:18:40 PM1/23/12
to django...@googlegroups.com
the >>> indicates you are IN a python shell, which is different from your OS prompt. Try exiting the shell first (with exit()) and then run "python manage.py runserver" from a command prompt or terminal window.


Cheers,
AT

JJ Zolper

unread,
Jan 23, 2012, 1:20:56 PM1/23/12
to django...@googlegroups.com
For sanity purposes I removed my "hack" or start up script that had "import django" and "import IPython"

Here it is:

>>> import sys
>>> sys.path
['c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE', 'C:\\Python27\\lib\\site-packages\\setuptools-0.6c11-py2.7.egg', 'C:\\Python27\\lib\\site-packages\\ipython-0.11-py2.7.egg', 'C:\\Python27\\lib\\site-packages\\django-1.3.1-py2.7.egg', 'C:\\Windows\\system32\\python27.zip', 'C:\\Python27\\DLLs', 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27', 'C:\\Python27\\lib\\site-packages', 'c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\Extensions\\Microsoft\\Python Tools for Visual Studio\\1.1']
>>> 

It looks like in both cases Django is included but I'm still not convinced that everything is right because in the windows command prompt I am able to start my server like a charm but in Visual Studio I don't think I can really do anything.

Are you not able to run Django commands from the Python prompt? That probably sounds stupid but to be honest I think the only time I can run Django commands is when I'm outside the Python interpreter in just the command prompt of Windows.

JJ Zolper

JJ Zolper

unread,
Jan 23, 2012, 3:58:18 PM1/23/12
to django...@googlegroups.com
Yes I knew I was in the Python shell I just never saw anything that described you couldn't make Django commands within the Python interpreter. I mean it is based on Python isn't it? That's where I thought logically you could make Django calls from in Python?

SO....

Is your best advice to have a OS prompt open in tandem with my Visual Studio Python Interpreter open? That being said that would be the best solution given my situation I suppose. However within the interpreter Python Tools for VS there may be limitations. That is what I've heard at least. I'm just referring to the interactive intellisense I think?.. 

Thank you for the tip on starting my server Andrew I will surely exit the Python interpreter and use a prompt!

JJ Zolper

Sam Lai

unread,
Jan 24, 2012, 5:41:02 AM1/24/12
to django...@googlegroups.com
On 24 January 2012 07:58, JJ Zolper <cod...@madtrak.com> wrote:
> Yes I knew I was in the Python shell I just never saw anything that
> described you couldn't make Django commands within the Python interpreter. I
> mean it is based on Python isn't it? That's where I thought logically you
> could make Django calls from in Python?

These 'Django commands' you're referring to, i.e. those involving
manage.py, are commands that are meant to be run from the command
prompt. You are executing a python script file, but they are not
Python commands.

> SO....
>
> Is your best advice to have a OS prompt open in tandem with my Visual Studio
> Python Interpreter open? That being said that would be the best solution
> given my situation I suppose. However within the interpreter Python Tools
> for VS there may be limitations. That is what I've heard at least. I'm just
> referring to the interactive intellisense I think?..

VS doesn't work well outside of a VS project. Without one, it won't
know what your Python search path is, where all your code is located,
so you'll have minimal Intellisense (it'll know about the built-in
Python libraries, but not much else). You'll may also have issues
executing code because it doesn't know how to find all your code and
dependencies without the Python search path, and without that you'll
probably also lose the great debugging abilities of VS. All you're
really left with is a glorified syntax-checking text editor.

If you really want to do that, then the best solution is to open a
separate Command Prompt to run 'manage.py runserver' from. I mentioned
CPython before; that's just a name for the Python you download from
python.org. I used it to differentiate that from IronPython, which is
a .NET implementation of Python. I believe there are outstanding
issues with Django and IronPython, so it probably isn't worth trying
that.

You also seem to be confused with a Django project vs. a VS project. A
Django project simply defines the directory structure, and gives you a
few files to start with, including manage.py. This structure is how
Django is able to find the various files it needs.

A VS project is necessary to let VS know where all your files are,
where it should look for your Python packages etc. It is for VS to
know how to execute, debug and manage your code. Django does not know
anything about the VS project, and it shouldn't because it has nothing
to do with Django once Django is running.

Once you've created a VS Python Application project (ideally in the
same directory as your Django project), here's how to make it run the
built-in Django test server -

1. Right-click on your VS project in the Solution Explorer, and click
Properties.
2. Click on the Debug tab.
3. In 'Script Arguments', type 'runserver'.
4. Save the Project properties.
5. Add the files in your Django project to your project by
right-clicking on your VS project, Add, Existing item.
6. Right-click on manage.py and select 'Set as Startup File'.

To test, just go Debug -> Start Debugging or press F5.

I've had a quick play around; looks like the 'Execute project in
Python Interactive' option doesn't pass script arguments along, so
that won't work for running the test server, but then again, there's
nothing to interact with in the test server anyway. You can use that
option to test out models and the Django API though.

> Thank you for the tip on starting my server Andrew I will surely exit the
> Python interpreter and use a prompt!
>
> JJ Zolper
>

> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/django-users/-/y2Pz2JDeEo0J.

JJ Zolper

unread,
Jan 24, 2012, 3:13:58 PM1/24/12
to django...@googlegroups.com
Sam Lai,

Thank you so much for taking the time to explain all that to me.

Being new to all this I feel that I might need to just start out with a command prompt working with Django and something else... another command prompt or VS to create my python files.

However, having read what you posted, would you be able to give me some other options I can use for working with Python?

I know that's a general question and I'm sorry it's asking a lot but to me I see it like this. There is CPython and IronPython. I was under the impression they are both are interpreters. Atleast that's what I read right now. So I suppose I could move over to CPython and use that as my development realm for my Python?

I'm also tempted to trying to instal UNIX/LINUX because I keep seeing lots of videos on youtube where people seem to flawlessly be commanding their Python.

A lot to respond too I know, any help would be fantastic!

JJ Zolper

JJ Zolper

unread,
Jan 24, 2012, 10:19:52 PM1/24/12
to django...@googlegroups.com
Sam Lai,

I am interested in PostgreSQL. I've heard it is good to use along with Django. More specifically to work with GIS. I'm very interested in the Geographical uses of Django. In particular GeoDjango. As I continued to learn more about this web framework I hope to be able to work with databases such as PostgreSQL and work with Geographical information/code. Maybe this helps give a more representation of what I want to do with Django. I see on GeoDjango's documentation that the Linux mascot Tux is there. I keep thinking I am wasting my own time with Windows here and that my real destiny here is the real programmers language. To put it in short terms. Do you think that is true?

I want to unleash the power here of the interactiveness as well as be able to have my Python/Django to work alongside with GeoDjango and PostgreSQL.

Do you know anything about this?

Is CPython along the horizon for me because IronPython will not interact well with Django like you said? Should I consider trying to install Python/Django/CPython, etc on Linux to start my development?

Thanks,

JJ
Message has been deleted

kenneth gonsalves

unread,
Jan 25, 2012, 1:37:05 AM1/25/12
to django...@googlegroups.com
On Tue, 2012-01-24 at 19:19 -0800, JJ Zolper wrote:
> I am interested in PostgreSQL. I've heard it is good to use along with
> Django. More specifically to work with GIS. I'm very interested in the
> Geographical uses of Django. In particular GeoDjango. As I continued
> to learn more about this web framework I hope to be able to work with
> databases such as PostgreSQL and work with Geographical
> information/code. Maybe this helps give a more representation of what
> I want to do with Django. I see on GeoDjango's documentation that the
> Linux mascot Tux is there. I keep thinking I am wasting my own time
> with Windows here and that my real destiny here is the real
> programmers language. To put it in short terms. Do you think that is
> true?

yes - especially if you are using OSM, postgresql is essential.
--
regards
Kenneth Gonsalves

JJ Zolper

unread,
Jan 25, 2012, 12:41:23 PM1/25/12
to django...@googlegroups.com
Okay I am glad to hear that something I knew was on the right track! Thanks Kenneth! However what is OSM? Open Street Maps? maybe you could tell me a little bit more about it as I have not heard of it?

JJ Zolper

unread,
Jan 25, 2012, 12:50:04 PM1/25/12
to django...@googlegroups.com
In many of the (I)DEs (PythonWin, IDLE, probably the various EMACS
and VI configurations, SciTE), one can edit a file, save it (some will
save for you if needed), then hit some key combo which will spawn a
Python interpreter passing it the file for execution. You may even be
prompted to supply command line arguments (PythonWin, I know does this). 

This is very interesting thanks for sharing! As for the information above that has cleared it up quite a bit for me.

Sam Lai has helped a lot I think I am going to try to see if CPython works in VS because he thinks I will have less compatibility with IronPython and Django which would not be good. For the time being however I think I might just use VS since I am still new to really what I could be lacking with that as far as compatibility.


william ratcliff

unread,
Jan 25, 2012, 1:04:31 PM1/25/12
to django...@googlegroups.com
Just curious--is there any particular reason that you were using Visual Studio?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/2LQU1l81OyoJ.

JJ Zolper

unread,
Jan 25, 2012, 5:03:54 PM1/25/12
to django...@googlegroups.com
Not really I don't have any preference. Any input is welcome!

Sam Lai

unread,
Jan 25, 2012, 7:45:55 PM1/25/12
to django...@googlegroups.com

Python Tools for Visual Studio should automatically detect CPython if
you have that installed. If you haven't, I suggest you download an
install a CPython distribution called ActivePython Community Edition
(http://www.activestate.com/activepython/downloads). It will set up
Python in your Windows environment properly, which the official one
doesn't seem to do right (judging by the posts here about Windows).

The bonus with VS is the great debugger, which works with CPython as
well. Many of the IDEs mentioned are just great text editors, and
don't include a debug environment (i.e. the ability to set
breakpoints, explore stack, step through code visually etc.). Some do
include such an environment, including PyCharm and PyDev.

PostgreSQL also works fine on Windows. No idea about all the GIS stuff
though. If you're comfortable with using Linux, then go for it, but
most of the basic stuff you can do on Windows (until you need other
bits of software to make things work, like Redis). Unless you have a
preference for Windows though, I wouldn't use it as a Django app web
server in production; there's far less support on the net to help you
out when things go wrong.

I use ActiveState Komodo Edit on Windows to modify files on my Linux
VM which runs the web server for my Django apps. It means I don't get
a debug environment though; working on finding something to make that
work.

>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/django-users/-/2LQU1l81OyoJ.

JJ Zolper

unread,
Jan 25, 2012, 8:05:59 PM1/25/12
to django...@googlegroups.com
>  Unless you have a
 preference for Windows though, I wouldn't use it as a Django app web
 server in production; there's far less support on the net to help you
 out when things go wrong. 

Let me see if this what you mean... so when I want to run "python manage.py runserver," a Django command I should steer clear of Windows? 

I use ActiveState Komodo Edit on Windows to modify files on my Linux
> VM which runs the web server for my Django apps. It means I don't get
> a debug environment though; working on finding something to make that
> work. 

So I should install ActiveState Komodo Edit to Windows. Which in turn well help me to work with my Django server through a Virtual Machine?

If I have this right I should install my CPython distro to VS and build my Python on Windows in VS. Then on the side I should have a VM running with my Django server (aka my Django project)?

JJ

Sam Lai

unread,
Jan 25, 2012, 8:26:32 PM1/25/12
to django...@googlegroups.com
On 26 January 2012 12:05, JJ Zolper <cod...@madtrak.com> wrote:
>>  Unless you have a
>>  preference for Windows though, I wouldn't use it as a Django app web
>>  server in production; there's far less support on the net to help you
>>  out when things go wrong.
>
> Let me see if this what you mean... so when I want to run "python manage.py
> runserver," a Django command I should steer clear of Windows?

The keywords were 'in production'. The development server (i.e. python
manage.py runserver) works fine under Windows. But when you want to
make the website accessible to your audience (the internet, company
etc.), you should host that on Linux.

>> I use ActiveState Komodo Edit on Windows to modify files on my Linux
>> VM which runs the web server for my Django apps. It means I don't get
>> a debug environment though; working on finding something to make that
>> work.
>
> So I should install ActiveState Komodo Edit to Windows. Which in turn well
> help me to work with my Django server through a Virtual Machine?

That's one way. It's a bit more complex than simply doing everything
inside a Linux VM. Komodo Edit also works in Linux as well.

> If I have this right I should install my CPython distro to VS and build my
> Python on Windows in VS. Then on the side I should have a VM running with my
> Django server (aka my Django project)?

See above; the runserver command works fine under Windows.

> JJ


>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/django-users/-/1Efy7_gaDdgJ.

JJ Zolper

unread,
Jan 25, 2012, 9:14:46 PM1/25/12
to django...@googlegroups.com
> The keywords were 'in production'. The development server (i.e. python
> manage.py runserver) works fine under Windows. But when you want to
> make the website accessible to your audience (the internet, company
> etc.), you should host that on Linux. 

I still don't quite understand. Can you explain more? I would think this means that my Django files should be on a Linux portion of my web server? I am with Bluehost.com

I have installed ActiveState and will give it a try. I have my VS up and running with Python Tools for VS so that should be okay.

Hey Sam you've been a great help. Would you by chance mind giving me your e-mail address? That way in the future I could work with you? I won't bother you too much don't worry! lol. Just since I am trying your advice it could be a great help to me.

What Virtual Machine did you pick? What Linux version are you running?

If you prefer e-mailing/want to give me your address my next inquery would just go to your e-mail.

Thanks so much!

JJ Zolper

Sam Lai

unread,
Jan 25, 2012, 9:30:26 PM1/25/12
to django...@googlegroups.com
On 26 January 2012 13:14, JJ Zolper <cod...@madtrak.com> wrote:
>> The keywords were 'in production'. The development server (i.e. python
>> manage.py runserver) works fine under Windows. But when you want to
>> make the website accessible to your audience (the internet, company
>> etc.), you should host that on Linux.
>
> I still don't quite understand. Can you explain more? I would think this
> means that my Django files should be on a Linux portion of my web server? I
> am with Bluehost.com

When you are developing your Django app, the development server that
comes with Django (python manage.py runserver) works fine on Windows.
When you are ready to move things into production for everyone else
access, you should not use the development server; instead you should
use a proper web server, e.g. nginx, cherokee or Apache. Those web
servers tend to be better documented on Linux.

If it makes things easier, just do everything on Linux.

> I have installed ActiveState and will give it a try. I have my VS up and
> running with Python Tools for VS so that should be okay.
>
> Hey Sam you've been a great help. Would you by chance mind giving me your
> e-mail address? That way in the future I could work with you? I won't bother
> you too much don't worry! lol. Just since I am trying your advice it could
> be a great help to me.
>
> What Virtual Machine did you pick? What Linux version are you running?

I'm just using VirtualBox, running a whatever Linux distro I happen to
like at the time, e.g. CentOS, Ubuntu etc.

> If you prefer e-mailing/want to give me your address my next inquery would
> just go to your e-mail.
>
> Thanks so much!
>
> JJ Zolper
>

> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/django-users/-/nMqg8xOLXRcJ.

JJ Zolper

unread,
Jan 25, 2012, 9:44:14 PM1/25/12
to django...@googlegroups.com

> When you are developing your Django app, the development server that
>  comes with Django (python manage.py runserver) works fine on Windows.
>  When you are ready to move things into production for everyone else
>  access, you should not use the development server; instead you should
>  use a proper web server, e.g. nginx, cherokee or Apache. Those web
>  servers tend to be better documented on Linux.

> If it makes things easier, just do everything on Linux.

So by everything you mean my Django project would be made within the VM and UNIX/Linux?

> I'm just using VirtualBox, running a whatever Linux distro I happen to
>  like at the time, e.g. CentOS, Ubuntu etc. 

Okay I've used VirtualBox before. Thanks!

kenneth gonsalves

unread,
Jan 26, 2012, 1:48:37 AM1/26/12
to django...@googlegroups.com

http://www.openstreetmap.org/
--
regards
Kenneth Gonsalves

Message has been deleted

Jonathan Paugh

unread,
Jan 24, 2012, 8:47:43 AM1/24/12
to django...@googlegroups.com
On 01/23/2012 03:58 PM, JJ Zolper wrote:
Yes I knew I was in the Python shell I just never saw anything that described you couldn't make Django commands within the Python interpreter. I mean it is based on Python isn't it? That's where I thought logically you could make Django calls from in Python?

SO....

Shells run commands. Python is not a shell.  If you want to run the Python command from inside of the Python interpreter prompt, the closest you can get is:
>>> import os
>>> os.system('python ./manage.py')

Steven Elliott Jr

unread,
Jan 25, 2012, 9:28:07 PM1/25/12
to django...@googlegroups.com
On Jan 25, 2012, at 9:14 PM, JJ Zolper wrote:

> The keywords were 'in production'. The development server (i.e. python
> manage.py runserver) works fine under Windows. But when you want to
> make the website accessible to your audience (the internet, company
> etc.), you should host that on Linux. 

I still don't quite understand. Can you explain more? I would think this means that my Django files should be on a Linux portion of my web server? I am with Bluehost.com

It means when you actually go to deploy your app on an actual web server in production you're going to be deploying on Linux. I've never seen a Python host on Windows, but then again I've never looked because, to be honest most Django devs use some Unix variant for development.

I have installed ActiveState and will give it a try. I have my VS up and running with Python Tools for VS so that should be okay.

Hey Sam you've been a great help. Would you by chance mind giving me your e-mail address? That way in the future I could work with you? I won't bother you too much don't worry! lol. Just since I am trying your advice it could be a great help to me.

What Virtual Machine did you pick? What Linux version are you running?

Most people use Ubuntu running in VirtualBox

If you prefer e-mailing/want to give me your address my next inquery would just go to your e-mail.

Thanks so much!

JJ Zolper

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/nMqg8xOLXRcJ.

JJ Zolper

unread,
Jan 27, 2012, 3:18:31 PM1/27/12
to django...@googlegroups.com
Since I will be deploying my Python code on a server that is based on Linux wouldn't it be smart that I develop my Python code on something similar to my VM for Django?

JJ Zolper

unread,
Jan 27, 2012, 3:24:47 PM1/27/12
to django...@googlegroups.com
> ActivePython for Windows includes the win32 extension libraries (if
 one wants to go to native Windows code -- though the now standard ctypes
 library permits similar capability if one knows the API), and PythonWin
 IDE (as I recall, this started life as an included demo of the win32
 extension libraries <G>). 

I don't necessarily want all my code to be native WIndows code. I'm starting to get the impression that since Django is developed on Unbuntu I should setup an interpreter on my VM with Unbuntu?

That's really all I am trying to understand. From A to B. A being where I am able to develop once I finally am able to make that decision and B how smart I picked A so that the move from my local computer to my server is smooth and simple.

I'm just unfamiliar with Python and how any of it is done besides just once you have an interpreter and type in simple functions. I've done everything from the interpreter I haven't even made a program yet. I just wanted to be in the right place when I started from the beginning just where I can send my work into production directly. If I loose compatibility with libraries and important features in Windows I will absolutely change my current course and move to where everyone is in the UNIX/LINUX realm.
Message has been deleted

JJ Zolper

unread,
Jan 27, 2012, 3:26:05 PM1/27/12
to django...@googlegroups.com
Thanks a lot I was thinking I would learn the Google Maps API. Have you worked with OSM?

Do you have any input if you have used OSM and if you have used Google Maps what your comments are?

Thanks,

JJ Zolper

Jonathan Paugh

unread,
Jan 28, 2012, 5:18:55 AM1/28/12
to django...@googlegroups.com
Developing on a Linux-based OS will give you indispensable understanding
of your production environment. On the other hand, it will probably be
very unfamiliar if you haven't worked on Linux before, and easy tasks
will become very difficult again, for a while. You should ultimately
develop your application on the platform that makes you the most
productive---the portability of Python and Django gives you that
luxury---you could even target the Java Virtual Machine. (And you won't
know that without trying them all.)

Definitely try out running a development websever './manage.py runserver
is fine) on Linux, to get a feel for what your production environment
might be like. You might decide you like working on Linux, and it make
you more productive---or not. But---at least for Django/Python---that's
largely a matter of taste.

kenneth gonsalves

unread,
Jan 28, 2012, 8:55:19 AM1/28/12
to django...@googlegroups.com

yes
--
regards
Kenneth Gonsalves

kenneth gonsalves

unread,
Jan 28, 2012, 8:56:21 AM1/28/12
to django...@googlegroups.com
On Fri, 2012-01-27 at 12:24 -0800, JJ Zolper wrote:
> That's really all I am trying to understand. From A to B. A being
> where I am able to develop once I finally am able to make that
> decision and B how smart I picked A so that the move from my local
> computer to my server is smooth and simple.

upgrade to linux and stop worrying
--
regards
Kenneth Gonsalves

kenneth gonsalves

unread,
Jan 28, 2012, 8:57:50 AM1/28/12
to django...@googlegroups.com

google maps are proprietary. OSM in open source - end of discussion.
--
regards
Kenneth Gonsalves

JJ Zolper

unread,
Jan 29, 2012, 12:45:37 AM1/29/12
to django...@googlegroups.com
Steven,

I have set up VirtualBox with Python and Django. Things have gone flawlessly.

Only thing I've noticed is it seems to be running a tad bit slow. I feel this way because I had a native installation before and it ran quite well.

Before I go too far into writing code I was hoping to "perfect" my environment. I want to be able to donate enough resources such as RAM to the VM so that it runs well but at the same time maintain a steady local Windows boot.

Would you mind helping get me situated?

My Laptop is a Fujitsu Lifebook T5010. A 231 GB HDD with 4 GB RAM. I have Windows 7 Enterprise 64 bit operating system installed.

The original or current setup for my Ubuntu 11.10 on my VirtualBox system is:

Base Memory: 700 MB (RAM? max is 4096)
Storage: 40 GB (Fixed)
Video Memory: 12 MB (max is 128)
Monitor count is 1

Those are all the details I thought might be useful. I would really appreciate some guidance as to what you set yours up as or what you think might be the best to optimize performance?

As a side note I'm really asking anyone in this thread what their opinion is? I plan is to look through this thread and see who else mentioned Linux and see if I can get input so I'm ready to go before I dive too deep into my development.

Thanks to you and to everyone who has been very patient with me, given me so many tips, and stepped me through my setup!

Much appreciation,

JJ Zolper




JJ Zolper

unread,
Jan 29, 2012, 12:46:09 AM1/29/12
to django...@googlegroups.com
Jonathan,

JJ Zolper

unread,
Jan 29, 2012, 12:49:14 AM1/29/12
to django...@googlegroups.com
Sam,

JJ Zolper

unread,
Jan 29, 2012, 12:50:30 AM1/29/12
to django...@googlegroups.com
lawgon,
Message has been deleted

JJ Zolper

unread,
Jan 29, 2012, 2:03:35 PM1/29/12
to django...@googlegroups.com
Going forward I'll make sure to post only once. I don't use these Google Groups mailing lists that much besides the occasional community question so I'll make sure not to spam you all next time! : /

Yes well I bought my laptop through my school (Virginia Tech) and we had a few options for engineering computers. As for the 64-bit that is new to me but I suppose I should have thought it would use more RAM.

I do hope to buy a new laptop in the next few years the laptop I have now is overrated, I think.

Anyways, I was able to find some youtube videos with Windows users using Vbox and Ubuntu. They typically selected half of their overall RAM to be used in the Vbox as well as some amped up their video memory allocation. So probably today or tomorrow I will give the whole installation another go. The multiple workspace feature of 11.10 seems to hang a good bit so I'm wondering if extra video graphic memory might help... I guess it's sort of a guess and check thing as long as I don't over my demand my Windows system.

I just want to give myself the right specs going forward so mid development I don't run into issues. As for storage space some picked dynamic and some picked fixed. I picked fix at 40 GB which yes probably is more than enough but I have 120 GB free now so why not. I saw that dynamically expanding could hender performace so I guess we will see if things go smoothly.

Thanks Dennis!

JJ

Sam Lai

unread,
Jan 30, 2012, 6:09:36 AM1/30/12
to django...@googlegroups.com
On 29 January 2012 16:49, JJ Zolper <cod...@madtrak.com> wrote:
> Sam,
>
> I have set up VirtualBox with Python and Django. Things have gone
> flawlessly.
>
> Only thing I've noticed is it seems to be running a tad bit slow. I feel
> this way because I had a native installation before and it ran quite well.

Have you installed the VirtualBox Guest Additions? That will, among
other things, optimise your video which should make it feel a lot
faster.

This looks like a good guide for installing it on Ubuntu 11.10 -
http://www.varunvats.com/2011/06/install-virtualbox-guest-additions-for-ubuntu-11-04-guest/

> Before I go too far into writing code I was hoping to "perfect" my
> environment. I want to be able to donate enough resources such as RAM to the
> VM so that it runs well but at the same time maintain a steady local Windows
> boot.
>
> Would you mind helping get me situated?
>
> My Laptop is a Fujitsu Lifebook T5010. A 231 GB HDD with 4 GB RAM. I have
> Windows 7 Enterprise 64 bit operating system installed.
>
> The original or current setup for my Ubuntu 11.10 on my VirtualBox system
> is:
>
> Base Memory: 700 MB (RAM? max is 4096)
> Storage: 40 GB (Fixed)
> Video Memory: 12 MB (max is 128)
> Monitor count is 1
>
> Those are all the details I thought might be useful. I would really
> appreciate some guidance as to what you set yours up as or what you think
> might be the best to optimize performance?
>
> As a side note I'm really asking anyone in this thread what their opinion
> is? I plan is to look through this thread and see who else mentioned Linux
> and see if I can get input so I'm ready to go before I dive too deep into my
> development.
>
> Thanks to you and to everyone who has been very patient with me, given me so
> many tips, and stepped me through my setup!
>
> Much appreciation,
>
> JJ Zolper
>
>
>
>

> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/django-users/-/y689VFsrhDUJ.

JJ Zolper

unread,
Jan 30, 2012, 5:53:56 PM1/30/12
to django...@googlegroups.com
I have never heard of Guess Additions thanks for the tip!

Right now I am going to remove my Ubuntu installation and re-install to give it more RAM and Video memory as well as install guest Additions!

Thanks,

JJ

JJ Zolper

unread,
Jan 31, 2012, 1:38:18 PM1/31/12
to django...@googlegroups.com
Sam,

Since I'm on Ubuntu know with my Python and Django I'm wondering which CPython I should download?

I saw stackless python on the python.org site but I'm not sure if that's what CPython version I would need. I thought there was a standard CPython? Any help about my interpreter for Python on Ubuntu would be helpful.

As for Django I think I'm in good shape since it is now ready to go along side Ubuntu. And that's how i would move to production, on a Linux machine for it. I can open a python interpreter from the terminal but I thought I should have more than that such as IronPython or CPython?

JJ


Daniel Roseman

unread,
Jan 31, 2012, 2:57:54 PM1/31/12
to django...@googlegroups.com
There isn't such a thing as "CPython" that's separate from the Python interpreter already on your VM. That interpreter *is* CPython. You have no need to install anything else. In any case, that's the version that works with the other Python tools on the system, so installing a different one would be complicated and unnecessary.
--
DR.
Reply all
Reply to author
Forward
0 new messages