Hello guest, if you read this it means you are not registered. Click here to register in a few simple steps, you will enjoy all features of our Forum.
Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
startproject - django 1.9.6
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) 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?
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.
user@mothership myhellowebapp $ pwd
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
(venv) user@mothership myhellowebapp $ ls -l /usr/bin/python
lrwxrwxrwx 1 root root 9 Dec 7 19:11 /usr/bin/python -> python2.7
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
You see when i use which python command,that it use python version in virtual environment.
It's Solved. I just followed the same steps again and this time it worked fine.

Top Page

Forum Jump:

Users browsing this thread: 1 Guest(s)