On 3 September 2010 19:42, gintare <g.statk...@gmail.com> wrote: > Hello, > > I mean the correct way of running django seems to be to add to windows > environmental variable PATH c:/first/Python26/Lib/site-packages/ > Django-1.2.1/django/bin > and when run > $ cmd > $ django-admin.py startproject mysite > > the question, why importing management from django.core do not work? > from django.core import management > Error: No module django.core > > the module is under c:/first/Python26/Lib/site-packages/Django-1.2.1/ > django > I mean it seems cmd must know where are all django modules. How?
How did you install Django? In c:/first/Python26/Lib/site-packages, is there a .pth file? If so, what is in it? It sounds like you did not install Django properly - you just unpacked it inside c:/first/Python26/Lib/site-packages. There's a bit more to it. The best way to do it is to use the setup script provided with Django (if you're doing this, do NOT unpack the archive inside site-packages; the setup script will do the copying for you), or use easy_install or pip (which you may have to install separately). To use the provided setup script, simply unpack the Django tarball to somewhere temporary. The open the command prompt at that location, and type - python setup.py install And Python should do the rest. You should have a working Django setup by the end. Also, C:\first\Python26\Scripts should be in your Windows PATH, but none of the other Python related paths. Python already knows about its site-packages directory. And inside C:\first\Python26\Scripts, there should be a file named django-admin.py once the above setup script has finished. > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.