Hello World,
I'm curious about working with the dev-version of Django.
I want to get skilled at using Django, Python 2.7.8, and virtualenv together.
I see this page:
https://github.com/django/django/blob/master/INSTALLI installed python and then virtualenv:
d...@cen113.dan ~ $ which python
/home/dan/venv1/bin/python
d...@cen113.dan ~ $
d...@cen113.dan ~ $
d...@cen113.dan ~ $ /home/dan/venv1/bin/python
/home/dan/venv1/bin/python
Python 2.7.8 (default, Jul 15 2014, 03:37:39)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()
d...@cen113.dan ~ $
d...@cen113.dan ~ $
d...@cen113.dan ~ $
The above INSTALL page says this:
AS AN ALTERNATIVE, you can just copy the entire "django" directory to Python's
site-packages directory
I did this:
d...@cen113.dan ~ $
d...@cen113.dan ~ $
d...@cen113.dan ~ $ cd /home/dan/venv1/lib/python2.7/site-packages
d...@cen113.dan ~/venv1/lib/python2.7/site-packages $
d...@cen113.dan ~/venv1/lib/python2.7/site-packages $
d...@cen113.dan ~/venv1/lib/python2.7/site-packages $
git clone
https://github.com/django/django.gitd...@cen113.dan ~ $
d...@cen113.dan ~ $ ls -la ~/venv1/lib/python2.7/site-packages/django/
total 112
drwxr-xr-x. 9 dan dan 4096 Jul 19 21:41 .
drwxrwxr-x. 8 dan dan 4096 Jul 19 21:41 ..
-rw-rw-r--. 1 dan dan 26288 Jul 19 21:41 AUTHORS
-rw-rw-r--. 1 dan dan 913 Jul 19 21:41 CONTRIBUTING.rst
drwxrwxr-x. 17 dan dan 4096 Jul 19 21:41 django
drwxrwxr-x. 13 dan dan 4096 Jul 19 21:41 docs
drwxrwxr-x. 2 dan dan 4096 Jul 19 21:41 extras
drwxrwxr-x. 8 dan dan 4096 Jul 19 21:59 .git
-rw-rw-r--. 1 dan dan 249 Jul 19 21:41 .gitattributes
-rw-rw-r--. 1 dan dan 123 Jul 19 21:41 .gitignore
-rw-rw-r--. 1 dan dan 136 Jul 19 21:41 .hgignore
-rw-rw-r--. 1 dan dan 611 Jul 19 21:41 INSTALL
-rw-rw-r--. 1 dan dan 1552 Jul 19 21:41 LICENSE
-rw-rw-r--. 1 dan dan 1639 Jul 19 21:41 MANIFEST.in
-rw-rw-r--. 1 dan dan 1782 Jul 19 21:41 README.rst
drwxrwxr-x. 2 dan dan 4096 Jul 19 21:41 scripts
-rw-rw-r--. 1 dan dan 404 Jul 19 21:41 setup.cfg
-rw-rw-r--. 1 dan dan 3302 Jul 19 21:41 setup.py
drwxrwxr-x. 198 dan dan 12288 Jul 19 21:41 tests
drwxrwxr-x. 2 dan dan 4096 Jul 19 21:41 .tx
d...@cen113.dan ~ $
d...@cen113.dan ~ $
d...@cen113.dan ~ $
At this point I have done what the INSTALL page says I can do.
I tried this:
d...@cen113.dan ~ $
d...@cen113.dan ~ $ which python
which python
/home/dan/venv1/bin/python
d...@cen113.dan ~ $
d...@cen113.dan ~ $
d...@cen113.dan ~ $ python
python
Python 2.7.8 (default, Jul 15 2014, 03:37:39)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
import django
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named django
>>>
>>>
Since I'm using virtualenv and the latest dev-version of Django together,
I must have a loose connection somewhere in my setup.
I have some questions:
q1: Is this statement true:
"
AS AN ALTERNATIVE, you can just copy the entire "django" directory to Python's
site-packages directory
"
??
q2: If import django failed for you how would you debug it?
q3: If I import a module and python cannot see it, do I need to be looking at any env variables?
Dan