Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
startproject - django 1.9.6
#1
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?
Reply
#2
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.
Reply
#3
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
Reply
#4
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.
Reply
#5
It's Solved. I just followed the same steps again and this time it worked fine.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Django: How to automatically substitute a variable in the admin page at Django 1.11? m0ntecr1st0 3 3,247 Jun-30-2019, 12:21 AM
Last Post: scidam

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020