install with package manager or pip

36 views
Skip to first unread message

emetib

unread,
Jun 25, 2016, 4:07:54 PM6/25/16
to Django users
i'm looking at trying out django, yet i've seen that you can install it with either the package manager or pip.

i'm running debian testing to play around with this.  small install ssh server only.  using a clone of this base install.

haven't played with/used pip hardly at all.

questions- 
does the package manager have the same versions as pip?
what is a better way to keep track of the installed packages?
what is a better way to upgrade the installed packages?
do the docs apply to both versions or only one?  which one?  why?

any additional thoughts?

Gary Roach

unread,
Jun 25, 2016, 4:16:59 PM6/25/16
to django...@googlegroups.com
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7c15265e-1797-4762-a3d0-e8efe86ad794%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Welcome,

First,read the prior emails titled "Beginner question regarding virtualenv". Most of your questions will be answered there.

Second, use pip inside of a virtual environment to install both django and python. Save yourself some grief later.

Gary R.


ludovic coues

unread,
Jun 25, 2016, 4:35:19 PM6/25/16
to django...@googlegroups.com
virtualenv venv
source venv/bin/activate
pip install django
pip freeze > requirements.txt
django-admin startproject tutorial
cd tutorial && python manage.py runserver

Assuming you have python and virtualenv installed on your machine. At
this point, you have:
* a virtualenv inside the folder venv
* a text file, requirements.txt, with all your dependencies
* a django project in the folder tutorial, running the latest stable version

If you use version control, requirement.txt should be tracked but not
venv. You can recreate the virtualenv with the first two commands
followed by `pip install -r requirements.txt`
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/7c15265e-1797-4762-a3d0-e8efe86ad794%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--

Cordialement, Coues Ludovic
+336 148 743 42

emetib

unread,
Jun 25, 2016, 9:05:06 PM6/25/16
to Django users
thank you for your responses.

one last question.

do i need to be in the virtualenv when doing things?
i.e. editing code, running the server...

i just have to make sure that the folder i set up with the virtenv is my root dir when coding, correct?

thank you
em

emetib

unread,
Jun 25, 2016, 9:36:02 PM6/25/16
to Django users
answered it myself with more searching.

install additional applications that only virtualenv is going to use in the virtenv folder.

thanks again.
em

ludovic coues

unread,
Jun 26, 2016, 12:13:20 PM6/26/16
to django...@googlegroups.com
The virtualenv folder should not be your root folder.
It's a separate folder. You can keep them all in a single location or
put each of them in a subdir of your projet.

You start using a virtualenv with "source venv/bin/activate". After
this, the current terminal will use the virtualenv in the folder venv.
You can exit the virtualenv with `deactivate`

You need to activate the virtualenv to use manage.py but you don't
need it to change the code.
You can also use `venv/bin/python manage.py runserver` if you need to
run the server from a script.
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/97ea806e-3b81-48c1-9708-224405e9b0a6%40googlegroups.com.

emetib

unread,
Jun 26, 2016, 12:52:11 PM6/26/16
to Django users

On Sunday, June 26, 2016 at 11:13:20 AM UTC-5, ludovic coues wrote:
The virtualenv folder should not be your root folder.

it's not.  VirtEnv is base.  VirtEnv/mysite is the virtualenv.  this is where manage.py is located then VirtEnv/mysite/mysite and .../mysite/polls
this is what the tutorial says for 'your first project'.  trying to use the same naming schema so i can follow along better
 
You can also use `venv/bin/python manage.py runserver` if you need to 
run the server from a script.
 
that was the problem i was having.  not having the whole/proper dir structure being pointed to
was trying python VirtEnv/mysite/manage.py
instead of VirtEnv/bin/python VirtEnv/mysite/manage.py

i think that i was/am having a hard time with the idea that it's seperate, since sometimes without being in the venv i get the same command options that i'm used to at just a standard prompt.  have to start thinking like it's a virtual server, disconnected from the base system.

i think that i will stay at the (virtualenv)prompt $, until i get more used to it.  that might help with somethings.

thank you for the pointers, they are very helpful
em

ludovic coues

unread,
Jun 26, 2016, 4:27:39 PM6/26/16
to django...@googlegroups.com
I setup my folder this way:
/project/VirtEnv
/project/mysite
File like requirement.txt, readme, licence and .gitignore are in
/project, /project/mysite contain manage.py and all the django file,
/project/VirtEnv is managed by virtualenv and pip. I don't look at the
content of the folder most of the time.

The (VirtEnv) at the start of your prompt tell you that VirtEnv is
activated. That's the way it should be used. Once activated, python
will be the version of python in your virtualenv, with access to all
the library you have installed.
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e8eea30c-da36-4f7b-916c-2733a09ae91a%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages