Python Forum
startproject - django 1.9.6 - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html)
+--- Thread: startproject - django 1.9.6 (/thread-1300.html)



startproject - django 1.9.6 - lewashby - Dec-22-2016

Linux Mint

I'm following a book on Django and it has this -> https://hellowebapp.com/setup/ accompanying website. Take a look below at what I'm getting when I get to the "Start your Django project" section of the link.

Here's a peak at my terminal input and feedback.

(venv) user@mothership myhellowebapp $ pip install Django==1.9.6
Collecting Django==1.9.6
Downloading Django-1.9.6-py2.py3-none-any.whl (6.6MB)
100% |████████████████████████████████| 6.6MB 138kB/s
Installing collected packages: Django
Successfully installed Django-1.9.6
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(venv) user@mothership myhellowebapp $ git init
Initialized empty Git repository in /home/user/projects/python/django-projects/myhellowebapp/.git/
(venv) user@mothership myhellowebapp $ django-admin.py startproject hellowebapp .
django-admin.py: command not found
(venv) user@mothership myhellowebapp $ ls
venv
(venv) user@mothership myhellowebapp $ python django-admin.py startproject hellowebapp .
python: can't open file 'django-admin.py': [Errno 2] No such file or directory
(venv) user@mothership myhellowebapp $ ls

Note that I already have python 2.7 & 3.5 installed on my system and if you when referring to python my system is be default point to python 2.7. Any ideas?


RE: startproject - django 1.9.6 - snippsat - Dec-22-2016

I can not see where it goes wrong.
django-admin.py is in you bin folder(Scripts folder on Windows),
but in active virtual environment it should find it.

Can do quick test,i have Windows now.
You see when create virtualenv that it use python 3.4.
which python tells me that i use python in virtualenv.

No problem in test.
Can test with Mint later have version on VirtualBox.


RE: startproject - django 1.9.6 - lewashby - Dec-22-2016

user@mothership myhellowebapp $ pwd
/home/user/projects/python/django-projects/myhellowebapp
user@mothership myhellowebapp $ ls -al
total 16
drwxr-xr-x 4 user user 4096 Dec 20 22:39 .
drwxr-xr-x 3 user user 4096 Dec 20 22:37 ..
drwxr-xr-x 7 user user 4096 Dec 20 22:39 .git
drwxr-xr-x 7 user user 4096 Dec 20 22:35 venv
user@mothership myhellowebapp $ source venv/bin/activate
(venv) user@mothership myhellowebapp $ which python
/usr/bin/python
(venv) user@mothership myhellowebapp $ ls -l /usr/bin/python
lrwxrwxrwx 1 root root 9 Dec 7 19:11 /usr/bin/python -> python2.7


RE: startproject - django 1.9.6 - snippsat - Dec-24-2016

It's not using python version in virtual environment as it should,but system python version.
Here a quick test in Mint.
tom@tom-VirtualBox ~ $ mkdir projects
tom@tom-VirtualBox ~ $ cd projects
tom@tom-VirtualBox ~/projects $ mkdir myhellowebapp
tom@tom-VirtualBox ~/projects $ cd myhellowebapp
tom@tom-VirtualBox ~/projects/myhellowebapp $ virtualenv venv
New python executable in /home/tom/projects/myhellowebapp/venv/bin/python
Installing setuptools, pip, wheel...done.
tom@tom-VirtualBox ~/projects/myhellowebapp $ source venv/bin/activate
(venv) tom@tom-VirtualBox ~/projects/myhellowebapp $ which python
/home/tom/projects/myhellowebapp/venv/bin/python
You see when i use which python command,that it use python version in virtual environment.


RE: startproject - django 1.9.6 - lewashby - Dec-24-2016

It's Solved. I just followed the same steps again and this time it worked fine.