Jan-17-2018, 06:14 AM
So I'm getting used to the Django framework and sort of bouncing from videos/books. No two materials seem to use the same syntax. I'm trying to understand why I'm typing what I am into the terminal instead of just typing (ie django-admin.py manage.py migrate before python3 manage.py run server ...I want to understand why it's django-admin.py in one area and python3 in the another). So I have a question. The following works on local host.
So mainly what is the difference between these two "styles"? (I don't have a better word).
Also The first example tells me that I must use (dot) when starting project. The second example ignores it...
Can anyone PLEASE run through these quickly? they both work in my browser...but I just want to understand...
[inline]me@me-ubuntu:~/Desktop$ mkdir foo
me@me-ubuntu:~/Desktop$ cd foo
me@me-ubuntu:~/Desktop/foo$ python3 -m venv foo_env
me@me-ubuntu:~/Desktop/foo$ source foo_env/bin/activate
(foo_env) me@me-ubuntu:~/Desktop/foo$ pip3 install Django
--SNIP--
(foo_env) me@me-ubuntu:~/Desktop/foo$ django-admin.py startproject foo .
(foo_env) me@me-ubuntu:~/Desktop/foo$ python3 manage.py migrate
--SNIP--
(foo_env) me@me-ubuntu:~/Desktop/foo$ python3 manage.py runserver
Performing system checks...
--SNIP--
Quit the server with CONTROL-C.
[/inline]
ANOTHER STYLE
[inline]me@me-ubuntu:~/Desktop$ mkdir foo
me@me-ubuntu:~/Desktop$ cd foo
me@me-ubuntu:~/Desktop/foo$ virtualenv foo #this part here is different with VIRTUALENV
Using base prefix '/usr'
New python executable in /home/me/Desktop/foo/foo/bin/python3
Also creating executable in /home/me/Desktop/foo/foo/bin/python
Installing setuptools, pip, wheel...done.
me@me-ubuntu:~/Desktop/foo$ cd foo
me@me-ubuntu:~/Desktop/foo/foo$ source bin/activate #this is also different involving wheels (~tarballs?)
(foo) me@me-ubuntu:~/Desktop/foo/foo$ pip3 install django
--SNIP--
(foo) me@me-ubuntu:~/Desktop/foo/foo$ django-admin startproject foo #no \s dot ? why?
(foo) me@me-ubuntu:~/Desktop/foo/foo$ cd foo
(foo) me@me-ubuntu:~/Desktop/foo/foo/foo$ python3 manage.py migrate
--SNIP--
(foo) me@me-ubuntu:~/Desktop/foo/foo/foo$ python3 manage.py runserver
--SNIP--
[/inline]
So mainly what is the difference between these two "styles"? (I don't have a better word).
Also The first example tells me that I must use (dot) when starting project. The second example ignores it...
Can anyone PLEASE run through these quickly? they both work in my browser...but I just want to understand...
[inline]me@me-ubuntu:~/Desktop$ mkdir foo
me@me-ubuntu:~/Desktop$ cd foo
me@me-ubuntu:~/Desktop/foo$ python3 -m venv foo_env
me@me-ubuntu:~/Desktop/foo$ source foo_env/bin/activate
(foo_env) me@me-ubuntu:~/Desktop/foo$ pip3 install Django
--SNIP--
(foo_env) me@me-ubuntu:~/Desktop/foo$ django-admin.py startproject foo .
(foo_env) me@me-ubuntu:~/Desktop/foo$ python3 manage.py migrate
--SNIP--
(foo_env) me@me-ubuntu:~/Desktop/foo$ python3 manage.py runserver
Performing system checks...
--SNIP--
Quit the server with CONTROL-C.
[/inline]
ANOTHER STYLE
[inline]me@me-ubuntu:~/Desktop$ mkdir foo
me@me-ubuntu:~/Desktop$ cd foo
me@me-ubuntu:~/Desktop/foo$ virtualenv foo #this part here is different with VIRTUALENV
Using base prefix '/usr'
New python executable in /home/me/Desktop/foo/foo/bin/python3
Also creating executable in /home/me/Desktop/foo/foo/bin/python
Installing setuptools, pip, wheel...done.
me@me-ubuntu:~/Desktop/foo$ cd foo
me@me-ubuntu:~/Desktop/foo/foo$ source bin/activate #this is also different involving wheels (~tarballs?)
(foo) me@me-ubuntu:~/Desktop/foo/foo$ pip3 install django
--SNIP--
(foo) me@me-ubuntu:~/Desktop/foo/foo$ django-admin startproject foo #no \s dot ? why?
(foo) me@me-ubuntu:~/Desktop/foo/foo$ cd foo
(foo) me@me-ubuntu:~/Desktop/foo/foo/foo$ python3 manage.py migrate
--SNIP--
(foo) me@me-ubuntu:~/Desktop/foo/foo/foo$ python3 manage.py runserver
--SNIP--
[/inline]