Sorry about this post

2016-04-29 Thread Gary Roach
I'm sorry that I am tying up everything with this message but am having 
problems with one of my mailing list accounts and need to trouble shoot.

None of my posts are showing up.

If anyone sees this just add something simple and return it to me.

I really appreciate your help.

Gary R

--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/5723984F.1090506%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: Absolute beginner step by step

2016-06-11 Thread Gary Roach
If you don't mind working with Python2.7 and Django 1.7 you might try 
"Tango With Django" . It is out of date but still is a good place to 
start. Too bad that the author hasn't updated it. I have had some 
success with running three projects in parallel. Tango along with the 
official Django howto and another with your own project if you have one. 
I saw a reference to "Learning Python The  Hard Way". It's a good choice.


One nasty thing you may run into if you run parallel programs is the use 
of multiple version of Python and Django. If you use virtualenv and 
pyvenv to set up multiple virtual environments and then point your IDE 
at the one needed for a particular project, you should be ok. You don't 
even have to activate the environments because you are using them for 
storage of python and django versions only.


Good luck

Gary R.


On 06/10/2016 07:32 PM, Mc. Holid wrote:

Dear All,

Could anyone help  to share the point for absolute beginner guide.

I have already know a little bit about html, and having strong 
background in vb6.


Thanks for any kind help.

Best Regards
Mchoud
--
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+unsubscr...@googlegroups.com 
.
To post to this group, send email to django-users@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/d2fa7fd5-2673-4292-a14e-482e148587bb%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/575C7D80.7060206%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: Absolute beginner step by step

2016-06-13 Thread Gary Roach
I stand corrected. There is a new Tango With Django tutorial out. It 
uses Python 3.5 and Django 1.9. Try 
/media.readthedocs.org/pdf/tango-with-django/latest/tango-with-django.pdf


Gary R

On 06/11/2016 02:07 PM, Gary Roach wrote:
If you don't mind working with Python2.7 and Django 1.7 you might try 
"Tango With Django" . It is out of date but still is a good place to 
start. Too bad that the author hasn't updated it. I have had some 
success with running three projects in parallel. Tango along with the 
official Django howto and another with your own project if you have 
one. I saw a reference to "Learning Python The  Hard Way". It's a good 
choice.


One nasty thing you may run into if you run parallel programs is the 
use of multiple version of Python and Django. If you use virtualenv 
and pyvenv to set up multiple virtual environments and then point your 
IDE at the one needed for a particular project, you should be ok. You 
don't even have to activate the environments because you are using 
them for storage of python and django versions only.


Good luck

Gary R.


On 06/10/2016 07:32 PM, Mc. Holid wrote:

Dear All,

Could anyone help  to share the point for absolute beginner guide.

I have already know a little bit about html, and having strong 
background in vb6.


Thanks for any kind help.

Best Regards
Mchoud
--
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+unsubscr...@googlegroups.com 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto:django-users@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/d2fa7fd5-2673-4292-a14e-482e148587bb%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
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+unsubscr...@googlegroups.com 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto:django-users@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/575C7D80.7060206%40verizon.net 
<https://groups.google.com/d/msgid/django-users/575C7D80.7060206%40verizon.net?utm_medium=email&utm_source=footer>.

For more options, visit https://groups.google.com/d/optout.



--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/84570aa3-6447-c678-b060-5baa2de56bf6%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: Absolute beginner step by step

2016-06-16 Thread Gary Roach
I missed the use of Django 1.5.4,  but Django is supposed to be 
completely backward compatible. So using 1.9 shouldn't cause any 
problems. The switch from python 2.7 to 3.5, on the other hand, can be a 
mess.


Gary R.

On 06/15/2016 05:24 PM, M. Kholid wrote:
I tried to downloan the tutorial from the given 
link /media.readthedocs.org/pdf/tango-with-django/latest/tango-with-django.pdf 
<http://media.readthedocs.org/pdf/tango-with-django/latest/tango-with-django.pdf> 



It stil using django version 1.5.4

On Wed, Jun 15, 2016 at 10:44 PM, Shaylee Hansen 
<mailto:shan...@gcommercesolutions.com>> wrote:


Thanks for the update on the new Tango With Django.   Everyone
highly recommends this tutorial so I'm excited to see its recently
been updated :)

On Monday, June 13, 2016 at 12:51:07 PM UTC-6, gary719_list1 wrote:

I stand corrected. There is a new Tango With Django tutorial
out. It uses Python 3.5 and Django 1.9. Try

/media.readthedocs.org/pdf/tango-with-django/latest/tango-with-django.pdf

<http://media.readthedocs.org/pdf/tango-with-django/latest/tango-with-django.pdf>

Gary R

    On 06/11/2016 02:07 PM, Gary Roach wrote:

If you don't mind working with Python2.7 and Django 1.7 you
might try "Tango With Django" . It is out of date but still
is a good place to start. Too bad that the author hasn't
updated it. I have had some success with running three
projects in parallel. Tango along with the official Django
howto and another with your own project if you have one. I
saw a reference to "Learning Python The Hard Way". It's a
good choice.

One nasty thing you may run into if you run parallel programs
is the use of multiple version of Python and Django. If you
use virtualenv and pyvenv to set up multiple virtual
environments and then point your IDE at the one needed for a
particular project, you should be ok. You don't even have to
activate the environments because you are using them for
storage of python and django versions only.

Good luck

Gary R.


On 06/10/2016 07:32 PM, Mc. Holid wrote:

Dear All,

Could anyone help  to share the point for absolute beginner
guide.

I have already know a little bit about html, and having
strong background in vb6.

Thanks for any kind help.

Best Regards
Mchoud
-- 
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/d2fa7fd5-2673-4292-a14e-482e148587bb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
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/575C7D80.7060206%40verizon.net.
For more options, visit https://groups.google.com/d/optout.




NOTICE: This email and attached file(s) contain Gcommerce
Solutions, LLC confidential information intended for the exclusive
use of the individual(s) to whom addressed. If you are not the
intended recipient, please immediately delete this Email (and
attached files) and treat the information as confidential.

-- 
You received this message because you are subscribed to a topic in

the Google Groups "Django users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/django-users/cryoIzZ7p-o/unsubscribe.
To unsubscribe from this group and all its topics, send an email
to django-users+unsubscr...@googlegroups.com
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com
<mailto:django-users@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/b4c64c46-02a6-4237-bbff-b4b3fbd0d6e8%40googlegroups.com

<https://groups.google

Re: Absolute beginner step by step

2016-06-20 Thread Gary Roach
I stand corrected  again. I think I would try 1.9 anyway. May 
get a little practice in debugging.


Gary R,

 On 06/20/2016 12:42 AM, Derek wrote:

"Django is supposed to be completely backward compatible"

Er, no, its not and they never promised it would be.  You need to 
check the changes made for each release - as they say here:


https://docs.djangoproject.com/en/1.9/releases/

"you will need to check *all* the backwards-incompatible changes..."


On Thursday, 16 June 2016 20:30:57 UTC+2, gary719_list1 wrote:

I missed the use of Django 1.5.4,  but Django is supposed to be
completely backward compatible. So using 1.9 shouldn't cause any
problems. The switch from python 2.7 to 3.5, on the other hand,
can be a mess.

Gary R.

On 06/15/2016 05:24 PM, M. Kholid wrote:

I tried to downloan the tutorial from the given
link 
/media.readthedocs.org/pdf/tango-with-django/latest/tango-with-django.pdf

<http://media.readthedocs.org/pdf/tango-with-django/latest/tango-with-django.pdf>


It stil using django version 1.5.4

On Wed, Jun 15, 2016 at 10:44 PM, Shaylee Hansen
> wrote:

Thanks for the update on the new Tango With Django.  
Everyone highly recommends this tutorial so I'm excited to

see its recently been updated :)

On Monday, June 13, 2016 at 12:51:07 PM UTC-6, gary719_list1
wrote:

I stand corrected. There is a new Tango With Django
tutorial out. It uses Python 3.5 and Django 1.9. Try

/media.readthedocs.org/pdf/tango-with-django/latest/tango-with-django.pdf

<http://media.readthedocs.org/pdf/tango-with-django/latest/tango-with-django.pdf>

    Gary R

    On 06/11/2016 02:07 PM, Gary Roach wrote:

If you don't mind working with Python2.7 and Django 1.7
you might try "Tango With Django" . It is out of date
but still is a good place to start. Too bad that the
author hasn't updated it. I have had some success with
running three projects in parallel. Tango along with the
official Django howto and another with your own project
if you have one. I saw a reference to "Learning Python
The  Hard Way". It's a good choice.

One nasty thing you may run into if you run parallel
programs is the use of multiple version of Python and
Django. If you use virtualenv and pyvenv to set up
multiple virtual environments and then point your IDE at
the one needed for a particular project, you should be
ok. You don't even have to activate the environments
because you are using them for storage of python and
django versions only.

Good luck

Gary R.


On 06/10/2016 07:32 PM, Mc. Holid wrote:

Dear All,

Could anyone help  to share the point for absolute
beginner guide.

I have already know a little bit about html, and having
strong background in vb6.

Thanks for any kind help.

Best Regards
Mchoud
-- 
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
<https://groups.google.com/group/django-users>.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/d2fa7fd5-2673-4292-a14e-482e148587bb%40googlegroups.com

<https://groups.google.com/d/msgid/django-users/d2fa7fd5-2673-4292-a14e-482e148587bb%40googlegroups.com>.
For more options, visit
https://groups.google.com/d/optout
<https://groups.google.com/d/optout>.


-- 
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
<https://groups.google.com/group/django-users>.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/575C7D80.7060206%40verizon.net

<https://groups.google.com/d/ms

Re: Beginner question regarding virtualenv

2016-06-23 Thread Gary Roach

On 06/23/2016 11:36 AM, Leo wrote:
Hi Leo,

The only problem with not using virtuaenv in your case is if you are 
still periodically updating your software. Since you are using the OS 
versions of python and django you are at the mercy of those upgrades. A 
switch from Django 1.8 to 1.9 could break your project - as an example. 
A switch from Python 2.7 to 3.5 will definitely break you project.  Also 
how you set up depends on what IDE you are using. If you are just 
working with your standard command line monitor then the virtual 
environment is fairly straight forward. Use virtualevwrapper for python 
2.7 but I would suggest pyvenv for python 3. There are very good docs 
for those on the web. If you are using an IDE, things could get more 
complicated. I'm using Eclipse with PyDev and had fits with the setup. I 
finally created a virtual environment in my /opt/ directory and, using 
pip, loaded it with Python3.5 and Django 1.9. I never really open the 
virtualenv but just point to it in the IDE setup. This seems to work so far.


In short, be safe and setup a virtual environment. It will make 
migration easier as well.


Gary R.


Hey Everyone,


I’m a total newb to using Django and open stack. I am working on 
creating a Django development environment in a VMware 
environment/Ubuntu OS. Eventually I want to deploy this to 
production.  The site’s purpose is as an intranet site.



I have been following the Django tutorial but recently discovered some 
other Django tutorials which led me to posting this question. I didn’t 
create a Python vitrualenv rather installed everything at the root of 
the OS. I am unsure if this will cause me problems or if I can proceed 
with this approach. I do not plan to use the VM for anything else but 
this specific intranet site.



Thanks for your help.

LV

--
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+unsubscr...@googlegroups.com 
.
To post to this group, send email to django-users@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/f2afd0a2-9644-4818-98d5-85bad724cae6%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.



--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/fb57b312-37e0-4d9b-3220-a0a784356d17%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Inconsistent dedent error

2016-06-23 Thread Gary Roach

Hi all,

The following code is part of the djangoproject.com/en/1.9/tutorial part 
2 in mysite/polls/models.py


class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')

def __str__(self):
return self.question_text


class Choice(models.Model):
question = models.ForeignKey(Question, on_delete=models.CASCADE)
choice_text = models.CharField(max_length=200)
votes = models.IntegerField(default=0)

def _str__(self):
return self.choice_text

The last entry (def __str__(self): throws an error "inconsistent dedent 
at line  I can find nothing wrong. I have tried retyping the line 
with no results. I'm using Eclipse IDE with PyDev plugin. This is not 
just an annoyance. Any attempt to do migrate errors out with the same 
error. The code is typed verbatim from the tutorial.


I am at a loss as how to fix this . Please help.

Gary R.

--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/cc6df283-797a-64c3-bf3f-78aac9c80616%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: Inconsistent dedent error

2016-06-23 Thread Gary Roach

On 06/23/2016 02:41 PM, Erik Cederstrand wrote:

Den 23. jun. 2016 kl. 21.21 skrev Gary Roach :

class Choice(models.Model):
question = models.ForeignKey(Question, on_delete=models.CASCADE)
choice_text = models.CharField(max_length=200)
votes = models.IntegerField(default=0)

def _str__(self):
return self.choice_text

The last entry (def __str__(self): throws an error "inconsistent dedent at line 
 I can find nothing wrong.

The error is actually in the line above. Your field definitions are 7-space 
indented when they should only be 3- or 4-space indented.

Python requires you to have consistent indenting, preferably 4 spaces per every 
indentation level. Your editor should help you with that. See 
https://www.python.org/dev/peps/pep-0008/#indentation

Erik


Thanks,

Another pair of eyes never hurts.

Gary R.

--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/00e864c5-6f91-3c05-0635-861e80096768%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: python manage.py runserver error

2016-06-24 Thread Gary Roach

Hi Saranyoo

I noticed that you are using python 2.7 with django 1.9.7. I would check 
the django docs to see whether the two are compatible. You may want to 
switch to Python 3.5.. If you are in the manage.py directory when you 
fired off runserver it should have worked.


Gary R.

On 06/23/2016 06:56 PM, Saranyoo Tiaakekalap wrote:

Guys - I am new to django, need some advise .
I am trying to learn how to use django from official web, while I am 
running through step by step .


Just the beginning of the first step while I try to start server I hit 
into issue .

There is no change in any python after start project .
Appreciate all the advice .

[root@jpetetis mysite]# python manage.py runserver
Performing system checks...

System check identified no issues (0 silenced).
Unhandled exception in thread started by 0x2b75ba622500>

Traceback (most recent call last):
  File 
"/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/utils/aut 
   oreload.py", line 226, in wrapper

fn(*args, **kwargs)
  File 
"/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/core/mana 
   gement/commands/runserver.py", line 117, in 
inner_run

self.check_migrations()
  File 
"/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/core/mana 
   gement/commands/runserver.py", line 163, in 
check_migrations

executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
  File 
"/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/migrat 
   ions/executor.py", line 20, in __init__

self.loader = MigrationLoader(self.connection)
  File 
"/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/migrat 
   ions/loader.py", line 49, in __init__

self.build_graph()
  File 
"/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/migrat 
   ions/loader.py", line 176, in build_graph

self.applied_migrations = recorder.applied_migrations()
  File 
"/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/migrat 
   ions/recorder.py", line 65, in 
applied_migrations

self.ensure_schema()
  File 
"/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/migrat 
   ions/recorder.py", line 56, in ensure_schema

with self.connection.schema_editor() as editor:
  File 
"/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/backen 
   ds/sqlite3/schema.py", line 25, in __enter__

self._initial_pragma_fk = c.fetchone()[0]
TypeError: 'NoneType' object has no attribute '__getitem__'


--
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+unsubscr...@googlegroups.com 
.
To post to this group, send email to django-users@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/CAF7bBPAP5cqVpqt824ub4kh76podidLKRZnxFrVKtHQzr4D%2BCw%40mail.gmail.com 
.

For more options, visit https://groups.google.com/d/optout.



--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/c44a8ff3-27a7-64f9-5ee2-a80d1001c03d%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Using the Eclipse mysite>django>custom command(manage.py$(custom_command)) function

2016-06-25 Thread Gary Roach

Hi all:

OS Debian Stretch
KDE Desktop

I am using Eclipse Neon with the PyDev plugin for developing a django 
application. At present I am running through the djangoproject 
tutorial.The tutorial has me run:

python manage.py createsuperuser
I want to run this within Eclipse and not the system command line. Right 
clicking on the project title and following the sub menus I get to the:
	mysite>django>custom command(manage.py$(custom_command)) function. I 
can't seem to figure  out how to use this. It is the only thing I could 
find that looks like it is meant to replace the system command line.


In general, any time I have to use manage.py and there is not a specific 
menu item for the process, I'm awash.


Any elucidation on this point will be sincerely appreciated.

Gary R.

--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/d9eba089-965f-46cf-7c38-f97af2d17aa8%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: install with package manager or pip

2016-06-25 Thread Gary Roach

On 06/25/2016 12:35 PM, emetib wrote:
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?
--
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+unsubscr...@googlegroups.com 
.
To post to this group, send email to django-users@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.


--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/89dd17b4-50b9-5e07-f3d1-d02b29297f52%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: Using the Eclipse mysite>django>custom command(manage.py$(custom_command)) function

2016-06-25 Thread Gary Roach
i did as you suggested and tried it with runserver. It worked. I tried 
the same thing with createsuperuser and got the errror: Superuser 
creation skipped due to not running in a TTY.


Since I am setting up the sqlite dbms, does it make any difference if I 
run the thing inside Eclipse vs cd to mysite.manage.py and run things 
from the system monitor command line?


Gary R.

On 06/25/2016 01:55 PM, Ilya Boka wrote:

Click add. Enter your command( Ex: "runserver"). Click OK. Double
click to run this.

On Sat, Jun 25, 2016 at 10:07 PM, Gary Roach  wrote:

Hi all:

OS Debian Stretch
KDE Desktop

I am using Eclipse Neon with the PyDev plugin for developing a django
application. At present I am running through the djangoproject tutorial.The
tutorial has me run:
 python manage.py createsuperuser
I want to run this within Eclipse and not the system command line. Right
clicking on the project title and following the sub menus I get to the:
 mysite>django>custom command(manage.py$(custom_command)) function. I
can't seem to figure  out how to use this. It is the only thing I could find
that looks like it is meant to replace the system command line.

In general, any time I have to use manage.py and there is not a specific
menu item for the process, I'm awash.

Any elucidation on this point will be sincerely appreciated.

Gary R.

--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/d9eba089-965f-46cf-7c38-f97af2d17aa8%40verizon.net.
For more options, visit https://groups.google.com/d/optout.



--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/88d4a6cf-19d7-6d54-b1da-320a55641ebc%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


def__str__(self) not working properly

2016-07-01 Thread Gary Roach

Hi all;

I am working on the official django tutorial 
(https//docs.djangoproject.com/en/1.9/intro/tutorial/02/) on the section 
that is adding the choices. Specifically:



# Create three choices.
>>> q.choice_set.create(choice_text='Not much', votes=0)

>>> q.choice_set.create(choice_text='The sky', votes=0)

>>> c = q.choice_set.create(choice_text='Just hacking again', votes=0)

The "Not much" entry should return  but returns 
 instead.


This would seem to be a problem with the models.py def__str__(self) 
call, but I can't locate the problem. Question class works fine. The 
specific code is :


import datetime

from django.db import models
from django.utils import timezone


class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')

def __str__(self):
return self.question_text

def was_published_recently(self):
return self.pub_date >= timezone.now()- 		 
datetime.timedelta(days=1)



class Choice(models.Model):
question = models.ForeignKey(Question, on_delete=models.CASCADE)
choice_text = models.CharField(max_length=200)
votes = models.IntegerField(default=0)

def __str__(self):
return self.choice_text

OS Debian Stretch
KDE Desktop
Django 1.9
python 3.5
Eclipse PyDev IDE

All migrations are up to date.

Any help will be sincerely appreciated.

Gary R.

--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/3219730a-2d8b-ee3b-3374-72c64ccd3a8e%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: def__str__(self) not working properly

2016-07-03 Thread Gary Roach

Yes it is

Gary R

On 07/03/2016 06:25 AM, Charlie c wrote:


The line is indented 4 spaces yes?


On Friday, July 1, 2016 at 10:52:12 AM UTC+1, gary719_list1 wrote:

Hi all;

I am working on the official django tutorial
(https//docs.djangoproject.com/en/1.9/intro/tutorial/02/
) on the
section
that is adding the choices. Specifically:


# Create three choices.
 >>> q.choice_set.create(choice_text='Not much', votes=0)

 >>> q.choice_set.create(choice_text='The sky', votes=0)

 >>> c = q.choice_set.create(choice_text='Just hacking again',
votes=0)

The "Not much" entry should return  but returns
 instead.

This would seem to be a problem with the models.py def__str__(self)
call, but I can't locate the problem. Question class works fine. The
specific code is :

import datetime

from django.db import models
from django.utils import timezone


class Question(models.Model):
 question_text = models.CharField(max_length=200)
 pub_date = models.DateTimeField('date published')

 def __str__(self):
 return self.question_text

 def was_published_recently(self):
 return self.pub_date >= timezone.now()-
datetime.timedelta(days=1)


class Choice(models.Model):
 question = models.ForeignKey(Question, on_delete=models.CASCADE)
 choice_text = models.CharField(max_length=200)
 votes = models.IntegerField(default=0)

 def __str__(self):
 return self.choice_text

OS Debian Stretch
KDE Desktop
Django 1.9
python 3.5
Eclipse PyDev IDE

All migrations are up to date.

Any help will be sincerely appreciated.

Gary R.

--
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+unsubscr...@googlegroups.com 
.
To post to this group, send email to django-users@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/a395e712-f38b-450f-a9ba-bff30497cfea%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.



--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/dbfceaeb-65c0-53db-c6f0-3194b095d7b0%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


resetting table id

2016-07-03 Thread Gary Roach

Hi all


I'm still working on the official django tutorial 
(https//docs.djangoproject.com/en/1.9/intro/tutorial/02/) on the section 
that is adding the Question table.


I'm using Eclipse Neon with PyDev IDE
Django 1.9
Pyathon 3.5
SqLite DBMS
OS Debian Stretch Linux
KDE Desktop

While working with the database API I have managed to run the 
auto-increment field up and can't find a way to reset it. Does anyone 
know how to do this. There are a lot of suggestions out there but I have 
yet to find one that works.


Gary R.

--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/1e80142d-5bda-ffca-123b-2b311357c248%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: resetting table id (SOLVED)

2016-07-03 Thread Gary Roach

On 07/03/2016 04:54 PM, James Schneider wrote:



On Jul 3, 2016 4:18 PM, "Gary Roach" <mailto:gary719_li...@verizon.net>> wrote:

>
> Hi all
>
>
> I'm still working on the official django tutorial 
(https//docs.djangoproject.com/en/1.9/intro/tutorial/02/ 
<http://docs.djangoproject.com/en/1.9/intro/tutorial/02/>) on the 
section that is adding the Question table.

>
> I'm using Eclipse Neon with PyDev IDE
> Django 1.9
> Pyathon 3.5
> SqLite DBMS
> OS Debian Stretch Linux
> KDE Desktop
>
> While working with the database API I have managed to run the 
auto-increment field up and can't find a way to reset it. Does anyone 
know how to do this. There are a lot of suggestions out there but I 
have yet to find one that works.

>

That's a bit surprising. A quick Google search points at resetting the 
proper values in the sqlite_sequence table.


Other options:
You can drop the table and recreate it.
You can drop the database and recreate it.

Obviously those options can have detrimental effects on your data.

The better question is why would you?

The autoincrement fields for columns are meant to be autonomous and 
guaranteed unique. Toying with those values can and will lead to data 
inconsistencies. That's why there isn't a 'simple' way to reset that 
counter.


If you're only doing it to keep the numbers low while you're 
developing, it really isn't worth it. You'll quickly reach a point 
where it is not feasible to drop all of the data and start over, and 
you need to ensure your dev environment is as close to production as 
it can be.


-James



Thanks for the return.

Normally I would agree that messing around with the auto-increment is a 
bad idea. But I am working with the tutorial and found the mismatch on 
id's to be a bit of a distraction. Was the reset necessary, No. I did 
learn a lot in the process though. I finally found $echo "" > db.sqlite3 
completely zeroed out the file and running the makemigrations an migrate 
restored everything original condition. All of this drove home the fact 
that db.sqlite3 is no more than a text file and can be thrown away and 
recreated any time I like. This might be handy in the future.


Thanks again.
Gary R.

--
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+unsubscr...@googlegroups.com 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto:django-users@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/CA%2Be%2BciXLFxY8Gm_Wo1%2BftkDmiW9LB65Rs67Z1Cau1wa%3DMyPhwA%40mail.gmail.com 
<https://groups.google.com/d/msgid/django-users/CA%2Be%2BciXLFxY8Gm_Wo1%2BftkDmiW9LB65Rs67Z1Cau1wa%3DMyPhwA%40mail.gmail.com?utm_medium=email&utm_source=footer>.

For more options, visit https://groups.google.com/d/optout.



--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/247f4e0f-6b6d-b388-fd47-144c887c1207%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


ValueError: invalid literal for int() with base 10: 'on'

2016-07-08 Thread Gary Roach

Hi all,

I'm working on the official django 1.9 tutorial part 4 , Python 3.5 and 
Django 1.9 are encapsulated in a virtualenv file in my /opt/ directory.


OS Debian Linux with KDE desktop

IDE Eclipse with PyDev plugin.

Every time I try to vote the program errors out with the following:

  File 
"/opt/python-virtual-environments/py3.5dj1.9.7/lib/python3.5/site-packages/django/db/models/fields/__init__.py", 
line 976, in get_prep_value

return int(value)
ValueError: invalid literal for int() with base 10: 'on'
[07/Jul/2016 16:21:41] "POST /polls/1/vote/ HTTP/1.1" 500 120688

*The code at line 976 is:*

def get_prep_value(self, value):
value = super(AutoField, self).get_prep_value(value)
if value is None:
return None
return int(value)

*My project layout is:*

mysite

src

mysite

...

settings.py

urls.py

wsgi.py

polls

migrations

templates

polls

detail.html

index.html

results.html

admin.py

apps.py

models.py

urls.py

views.py

db.sqlite3

manage.py



*My mysite.settings file Installed apps looks like:*

INSTALLED_APPS = [
'polls.apps.PollsConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]

*My polls.views file is :*

#Include any python library functions you wish.

from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404, render
from django.core.urlresolvers import reverse


from polls.models import Choice, Question


def index(request):
latest_question_list = Question.objects.order_by('-pub_date')[:5]
context = {'latest_question_list': latest_question_list }
return render(request, 'polls/index.html', context)

def detail(request, question_id):
question = get_object_or_404(Question, pk=question_id)
return render(request, 'polls/detail.html', {'question': question})


def results(request, question_id):
question = get_object_or_404(Question, pk=question_id)
return render(request, 'polls/results.html', {'question':question})


def vote(request, question_id):
question = get_object_or_404(Question, pk=question_id)
try:
selected_choice = question.choice_set.get(
  pk=request.POST['choice'])
except (KeyError, Choice.DoesNotExist):
return render(request, 'polls/detail.html',
  {'question': question, 'error_message':
   "You didn't select a choice.",}
  )
else:
selected_choice.votes += 1
selected_choice.save()
return HttpResponseRedirect(reverse('polls:results',
   args=(question.id,)))

*The polls,detail.html is:*

{{ question.question_text }}

{% if error_message %}{{ error_message }}
{% endif %}


{% csrf_token %}

{% for choice in question.choice_set.all %}


{{ choice.choice_text }}
{% endfor %}





I am not very familiar with the Eclipse PyDev debugger and can't seem to 
find the problem. Any help will be sincerely appreciated.


Gary R.


--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/5ea0dbd8-f080-7d03-eaab-428a2e117cd1%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: ValueError: invalid literal for int() with base 10: 'on'

2016-07-08 Thread Gary Roach

On 07/08/2016 04:58 PM, James Schneider wrote:


> The polls,detail.html is:
>
> {{ question.question_text }}
>
> {% if error_message %}{{ error_message }}
> {% endif %}
>
> http://question.id> 
%}" method="post">

> {% csrf_token %}
>
> {% for choice in question.choice_set.all %}
>  id="choice{{forloop.counter }}"
> value"{{ choice.id  }}" />

It looks like your value attribute is missing an equals (=) sign. I 
think that the value is set to 'on' if the box is selected by the user 
and you haven't specified a value attribute.


If that's not it, can you post the entire traceback? This is an error 
from within the Django framework itself, likely from receiving a str 
value when it was expecting an int. The full traceback will hopefully 
tell us what portion of your code made the initial call.


-James


Thank you.

I mistyped the code string. and left out the = sign.. Things work as 
they should now. I guess I need to be a little more careful when 
proofing my code.


Thanks again

Gary Rl


--

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+unsubscr...@googlegroups.com 
.
To post to this group, send email to django-users@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/CA%2Be%2BciWu76QWG4WTzr57T3euwRvi1eDwfFiUAT9q1wiWDSiP1Q%40mail.gmail.com 
.

For more options, visit https://groups.google.com/d/optout.



--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/ffd16516-6d2e-2597-f516-85eb6c4c96f6%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Error in testing script

2016-07-10 Thread Gary Roach

Hi all;

OS Debian Linux KDE desktop
Django 1.9
Python 3.5

Working with tutorial
https://docs.djangoproject.com/en/1.9/intro/tutorial05/
Writing polls/tests.py script

I am consistently getting an error:
NameError: name 'create_question' is not defined.

The first section of tests.py to throw this error is:
def test_index_view_with_two_past_questions(self):
"""
The questions index page may display multiple questions.
"""
create_question(question_text="Past question 1.", days=-30)
create_question(question_text="Past question 2.", days=-5)
response = self.client.get(reverse('polls:index'))
self.assertQuerysetEqual(
response.context['latest_question_list'],
['', '1.>']

)

The code example is in class QuestionMethodTests(TestCase): but is 
flagged 8 times by the editor throughout the code in test.py. The same 
error pops at run time.


The code seems to be identical to the code in the tutorial.

All of the errors occur on code lines like:
create_question(question_text=" ...

All help will be appreciated.

Gary R.

--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/9aae93a5-daab-9f76-c8a5-8df9665cecb8%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: Error in testing script

2016-07-10 Thread Gary Roach

On 07/10/2016 01:57 PM, Gary Roach wrote:

Hi all;

OS Debian Linux KDE desktop
Django 1.9
Python 3.5

Working with tutorial
https://docs.djangoproject.com/en/1.9/intro/tutorial05/
Writing polls/tests.py script

I am consistently getting an error:
NameError: name 'create_question' is not defined.

The first section of tests.py to throw this error is:
def test_index_view_with_two_past_questions(self):
"""
The questions index page may display multiple questions.
"""
create_question(question_text="Past question 1.", days=-30)
create_question(question_text="Past question 2.", days=-5)
response = self.client.get(reverse('polls:index'))
self.assertQuerysetEqual(
response.context['latest_question_list'],
['', '1.>']

)

The code example is in class QuestionMethodTests(TestCase): but is 
flagged 8 times by the editor throughout the code in test.py. The same 
error pops at run time.


The code seems to be identical to the code in the tutorial.

All of the errors occur on code lines like:
create_question(question_text=" ...

All help will be appreciated.

Gary R.

I missed something. The create_question call is a def defined earlier in 
the class.


def create_question(question_text, days):
"""
Creates a question with the given `question_text` and published the
given number of `days` offset to now (negative for questions 
published

in the past, positive for questions that have yet to be published).
"""
time = timezone.now() + datetime.timedelta(days=days)
return Question.objects.create(question_text=question_text,
pub_date=time)

this code throws an error : Method 'create_question - polls.tests' 
should have self as first parameter.


Here again, the code seems to be identical to that in the tutorial. 
Adding self to the def clears this problem but does not clear the rest 
of the errors. The def doesn't seem to be working.


Gary R

--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/16e9912e-6669-939e-87d9-7f5588306923%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: Error in testing script

2016-07-11 Thread Gary Roach

On 07/10/2016 11:19 PM, Michal Petrucha wrote:

On Sun, Jul 10, 2016 at 02:25:40PM -0700, Gary Roach wrote:

On 07/10/2016 01:57 PM, Gary Roach wrote:

Hi all;

OS Debian Linux KDE desktop
Django 1.9
Python 3.5

Working with tutorial
https://docs.djangoproject.com/en/1.9/intro/tutorial05/
Writing polls/tests.py script

I am consistently getting an error:
NameError: name 'create_question' is not defined.

The first section of tests.py to throw this error is:
def test_index_view_with_two_past_questions(self):
"""
The questions index page may display multiple questions.
"""
create_question(question_text="Past question 1.", days=-30)
create_question(question_text="Past question 2.", days=-5)
response = self.client.get(reverse('polls:index'))
self.assertQuerysetEqual(
response.context['latest_question_list'],
['', '']
)

The code example is in class QuestionMethodTests(TestCase): but is flagged
8 times by the editor throughout the code in test.py. The same error pops
at run time.

The code seems to be identical to the code in the tutorial.

All of the errors occur on code lines like:
create_question(question_text=" ...

All help will be appreciated.

Gary R.


I missed something. The create_question call is a def defined earlier in the
class.

 def create_question(question_text, days):
 """
 Creates a question with the given `question_text` and published the
 given number of `days` offset to now (negative for questions
published
 in the past, positive for questions that have yet to be published).
 """
 time = timezone.now() + datetime.timedelta(days=days)
 return Question.objects.create(question_text=question_text,
 pub_date=time)

this code throws an error : Method 'create_question - polls.tests' should
have self as first parameter.

Here again, the code seems to be identical to that in the tutorial. Adding
self to the def clears this problem but does not clear the rest of the
errors. The def doesn't seem to be working.

Gary R

The code snippet in the tutorial does not put ``create_question``
inside the ``QuestionViewTests`` class, but rather at module level.
That makes a difference.

The way it is written in the tutorial, ``create_question`` is just a
global function that you can call from anywhere as it is.

If you put the ``def`` statement inside the class, that means you are
defining a method in that class, in which case you have to treat it as
such. Unless you decorate it as a static method, or a class method,
you can only call it on an instance of that class, and, just like any
other method in Python, will need to take the class instance as its
first argument, most commonly called ``self``.

Does this help clear it up at least a little bit?

Good luck,

Michal


Thanks Michal

I didn't catch that the def statement was shifted to the left margin. 
Works fine now.


Gary R

--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/589a8274-8f98-2d86-c57f-ef30715559b6%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Document storage and data mining

2016-07-14 Thread Gary Roach

Hi all;

I have finished most of the official Django tutorial, have started 
fooling around with my actual project and have realized that I'm not 
sure how to start. My projects initial objectives are as follows:


Photos of the pages of a document are aggregated into a single pdf file 
for those who wish to view the original document. An rtf transcript of 
the document is include for readability and a txt transcript is included 
for global searches. A metafile is included - part of which will be 
generated by the program - to facilitate key word searches. I wish to be 
able to search documents - probably by key word - and then pull up the 
document set by document key. No changes to the documents will be 
allowed after they have been loaded into the database. At present, my 
main objective is to get the documents into the database in retrievable 
form.


While - with the exception of the metafile - these are static files, we 
are talking about hundreds of documents. I do not think that storing 
them as static files will work. They have to be searchable. I assume 
that I need a model that will set up appropriate fields in the database 
(postgresql) This is where I stumble. I've looked at the Model.field 
reference but can't seem to come up with what I need or don't know what 
I'm looking at. The latter being the most probable.


If someone  could point me in the right direction or to documentation 
that would help; it would be sincerely appreciated.


Gary R.

--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/bd99bc90-e65b-1705-9392-3fac0e316ef3%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


cookiecutter-django installation

2016-08-01 Thread Gary Roach
I am having trouble with a cookiecutter-django installation. I don't 
have a normal virtualenv setup because I use Eclipse IDE with PyDev 
plugin. This means that all of the project files are outside of the 
virtualenv wrapper and vrtualenv is never actually activated. My OS is 
Debian Linux with KDE desktop. I have my virtualenv files in the 
/opt/python-virtual-environments/ directory. Eclipse requires me to work 
out of a workspace directory which is at /home/gary/workspace. I then 
point Eclipse at the /opt/python-virtual-environments/ directory for the 
proper versions of python and django.


I can't figure out how to use cookiecutter-django with the above 
installation. Could anyone that uses PyDev give me some advice or point 
me to some more pertinent documentation for the installation.


Gary R.

--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/62479cd9-99aa-ca5e-1d67-0872549e7c5f%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: cookiecutter-django installation

2016-08-02 Thread Gary Roach

On 08/01/2016 10:39 PM, Constantine Covtushenko wrote:
Hi Constantine

I guess I didn't make my self clear. I have not installed 
cookiecutter-debian because I haven't figured out how to do that with my 
setup. There are no errors because there is no installation.,


Gary Rl


Hi Gary,

It is not clear what errors you have gotten.
Can you please describe them?

I am not using Eclipse any more so can not reproduce you problem by my 
own.

But all should be run without problem

On Mon, Aug 1, 2016 at 11:14 PM, Gary Roach <mailto:gary719_li...@verizon.net>> wrote:


I am having trouble with a cookiecutter-django installation. I
don't have a normal virtualenv setup because I use Eclipse IDE
with PyDev plugin. This means that all of the project files are
outside of the virtualenv wrapper and vrtualenv is never actually
activated. My OS is Debian Linux with KDE desktop. I have my
virtualenv files in the /opt/python-virtual-environments/
directory. Eclipse requires me to work out of a workspace
directory which is at /home/gary/workspace. I then point Eclipse
at the /opt/python-virtual-environments/ directory for the proper
versions of python and django.

I can't figure out how to use cookiecutter-django with the above
installation. Could anyone that uses PyDev give me some advice or
point me to some more pertinent documentation for the installation.

Gary R.

-- 
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+unsubscr...@googlegroups.com
<mailto:django-users%2bunsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com
<mailto:django-users@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/62479cd9-99aa-ca5e-1d67-0872549e7c5f%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


--
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+unsubscr...@googlegroups.com 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto:django-users@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/CAK52boUUJRk2AmzL98ExkbiTdfUSaBYGLGY1hzf5_3%3DW6mhWvQ%40mail.gmail.com 
<https://groups.google.com/d/msgid/django-users/CAK52boUUJRk2AmzL98ExkbiTdfUSaBYGLGY1hzf5_3%3DW6mhWvQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.

For more options, visit https://groups.google.com/d/optout.



--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/a97caed8-4a20-1e26-e9a2-441d726bb249%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: Web based IDE for django

2016-08-15 Thread Gary Roach
While I haven't used it Two Scoops recommends cookiecutter. My reading 
leads me to believe that it may be what you are looking for.


Gary R.

On 08/15/2016 02:44 PM, billyhu...@gmail.com wrote:
Thanks for your advice. I have to say thats not what the question was. 
What you are saying is a hosting environment. What I am asking is the 
development environment. Completely different. Looking for a browser 
based IDE that is much user friendly than having it shell based way of 
coding.


On Monday, August 15, 2016 at 4:52:08 PM UTC-4, Ari Davidow wrote:

I think you can get a lot of what you're looking for with
PythonAnywhere's support for
Django--https://www.pythonanywhere.com/
 . try the free version and see
if that moves you in the right direction?

ari

On Mon, Aug 15, 2016 at 4:47 PM, > wrote:

New in django so here is the question: Is there a web based
IDE for django where the environments are set up and all we
focus on the creating models, view and control? It seems most
of my time is spend creating url, import this, import that,
put middleware, 90% of the time is spend worrying about the
framework that actually doing the work. Its 2016 and its still
seems like going back in time with the framework where
everything is very manual driven.
-- 
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/c4d176a6-6d96-41cc-b571-f95c3e4f39b6%40googlegroups.com

.
For more options, visit https://groups.google.com/d/optout
.


--
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+unsubscr...@googlegroups.com 
.
To post to this group, send email to django-users@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/f8bca7ad-3133-458c-8d9a-b36726ff99e0%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.



--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/bc2eb42d-f318-9ac5-9611-1e8a9c0f383c%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Serving very large pdf files with django

2016-09-03 Thread Gary Roach

Hi all,

I am working on a project where I need to serve up large (100 -150 MB) 
static pdf files for viewing. The pdf files are jpg photos of pages from 
old log books. Downloading into the user's system is out of the question 
for obvious reasons. In addition the user may only need to see one or 
two pages out of a document. I plan on putting the static files in their 
own directory outside of the django programming and the postgresql 
database. I have looked at several addons to django but can't seem to 
get a "feel" for the whole problem. Has anyone had a similar problem and 
do they have a good solution .


All help will be sincerely appreciated.

OS Debian Linux
Desktop KDE4
Python 3.5
Django 1.9.x

Gary R.

--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/b5e154b5-3c01-6f39-f4a1-6e285093aa45%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: Serving very large pdf files with django

2016-09-05 Thread Gary Roach

Thanks you all for you contributions

I have decided to break down the pdf files into individual jpg pages and 
serve them that way. I plan on putting each document in its own folder 
and then have the individual pages listed within the folder. I haven't 
worked out the exact retrieval scheme yet but it will probably be 
something like:


Documents
Document 1
;:
;jpg 1
::
:   jpg n
;
Document n

This should work and allow fast recovery.

Thanks again for your help

Gary R


On 09/04/2016 05:37 AM, Avraham Serour wrote:
if you need to server the pdf then it will be downloaded to the user 
computer, even if you are visualizing in browser with js.


What you can do is show screenshots of the pdf pages, then you would 
be serving individual jpgs for each page and not a single 100mb file.


You can create previews for each page using something like imagemagick 
as mentioned before and create a layout to view that using django 
template.




On Sun, Sep 4, 2016 at 9:52 AM, <06use...@gmail.com 
> wrote:


Hello,

Maybe you could use ImageMagick to show one page of the pdf as an
image ? This is what I have implemented on my project : first page
of pdf files can be pre-viewed before user uploads the whole file
(if needed). In your case, pre-viewing could be parametrized to
show page ‘n’ of the pdf file, probably. In my project,
pre-viewing image is generated when pdf file is uploaded and saved
by admin in myproject/media/files directory. Once pdf files are in
media directory, users can preview those pdf files and tnen upload
them, if needed (only first page can be pre-viewed by user. This
is an implementation choice).


http://www.imagemagick.org/script/index.php





Implementation principles/credit can be found here :

http://www.yaconiello.com/blog/auto-generating-pdf-covers/





I am attaching the signals file_post_save file_pre_save, for
information.


Cheers.

Django 1.8
Python 3.4


Note : to install ImageMagick:

sudo apt-get install libmagickwand-dev imagemagick libmagickcore-dev

The convert command allows to convert any page of pdf file into
png image (for instance), eg :

convert -thumbnail 1280 test.pdf[0] test_1280.png
Several parameters exist to tune image quality (in my case, need
to use density, trim and quality).

*models.p**y*

[…]

###

# SIGNALS #

###

from django.db.models.signals import post_save, pre_delete

from django.dispatch import receiver

from myproject.settings import MEDIA_ROOT

import subprocess


# What to do after a File is saved - receiver definition

def file_post_save(sender, instance=False, **kwargs):

# This post save function creates a thumbnail for the File

file = File.objects.get(pk=instance.pk )

command = "convert -density 300 -trim -thumbnail %s %s%s[0]
-quality 100 %s%s" % (file.thumbnail_size, MEDIA_ROOT, file.file,
MEDIA_ROOT, file.thumbnail)

proc = subprocess.Popen(command,

shell=True,

stdin=subprocess.PIPE,

stdout=subprocess.PIPE,

stderr=subprocess.PIPE,

)

stdout_value = proc.communicate()[0]

post_save.connect(file_post_save, sender=File,
dispatch_uid="file_post_save_uid")

# What to do before a File is deleted - receiver definition

def file_pre_delete(sender, instance=False, **kwargs):

# This pre delete function deletes file and thumbnail from media
directory

file = File.objects.get(pk=instance.pk )

command = "rm %s%s %s%s" % (MEDIA_ROOT, file.file, MEDIA_ROOT,
file.thumbnail)

proc = subprocess.Popen(command,

shell=True,

stdin=subprocess.PIPE,

stdout=subprocess.PIPE,

stderr=subprocess.PIPE,

)

stdout_value = proc.communicate()[0]

pre_delete.connect(file_pre_delete, sender=File,
dispatch_uid="file_pre_delete_uid")

-- 
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+unsubscr...@googlegroups.com
.
To post to this group, send email to django-users@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/e409aafa-3133-47b1-b465-7d74501d0cac%40googlegroups.com

Re: [Help] Advanced tutorial: How to install my Python package with Virtualenv

2016-09-27 Thread Gary Roach

Hi

It took me a while to figure this  out but once you see it it is really 
fairly simple. It somewhat depends on what you are using for and IDE 
(Integrated Development Environment). I use Eclipse with PyDev plugin 
and like it.


Determine where you want to put your VE (Virtual Envirnment) . With 
Eclipse everything works out of the directory "workspace". Workspace can 
be anywhere on your system but, I find it works best in your home 
directory. If you are not using Eclipse then your working directory can 
be just about anywhere you choose.


Assuming that you have installed virtualenv or venv and 
virtualenvwrapper ( if on linux. Not sure about windows) you have a 
choice of what to do next. If you plan on using one of the standard text 
editors you will want put your whole project inside of the VE. If using 
something like Eclipse install the VE in a subdirectory in your 
workspace. Remember that the main purpose of a VE is to wall off 
packages such as Python and Django from the rest of your system. Use pip 
to install these packages into the VE using what ever versions are 
appropriate for your project.


If you are not using an IDE then you have your whole project inside the 
VE.Just turn on the VE  and you are set to go. If you are using an IDE 
then it depends on the IDE but generally you will reference the 
appropriate files in the VE when you set up your project. You do not 
have to activate the  VE under these circumstances. The VE is just a 
repository of the proper versions of the packages that you need for your 
project.


Hope this helps.

Gary R

On 09/27/2016 10:26 AM, Bill Freeman wrote:
You don't say what OS/platform you are using, and I don't know if what 
I say below applies to Windows, but should be valid elsewhere.


Note, too, that I presume that you are using a command line (e.g.; 
xterm/bash).


I also presume that you have managed to install virtualenv on your system.

If  your virtualenv is activated (see virtualenv documentation), and 
you should activate it when working on your project, then just saying


   pip

should be enough.  Try saying

   which pip

if that works at all, it should report a pip withing the bin directory 
of your virtualenv.  On the other hand, if it reports the pip in a 
system directory, then your virtualenv has not been activated, or 
somethign is broken.


On Tue, Sep 27, 2016 at 7:19 AM, Aline C. R. Souza 
mailto:linecrso...@gmail.com>> wrote:


Hello Guys,

I need some help to install my Python package with virtualenv. I
follow the 'Advanced tutorial: How to write reusable apps'
and moved the polls directory out of the project. Now I want to
install my package using virtualenv and pip, but I don't know how.

Consider I am inside of my project diretory (where the manage.py
is) and I am working on a virtual environment. What would be the
right pip command to install my package, considering that
the polls directory is out of the project.

Please help!




-- 
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+unsubscr...@googlegroups.com
.
To post to this group, send email to django-users@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/bb3167a4-61c3-4006-994d-c2b226636401%40googlegroups.com

.
For more options, visit https://groups.google.com/d/optout
.


--
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+unsubscr...@googlegroups.com 
.
To post to this group, send email to django-users@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/CAB%2BAj0uCXn04qjasaqYpwfRYRTtmk_jztTH1KXCgmc5%2BmOyLUw%40mail.gmail.com 
.

For more options, visit https://groups.google.com/d/optout.



--
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+unsubscr...

Django can't find database

2016-10-22 Thread Gary Roach

Hi all,

Debian System, stretch, 64 bit. KDE4 Desktop
Django 1.10
Postgresql 9.6 with psycopg2



When I try to migrate, I get the following  error:


Traceback (most recent call last):
  File 
"/home/gary/workspace/djenv/lib/python3.5/site-packages/django/db/backends/base/base.py",
 line 199, in ensure_connection
self.connect()
  File 
"/home/gary/workspace/djenv/lib/python3.5/site-packages/django/db/backends/base/base.py",
 line 171, in connect
self.connection = self.get_new_connection(conn_params)
  File 
"/home/gary/workspace/djenv/lib/python3.5/site-packages/django/db/backends/postgresql/base.py",
 line 175, in get_new_connection
connection = Database.connect(**conn_params)
  File 
"/home/gary/workspace/djenv/lib/python3.5/site-packages/psycopg2/__init__.py", 
line 164, in connect
conn = _connect(dsn, connection_factory=connection_factory, async=async)
psycopg2.OperationalError: FATAL:  database "archivedb" does not exist


My settings file looks like this:


DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'archivedb',
'USER': 'gary',
'PASSWORD': 'zzyyxx',  # WARNING If they get this far I'm screwed anyway
'HOST': 'localhost',
'PORT': '5432',
}
}


My pgAdminIII Object Browser:

See attachment Spectacl.
And SQL Pane for Gary:

> CREATE ROLE gary LOGIN
>   ENCRYPTED PASSWORD 'md5772cde60e4a04dc0cb7268674810bf03'
>   SUPERUSER INHERIT CREATEDB CREATEROLE REPLICATION;

The pg_hba.conf file at /etc/postgresql/9.6/main   is:


# Database administrative login by Unix domain socket
local   all postgrestrust

# TYPE  DATABASEUSERADDRESS METHOD

# "local" is for Unix domain socket connections only
local   all all trust
# IPv4 local connections:
hostall all 127.0.0.1/32trust
# IPv6 local connections:
hostall all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication postgrespeer
#hostreplication postgres127.0.0.1/32md5
#hostreplication postgres::1/128 md5


What's happening here?

Any help will be sincerely appreciated.

Gary R.







--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/fdaf6530-6b5d-8f63-06c1-d63cca2296b2%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: Django can't find database

2016-10-22 Thread Gary Roach



psql -U gary -d archivedb gives:
FATAL:  Peer authentication failed for user "gary"
which probably means that psql can't find the database either.

My process table ( ps -xaf) shows:
642 ?S  0:07 /usr/lib/postgresql/9.6/bin/postgres -D 
/var/lib/postgresql/9.6/main -c 
config_file=/etc/postgresql/9.6/main/postgresql.conf

  754 ?Ss 0:00  \_ postgres: 9.6/main: checkpointer process
  755 ?Ss 0:04  \_ postgres: 9.6/main: writer process
  756 ?Ss 0:04  \_ postgres: 9.6/main: wal writer process
  757 ?Ss 0:04  \_ postgres: 9.6/main: autovacuum launcher 
process
  758 ?Ss 0:05  \_ postgres: 9.6/main: stats collector 
process
  643 ?S  0:12 /usr/lib/postgresql/9.5/bin/postgres -D 
/var/lib/postgresql/9.5/main -c 
config_file=/etc/postgresql/9.5/main/postgresql.conf

  768 ?Ss 0:00  \_ postgres: checkpointer process
  772 ?Ss 0:11  \_ postgres: stats collector process
 6501 ?Ss 0:00  \_ postgres: postgres postgres [local] idle


So the database seems  to be running. No sure why there are two versions 
running but may be due to Debian using the older version of something. 
Is this a path problem?


Does this help

Gary R.


On 10/22/2016 01:13 PM, Vijay Khemlani wrote:

Can you connect to the database via command line?

psql -U gary -d archivedb

On Sat, Oct 22, 2016 at 3:48 PM, Jamie Lawrence <mailto:jalawre...@gmail.com>> wrote:



> On Oct 22, 2016, at 11:35 AM, Gary Roach
mailto:gary719_li...@verizon.net>> wrote:

> When I try to migrate, I get the following  error:
>
>> psycopg2.OperationalError: FATAL:  database "archivedb" does not exist


> What's happening here?

Are you certain the ‘archivedb’ database actually exists?

If it does, is in in an accessible schema?

If it is, is it in the cluster you’re connecting to in Django?

-j



--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/4016676a-9008-8b14-54ac-79d09806bb51%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Setting up jQuery in debian with virtualenv

2016-11-09 Thread Gary Roach

Hi all,

I am just starting to use jQuery and Ajax in my project and am having 
trouble setting things up.


I am using Eclipse + pyDev as an IDE. This setup stores everything in a 
workspace directory in my home directory. Instead of putting the whole 
project inside a virtualenv wrapper, things work better if the venv is 
external to the actual project files and the venv contents referenced in 
the Eclipse setup. In that venv file (djenv) there is the following:



/home/gary/workspace/djenv/lib/python3.5/site-packages/django/contrib/admin/static/admin/js/vendor/jquery/jquery.min.js



Now to the setup of my main html page. According to W3schools.com I 
should include one of the following in the html head section:



 




 or


 
https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js";>



Neither of these fit my situation. I don't have a separate 
jquery-3.1.1.min.js file and don't want to use the google source.


What I wish to know is can I use something like:
> 
> "djenv/lib/python3.5/site-packages/django/contrib/admin/static/admin/js/vendor/jquery/jquery.min.js"

>

or can I use just 

Re: Setting up jQuery in debian with virtualenv


Ludovic

Thank you for the reply but I know how to use static files. The problem 
is that I already have a jquery file under version control inside my 
virtual environment wrapper and do not wish to use an external file . 
Use of a normal static file will open my application up to uncontrolled 
version shifts. I want to know how to use the pip installed version of 
the jquery file if possible.


Gary R.

On 11/09/2016 01:41 PM, ludovic coues wrote:

Hello,

Django provide tools to deals with static files like javascript or
css. The documentation is at [1].

[1] https://docs.djangoproject.com/en/1.10/howto/static-files/

2016-11-09 21:26 GMT+01:00 Gary Roach :

Hi all,

I am just starting to use jQuery and Ajax in my project and am having
trouble setting things up.

I am using Eclipse + pyDev as an IDE. This setup stores everything in a
workspace directory in my home directory. Instead of putting the whole
project inside a virtualenv wrapper, things work better if the venv is
external to the actual project files and the venv contents referenced in the
Eclipse setup. In that venv file (djenv) there is the following:


/home/gary/workspace/djenv/lib/python3.5/site-packages/django/contrib/admin/static/admin/js/vendor/jquery/jquery.min.js



Now to the setup of my main html page. According to W3schools.com I should
include one of the following in the html head section:


  




  or


  
https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"</a>;>



Neither of these fit my situation. I don't have a separate
jquery-3.1.1.min.js file and don't want to use the google source.

What I wish to know is can I use something like:



Re: Setting up jQuery in debian with virtualenv


Hi,

Sorry about the confusion. I misspoke. I was trying to imply that there 
was a jquery.min.js file in the venv (djenv)  file. As you implied, it 
was installed with pip django. A very bad choice of words.


I am trying to set up my project so that I am not using a system version 
of jquery since the system version is subject to change every time I 
update my debian system (whiich I do about once a week). I suppose what 
I really want to know is how do I get a "sequestered" version of 
jquery.min.js installed.  I have tried to use a pointer to the copy in 
the djenv directory (Eclipse allows this).  After doing this there is a 
file jquery.min.sj shows up in my static file directory. Unfortunately, 
when I do a runserver I still get a - "GET /static/jquery.min.js 
HTTP/1.1" 404 1652 - error. What's next?


Gary R.

On 11/09/2016 11:56 PM, Antonis Christofides wrote:

Hi,

If, as you say, you "have a jquery file under version control inside [your]
virtual environment wrapper", I believe you are doing something wrong. We
normally don't put jquery files in virtualenv (although `pip install django`
will do so), and we normally do not version control the virtualenv.

If virtualenv is not clear to you, I'd propose to take a look at
http://djangodeployment.com/2016/11/01/virtualenv-demystified/ and then re-ask
your question.

Regards,

Antonis Christofides
http://djangodeployment.com

On 2016-11-09 23:54, Gary Roach wrote:

Ludovic

Thank you for the reply but I know how to use static files. The problem is
that I already have a jquery file under version control inside my virtual
environment wrapper and do not wish to use an external file . Use of a normal
static file will open my application up to uncontrolled version shifts. I want
to know how to use the pip installed version of the jquery file if possible.

Gary R.

On 11/09/2016 01:41 PM, ludovic coues wrote:

Hello,

Django provide tools to deals with static files like javascript or
css. The documentation is at [1].

[1] https://docs.djangoproject.com/en/1.10/howto/static-files/

2016-11-09 21:26 GMT+01:00 Gary Roach :

Hi all,

I am just starting to use jQuery and Ajax in my project and am having
trouble setting things up.

I am using Eclipse + pyDev as an IDE. This setup stores everything in a
workspace directory in my home directory. Instead of putting the whole
project inside a virtualenv wrapper, things work better if the venv is
external to the actual project files and the venv contents referenced in the
Eclipse setup. In that venv file (djenv) there is the following:


/home/gary/workspace/djenv/lib/python3.5/site-packages/django/contrib/admin/static/admin/js/vendor/jquery/jquery.min.js



Now to the setup of my main html page. According to W3schools.com I should
include one of the following in the html head section:


   



   or


   
https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"</a>;>



Neither of these fit my situation. I don't have a separate
jquery-3.1.1.min.js file and don't want to use the google source.

What I wish to know is can I use something like:



Re: Setting up jQuery in debian with virtualenv (SOLVED)


Thanks all,

I installed libjs-jquery into my active venv directory. It turns out 
that libjs-jquery actually has 3 different virsions in it . I copied the 
jquery.js  file over to my /static/ file in Eclipse. It works fine.


Gary R.

On 11/10/2016 10:22 AM, Luis Zárate wrote:
Mmm why not just download Jquery and create a folder called static 
inside one controlled app, maybe pone inside the project.


If you want, you can use django admin jquery but $ is not available 
because django use django.JQuery for prevent conflict with custom user 
jquery


El jueves, 10 de noviembre de 2016, Gary Roach 
mailto:gary719_li...@verizon.net>> escribió:

> Hi,
>
> Sorry about the confusion. I misspoke. I was trying to imply that 
there was a jquery.min.js file in the venv (djenv)  file. As you 
implied, it was installed with pip django. A very bad choice of words.

>
> I am trying to set up my project so that I am not using a system 
version of jquery since the system version is subject to change every 
time I update my debian system (whiich I do about once a week). I 
suppose what I really want to know is how do I get a "sequestered" 
version of jquery.min.js installed.  I have tried to use a pointer to 
the copy in the djenv directory (Eclipse allows this).  After doing 
this there is a file jquery.min.sj <http://jquery.min.sj> shows up in 
my static file directory. Unfortunately, when I do a runserver I still 
get a - "GET /static/jquery.min.js HTTP/1.1" 404 1652 - error. What's 
next?

>
> Gary R.
>
> On 11/09/2016 11:56 PM, Antonis Christofides wrote:
>>
>> Hi,
>>
>> If, as you say, you "have a jquery file under version control 
inside [your]
>> virtual environment wrapper", I believe you are doing something 
wrong. We
>> normally don't put jquery files in virtualenv (although `pip 
install django`

>> will do so), and we normally do not version control the virtualenv.
>>
>> If virtualenv is not clear to you, I'd propose to take a look at
>> http://djangodeployment.com/2016/11/01/virtualenv-demystified/ and 
then re-ask

>> your question.
>>
>> Regards,
>>
>> Antonis Christofides
>> http://djangodeployment.com
>>
>> On 2016-11-09 23:54, Gary Roach wrote:
>>>
>>> Ludovic
>>>
>>> Thank you for the reply but I know how to use static files. The 
problem is
>>> that I already have a jquery file under version control inside my 
virtual
>>> environment wrapper and do not wish to use an external file . Use 
of a normal
>>> static file will open my application up to uncontrolled version 
shifts. I want
>>> to know how to use the pip installed version of the jquery file if 
possible.

>>>
>>> Gary R.
>>>
>>> On 11/09/2016 01:41 PM, ludovic coues wrote:
>>>>
>>>> Hello,
>>>>
>>>> Django provide tools to deals with static files like javascript or
>>>> css. The documentation is at [1].
>>>>
>>>> [1] https://docs.djangoproject.com/en/1.10/howto/static-files/
>>>>
>>>> 2016-11-09 21:26 GMT+01:00 Gary Roach <mailto:gary719_li...@verizon.net>>:

>>>>>
>>>>> Hi all,
>>>>>
>>>>> I am just starting to use jQuery and Ajax in my project and am 
having

>>>>> trouble setting things up.
>>>>>
>>>>> I am using Eclipse + pyDev as an IDE. This setup stores 
everything in a
>>>>> workspace directory in my home directory. Instead of putting the 
whole
>>>>> project inside a virtualenv wrapper, things work better if the 
venv is
>>>>> external to the actual project files and the venv contents 
referenced in the

>>>>> Eclipse setup. In that venv file (djenv) there is the following:
>>>>>
>>>>>> 
/home/gary/workspace/djenv/lib/python3.5/site-packages/django/contrib/admin/static/admin/js/vendor/jquery/jquery.min.js

>>>>>>
>>>>>
>>>>> Now to the setup of my main html page. According to 
W3schools.com I should

>>>>> include one of the following in the html head section:
>>>>>
>>>>>>
>>>>>> 
>>>>>> 
>>>>>
>>>>>or
>>>>>
>>>>>>
>>>>>> <tt>>>>>>> 
</tt><tt>src="<a  rel="nofollow" href="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"">https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"</a>;>

>>>>>>
>>>>>> 
>>>>>
>>>>> Neither of these fit my situation. I don't have a separate
>>>>> jquery-3.1.1.min.js file and don't want to use the google source.
>>>>>
>>>>> What I wish to know is can I use something like:
>>>>>>
>>>>>> 
>>>>>> <tt>>>>>>> 
</tt><tt>"djenv/lib/python3.5/site-packages/django/contrib/admin/static/admin/js/vendor/jquery/jquery.min.js"

>>>>>>
>>>>>> 
>>>>>
>>>>> or can I use just 

Loading the content of an iframe


Hi all,

I am really stumbling around with my project at present. I am relatively 
new to both Python and Django and have started a major project with both 
(retired and have plenty of time).


I have set up a main.html page that has logos and such at the top of the 
page and has some more logo stuff and copyright stuff at the bottom. I 
have an iframe that fills the center of the page. There are several 
control buttons at the top - but outside - of the iframe. I wish to be 
able to push one of the control buttons and have the selected content 
appear in the iframe. The pertinent code is:


Debian os, kde4 desktop, Django 1.9, Python 3.5, Postgresql 9.1

Project archive
urls.py
from django.conf.urls import url
from django.contrib import admin

from . import views

urlpatterns = [
url(r'^$', views.mainPage),
url(r'^welcome/', views.welcome),
url(r'^first/', views.readMeFirst),
url(r'^admin/', admin.site.urls),
]
views.py
from django.shortcuts import render


def mainPage(request):
return render(request, 'main/main.html')


def welcome(request):
return render(request, 'main/welcome.html')


def readMeFirst(request):
return render(request, 'main/readMeFirst.html')


main.html (parts)
   switch(bn) {
case "b1":
jQuery.get("views.welcome");
 break;
case "b2":
break;
case "b3":
break;
case "b4":
break;

and later

  



 


I have no idea how to tie all of this together. I'm probably way off 
base and need advise. The object is to push buttons and have the 
appropriate pages show up in the iframe. These pages may have active 
elements withing them or may have data fetched from the database included.


Any help will be sincerely appreciated.

Gary R.




--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/339ff49b-358c-111c-cd40-05d90a5474ba%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


settings.py TEMPLATES DIRS

Hi

I'm using Django 1.8 and python 2-7 on a Debian Linux system. I am using 
Ninja-ide as my ide. When I enter the following in the TEMPLATES section 
the settings.py file I get an invalid syntax error:

'DIRS': [os.path.join(BASE_DIR, 'templates'],


Since the DIRS entry is directly out of a tutorial I'm not sure what the 
problem implys.


Any help will be sincerely appreciated.


Gary R

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/35d35abb-d5d2-4108-b66e-0456e4324584%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Re. My Django Book.

Since I am grinding my way through the learning process right now I thing I 
have some fairly pithy comments to contribute. It seems that no two 
tutorials do things the same way. I got bogged down in Two  Scoops because 
I needed a more detailed cookbook approach. Tango With Django is the best 
except it is written for Django 1.7. There is a serious break between how 
1.7 and 1.8 handle template files in the settings.py file. I still haven't 
recovered from this. Initial setup made me pull my hair out by the roots 
(and I can't afford to loose much more). Some suggestions:
  If your using a database other than the built in SQLite set it up 
first.
  Setup virtualenv and virtualenvmapper next.
  Do everything else inside of virtualenv.
  Install Django with pip (virtualenv active)
Then start a tutorial. The Django documentations tutorial seemed to be very 
good until it segued into a long trites on API setup. Really annoying. I 
just wanted to get the basic system set up. That said, the official 
tutorial may still be your best bet. Good luck.

Gary R 


On Thursday, July 30, 2015 at 1:35:16 PM UTC-7, Steve Burrus wrote:
>
> * Say I was wondering if anyone else has ever read this particulkar Django 
> book called "Sams Teach Yourself Django in 24 Hours" I checked out of the 
> library yesterday? [yeah I know it's one of the "24 hours" series] Does it 
> really teach the beginner a lot of things concerning Django?*
>
>
>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5f6624d8-d7f5-47a5-9088-b528b16bbe7d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: settings.py TEMPLATES DIRS

Thank you very much. I looked at that code for hours and didn't see the 
missing ) . A different set of eyes are really helpful.

Gary R

On Friday, July 31, 2015 at 11:59:38 PM UTC-7, Gary Roach wrote:
>
> Hi
>
> I'm using Django 1.8 and python 2-7 on a Debian Linux system. I am using 
> Ninja-ide as my ide. When I enter the following in the TEMPLATES section 
> the settings.py file I get an invalid syntax error:
>
> 'DIRS': [os.path.join(BASE_DIR, 'templates'],
>
>
> Since the DIRS entry is directly out of a tutorial I'm not sure what the 
> problem implys.
>
>
> Any help will be sincerely appreciated.
>
>
> Gary R
>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3432a316-0e91-4f01-9c11-d33e0dd8ab7e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Moving from Django 1.6 to 1.8 (relation "django_site" does not exist


On 08/10/2015 09:53 AM, TheBeardedTemplar wrote:

Hello,

I'm trying to move a fairly large site from Django 1.6.5 to Django 
1.8.3. I'm also moving from sqlite3 to postgreSQL at the same time and 
I'm having trouble with the migrations. Here's what I've done so far:


  * Installed Django 1.8.3, removed south, and installed psycopg 2.6.1
  * Installed postgres admin, and created a new database, then updated
settings.DATABASES to connect to it
  * Deleted all migration folders from south
  * Attempted to run python manage.py migrate (from here I've been
messing around trying to get things running)
  o Got an error: relation: "scheduler_customevent" does not exist
  o Tried making migrations for schedule (and django.scheduler
which defines the base class), got "No changes detected in app"
  o Tried applying fake migrations for schedule, got "Error
creating new content types."
  o Tried migrating auth, got relation "django_site" does not
exist, with a db error: LINE 1: SELECT (1) AS "a" FROM
"django_site" LIMIT 1

At this point I'm kind of floundering - I suspect it might have to do 
with the name of my schedule app (before I had schedule and 
django-schedule  and that 
caused trouble in 1.8, so I renamed mine to scheduler).


I'd appreciate some guidance on where to go next - it seems like I'll 
really benefit from the migration system in 1.8, I just need to 
understand it first.


Thanks!
--
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+unsubscr...@googlegroups.com 
.
To post to this group, send email to django-users@googlegroups.com 
.

Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/afa49126-c6ae-4bdf-a677-38c2b7ea5969%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.
Not sure this will help or is even relevant but there is a significant 
difference in the settings.py file  between the two versions. 
Specifically, the inclusion of a templates tuple. Check the files 
carefully for differences.


Gary R

--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/55C8E54F.5060903%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


can't find static file


Hi all;

Stats:
Debian Linux 8 (jessie)
python = 2.7.9
Django 1.7 (To match tutorial)
sqlite data base
Using virtualenv

I'm working my way through the Tango With Rango tutorial and have hit a 
snag. I added the static/images directory and put in a jpg photo for 
data. The system can't find the file. I've tried the usual python 
manage.py runserver and then used 
/127.0.0.1:8000/static/images/P1000153.JPG which produces:


Request Method: GET
Request URL:http://127.0.0.1:8000/static/image/P1000153.JPG

'image/P1000153.JPG' could not be found

I tried the python manage.py findstatic. Same results. Below are my 
project tree and my settings.py file. Probably a stupid error but I 
can't find it.


├── db.sqlite3
├── __init__.py
├── manage.py
├── rango
│   ├── admin.py
│   ├── admin.pyc
│   ├── __init__.py
│   ├── __init__.pyc
│   ├── migrations
│   │   ├── __init__.py
│   │   └── __init__.pyc
│   ├── models.py
│   ├── models.pyc
│   ├── tests.py
│   ├── urls.py
│   ├── urls.pyc
│   ├── views.py
│   └── views.pyc
├── static
│   ├── images
│   │   ├── __init__.py
│   │   └── P1000153.JPG
│   └── __init__.py
├── templates
│   ├── __init__.py
│   └── rango
│   ├── index.html
│   └── __init__.py
├── twr_project
│   ├── __init__.py
│   ├── __init__.pyc
│   ├── settings.py
│   ├── settings.pyc
│   ├── urls.py
│   ├── urls.pyc
│   ├── wsgi.py
│   └── wsgi.pyc
└── twr_project.nja

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os

BASE_DIR = os.path.dirname(os.path.dirname(__file__))
TEMPLATE_PATH = os.path.join(BASE_DIR, 'templates')

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'u^y3v@)p)9m#z^1z194r$r$g%*(@v)@+@72uu#bu8&b2=!mpv$'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

TEMPLATE_DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rango',
)

MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'twr_project.urls'

WSGI_APPLICATION = 'twr_project.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}

# Internationalization
# https://docs.djangoproject.com/en/1.7/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'America/Los_Angeles'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/

STATIC_PATH = os.path.join(BASE_DIR, 'static/')

STATIC_URL = '/static/'

SATATICFILES_DIRS = (
STATIC_PATH,
)
STATIC_ROOT = os.path.join(BASE_DIR, 'static/')

TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or
# "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
TEMPLATE_PATH,
)




Thanks in advance

Gary R.

--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/560C4DCA.20205%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Adding gif file to existing project


Django 1.8
Python 3.4
Debian 8 (jessie) with kde desktop
Postresql 9.4
Apache2
venv environment setup
Ninja-IDE

The problem is that I am having trouble getting the image.gif file in 
the project to show up in the IDE directory. The project tree is as follows:


.
├── archive
│   ├── archive
│   │   ├── __init__.py
│   │   ├── __pycache__
│   │   │   ├── __init__.cpython-34.pyc
│   │   │   ├── settings.cpython-34.pyc
│   │   │   ├── urls.cpython-34.pyc
│   │   │   └── wsgi.cpython-34.pyc
│   │   ├── settings.py
│   │   ├── urls.py
│   │   └── wsgi.py
│   ├── archive.nja
│   ├── db.sqlite3
│   ├── home
│   │   ├── admin.py
│   │   ├── __init__.py
│   │   ├── migrations
│   │   │   ├── __init__.py
│   │   │   └── __pycache__
│   │   │   └── __init__.cpython-34.pyc
│   │   ├── models.py
│   │   ├── __pycache__
│   │   │   ├── admin.cpython-34.pyc
│   │   │   ├── __init__.cpython-34.pyc
│   │   │   ├── models.cpython-34.pyc
│   │   │   └── views.cpython-34.pyc
│   │   ├── tests.py
│   │   └── views.py
│   ├── __init__.py
│   ├── main
│   │   ├── admin.py
│   │   ├── __init__.py
│   │   ├── migrations
│   │   │   ├── 0001_initial.py
│   │   │   ├── 0002_auto_20151019_1147.py
│   │   │   ├── 0003_auto_20151021_1441.py
│   │   │   ├── __init__.py
│   │   │   └── __pycache__
│   │   │   ├── 0001_initial.cpython-34.pyc
│   │   │   ├── 0002_auto_20151019_1147.cpython-34.pyc
│   │   │   ├── 0003_auto_20151021_1441.cpython-34.pyc
│   │   │   └── __init__.cpython-34.pyc
│   │   ├── models.py
│   │   ├── __pycache__
│   │   │   ├── admin.cpython-34.pyc
│   │   │   ├── __init__.cpython-34.pyc
│   │   │   └── models.cpython-34.pyc
│   │   ├── tests.py
│   │   └── views.py
│   ├── manage.py
│   ├── static
│   │   ├── home
│   │   │   ├── images
│   │   │   │   ├── django.gif
│   │   │   │   └── __init__.py
│   │   │   ├── __init__.py
│   │   │   └── style.css
│   │   └── __init__.py
│   └── templates
│   ├── admin
│   │   ├── base_site.html
│   │   └── __init__.py
│   ├── home
│   │   ├── index.html
│   │   └── __init__.py
│   └── __init__.py

You will notice that there is a django.gif file under static / home / 
images. Unfortunately, this file does not show up in the IDE's tree.
I can't seem to figure out why. Below is the settings.py file for the 
project. Have I done something wrong here.


_

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '$ey(n0ld$2v7x*4b+&a2n7!zt#+ub519+km9n=_4yz2f2kd&s5'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'main',
'home',
)

MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware',
)

ROOT_URLCONF = 'archive.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'archive.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'archivedb',
'USER': 'postgres',
'PASSWORD': 'qatip',
'HOST': '127.0.0.1',
'PORT': '',
}
}


# Internationalization
# https://docs.djangoproject.com/en/1.8/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'America/Los_Angeles'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.8/howto/static-files/

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')

___

The IDE tr

Where does the static files reside


Which is the correct file structure for static files

Putting the static files under the individual project as shown with 
"home' below:

├── archive
│   ├── archive
│   │   ├── __init__.py
│   │   ├── __init__.pyc
│   │   ├── settings.py
│   │   ├── settings.pyc
│   │   ├── urls.py
│   │   └── wsgi.py
│   ├── home
│   │   ├── admin.py
│   │   ├── admin.pyc
│   │   ├── __init__.py
│   │   ├── __init__.pyc
│   │   ├── models.py
│   │   ├── models.pyc
│   │   ├── static
│   │   │   ├── home.css
│   │   │   ├── images
│   │   │   └── __init__.py
│   │   ├── tests.py
│   │   └── views.py
│   ├── __init__.py
│   ├── manage.py
│   └── templates
│   ├── admin
│   │   ├── base_site.html
│   │   └── __init__.py
│   ├── home
│   │   ├── index2.html
│   │   ├── index.html
│   │   └── __init__.py
│   └── __init__.py

or should they be under the project "root" as shown below.

├── archive
│   ├── archive
│   │   ├── __init__.py
│   │   ├── __init__.pyc
│   │   ├── settings.py
│   │   ├── settings.pyc
│   │   ├── urls.py
│   │   └── wsgi.py
│   ├── home
│   ├── __init__.py
│   │   ├── admin.py
│   │   ├── admin.pyc
│   │   ├── __init__.py
│   │   ├── __init__.pyc
│   │   ├── models.py
│   │   ├── models.pyc
│   │   ├── tests.py
│   │   └── views.py
│   ├── static
│   │ └── __init__.py
|   | |___home
│   │ ├── home.css
│   │ ├── images
|   |   django.gif
│   ├── manage.py
│   └── templates
│   ├── admin
│   │   ├── base_site.html
│   │   └── __init__.py
│   ├── home
│   │   ├── index2.html
│   │   ├── index.html
│   │   └── __init__.py
│   └── __init__.py

The second way seems to be the more logical but the tutorial set things 
up as shown in the first. Either way, I have not been able to get either 
one working (serving up static files). Since there are dozens of queries 
about serving static files and dozens of ways shown - none of which 
worked for me and many of which conflicted with each other - all I want 
is the answer to this one question and nothing else. After that I will 
work with the next step.


I'm using Debian 8 (jessie) os. This complicates things a bit because 
Debian takes care of a lot of the setup automatically that other Linux 
versions don't. I'm using Django 1.8 and Python 3.4


Please use the KISS principle on this one.

Thanks in advance

Gary R.


--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/563E8F80.9050908%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: Where does the static files reside


On 11/07/2015 04:29 PM, René Fleschenberg wrote:

Hi Gary,

In your second example:

├── archive
│   ├── archive
│   │   ├── __init__.py
│   │   ├── settings.py
│   │   ├── urls.py
│   │   └── wsgi.py
│   ├── home
│   ├── static
|   | |___home
│   │ ├── home.css
│   │ ├── images

you have what I would call a "global" static files directory. Files from
this directory will only be found if you configure that directory in your
settings:

STATICFILES_DIRS = (
 os.path.join(BASE_DIR, "static"),
)

This is because that directory is not part of any app that is listed in
INSTALLED_APPS.

BASE_DIR is the top-level "archive" directory, by the way (the first
"archive" in the tree).

I hope this helps.


Because this gets asked so often, I am trying to  to sump it up here:

https://fleschenberg.net/django-staticfiles/

I'd love to hear your feedback about this article, i.e. if it clarifies
things for you, or how to improve it.

Thanks for the tips. I read your 'In a nutshell" . Good work. Now, 
getting into setup philosophy, it occurs to me that it would be nice to 
have  global static files for such things as a style.css file since the 
file should set the style of your whole web site. I suppose that one 
could put a copy of the file under each apps static folder but change 
control would be horrible. Could I set up both a global static folder 
and then have a static folder under each app? Being rather new to this 
rats nest (great framework all the same) I'm probably skating on rather 
thin ice here. Be kind.


As to your comment on the first tree, I think I created the problem 
while cutting and pasting. The actual project works - mostly.


A comment on "6 An alternative approach". This actually my case. When 
you say that the app listed first takes precedence.


Looking forward to your comments.

Gary R

--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/563F6DA5.1050909%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


finding information on modules, imports, etc.


I can't seem to find a "dictionary" of modules? or what ever on the use of:

import os or other possible imports

from django.contrib  import admin possibilities.>


Maybe I'm using the wrong terminology but after a gazillion searches, I 
still haven't found a decent reference.


Any help to this relatively new user would be sincerely appreciated.


Gary R.

--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/563F8575.1000208%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: finding information on modules, imports, etc.

Actually, I think I have been looking in the wrong place for my 
information. What I assumed was Django functions are actually Python 
functions. Most if the information I need is found in the Python web 
sites. Obviously, I'm a bit of a Nub all around. AFLE (Another xxx 
learning experience.)


Thanks for your reply

Gary R.

On 11/08/2015 11:19 AM, Gergely Polonkai wrote:


It's a bit unclear what you want to do. Could you write a use case? 
I'm afraid of an XY problem here…


On 8 Nov 2015 18:25, "Gary Roach" <mailto:gary719_li...@verizon.net>> wrote:


I can't seem to find a "dictionary" of modules? or what ever on
the use of:

import os or other possible imports

from django.contrib  import admin 

Maybe I'm using the wrong terminology but after a gazillion
searches, I still haven't found a decent reference.

Any help to this relatively new user would be sincerely appreciated.


Gary R.

-- 
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+unsubscr...@googlegroups.com
<mailto:django-users%2bunsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com
<mailto:django-users@googlegroups.com>.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/563F8575.1000208%40verizon.net.
For more options, visit https://groups.google.com/d/optout.

--
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+unsubscr...@googlegroups.com 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto:django-users@googlegroups.com>.

Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACczBULYKLmZ4bB%2BqDQAQqZjFPF2TN7ciyhhjBPb5k7TZSapDQ%40mail.gmail.com 
<https://groups.google.com/d/msgid/django-users/CACczBULYKLmZ4bB%2BqDQAQqZjFPF2TN7ciyhhjBPb5k7TZSapDQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.

For more options, visit https://groups.google.com/d/optout.


--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5640B028.7080702%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Apache2, mod_wsgi and django setup


Setup for Django development system

OS Debian Linux 8 (jessie) using systemd, not init.d
Python 3.4.2
Django 1.8.5
Apache2 2.4.10 Debian (mmm-worker)
mod_wsgi 4.3.0
Postgresql 9.4.5

Two virtual environments: archive (actual project) and mysite (django 
tutorial). Setup done with python3 -m venv . There seems 
to be some variation between this setup and the one using virtualenv. 
Confusing.


pip3 install mod_wsgi in each environment
Run mod_wsgi-express with install-module and setup-server for each.

In /etc/apache2/envvars the following environmental variables are set.
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data

In /etc/apache2/apache2.conf the following environmental variables are 
used to set user and group.

User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

But starting from within the project with mod_wsgi-express start-server 
gives:


WARNING: When running as the 'root' user, it is required that the 
options '--user' and '--group' be specified to mod_wsgi-express.


Starting with apachectl start or python manage.py runserver give no 
errors. Both servers work.


Questions:
What user is apache running as if started with apachectl?
What user is apache running as if started with python manage.py 
runserver?
How do I assure that Apache is running as www-data?
	Do I need to start Apache with mod_wsgi-express --user www-data --group 
www-data or is python manage.py runserver good enough?


Answers to these questions would be very very helpful

Gary R

--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/564513EF.8050508%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: Apache2, mod_wsgi and django setup


Andrew;
I forgot all about the process tables. Thanks. Interesting though, 
systemctl and mod_wsgi both start a root instance and then fork off 3-4 
www-data instances. I assume that this is normal. The python manage.py 
runserver on the other hand doesn't even show up in the process table. I 
suspect it's using the internal development server. Nice to know.


James;
See below

On 11/12/2015 03:24 PM, James Schneider wrote:
On Thu, Nov 12, 2015 at 2:34 PM, Gary Roach <mailto:gary719_li...@verizon.net>> wrote:


Setup for Django development system

OS Debian Linux 8 (jessie) using systemd, not init.d
Python 3.4.2
Django 1.8.5
Apache2 2.4.10 Debian (mmm-worker)
mod_wsgi 4.3.0
Postgresql 9.4.5

Two virtual environments: archive (actual project) and mysite
(django tutorial). Setup done with python3 -m venv .
There seems to be some variation between this setup and the one
using virtualenv. Confusing.


Somewhat, yes, although both are effectively the same process. You end 
up with the same thing either way, though. The 'old' way of installing 
the virtualenv packages and then creating the virtualenv with external 
shell commands was integrated natively into Python 3 (ie your python3 
-m venv command), hence the confusion.
Thanks for the clarification. Between switching between Python 2 and 
Python 3, the differences between Debian and systemd vs the other 
versions and  everyone taking a different approach to the same problem, 
us novices get really confused.



pip3 install mod_wsgi in each environment
Run mod_wsgi-express with install-module and setup-server for each.


That's interesting, I've never heard of mod_wsgi-express. From a quick 
google though, it appears it should only be used for testing a 
mod_wsgi installation, not for production runs. Generally things work 
the other way around (Apache configured to use the mod_wsgi module as 
it is needed).
Which is exactly where I am at present. I'll fight the production stuff 
later.


In /etc/apache2/envvars the following environmental variables are set.
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data

In /etc/apache2/apache2.conf the following environmental variables
are used to set user and group.
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

But starting from within the project with mod_wsgi-express
start-server gives:

WARNING: When running as the 'root' user, it is required that the
options '--user' and '--group' be specified to mod_wsgi-express.

Starting with apachectl start or python manage.py runserver give
no errors. Both servers work.

Questions:
What user is apache running as if started with apachectl?


This tends to be distribution specific. Most often it will be www, or 
www-data. The serivce user account is generally specified by the 
service daemon management system configuration scripts for 
Apache/httpd (Systemd in this case).


  What user is apache running as if started with python
manage.py runserver?


It isn't. The runserver command is running its own bare-bones web 
server that is built into Python/Django (WEBrick IIRC, or at least it 
was previously). Only to be used for development, not for production.

Which I discovered to my surprise. See above.


  How do I assure that Apache is running as www-data?


Running ps -ef | grep -i '\(apache|http\)' should give you the user 
that the processes (Apache and all of its children) are running as in 
the first column.


  Do I need to start Apache with mod_wsgi-express --user
www-data --group www-data or is python manage.py runserver good
enough?


You should not be using either of those methods for a production 
installation of your project. Configure Apache directly to reference 
mod_wsgi.


https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/modwsgi/


Answers to these questions would be very very helpful

Gary R



Is there a specific reason that you installed a custom version of 
mod_wsgi? Most distributions provide a 2.7 and 3.X compatible version 
of mod_wsgi along with their Apache installations (or provide package 
installations for mod_wsgi for each respective Python version). 
High-end installations with node management and configuration control 
tend to use custom compiled versions since they can manage them 
effectively. The rest of us peasants are probably better off using the 
distribution packages until we figure out what we're doing (myself 
included).


Out of curiosity, I logged into one of my Debian 8 boxen and verified 
that this is the case:


$ apt-cache search mod-wsgi
libapache2-mod-wsgi - Python WSGI adapter module for Apache
libapache2-mod-wsgi-py3 - Python 3 WSGI adapter module for Apache

$ apt-cache showpkg libapache2-mod-wsgi-py3
Package: libapache2-mod-wsgi-py3
V

Template can't find image file

While I'm working with "Tango with Django" I am using Django 1.8 and 
Python 3.4 (debian linux).


My project tree (somewhat truncated) is in the /root directory and looks 
as follows:


tango
├── bin
├── include
├── lib
└── tango
├── db.sqlite3
├── __init__.py
├── manage.py
├── rango
├── requirements.txt
├── static
│   ├── images
│   └── __init__.py
├── tango
│   ├── __init__.py
│   ├── __init__.pyc
│   ├── __pycache__
│   ├── settings.py
│   ├── settings.pyc
│   ├── urls.py
│   └── wsgi.py
├── tango.nja
└── templates
├── __init__.py
└── rango

The pertinent parts of the settings.py file are:

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {

STATIC_PATH = os.path.join(BASE_DIR, 'static')

STATIC_URL = '/static/'

STATICFILES_DIRS = (
STATIC_PATH,
)

The rango index.html file is:



{% load static from staticfiles %}



Rango



Rango says...
hello world! {{ boldmessage }}
About






The apache2.png is just a handy image file.

The result of 127.0.0.1:8000/rango/   is:

Rango says...
hello world! I am bold font from the context
About
Picture of Apache logo

I've tried everything I can think of to try to get the image served and 
have totally failed. The firefox debugger just says "failed to load the 
given URL"


What am I doing wrong.

Gary R



--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/56661A1E.30803%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: Template can't find image file


OOPs forgot to include these.

/root/tango/tango/urls.py is:

from django.conf.urls import include, url

from django.contrib import admin


urlpatterns = [

url(r'^admin/', include(admin.site.urls)),

url(r'^rango/', include('rango.urls', namespace='rango')),

]


/root/tango/rango/urls.py is:


from django.conf.urls import patterns, url

from rango import views

urlpatterns = patterns('',

url(r'^$', views.index, name='index'),

)


rango/views.py is:

from django.shortcuts import render

def index(request):

context = {'boldmessage': "I am bold font from the context"}

return render(request, 'rango/index.html', context)

--
I hope this helps


Gary R.




On 12/08/2015 03:59 AM, Lucas Magnum wrote:
Have you changed your urls.py? 
https://docs.djangoproject.com/en/1.9/howto/static-files/#serving-static-files-during-development






[]'s

Lucas Magnum.

2015-12-07 21:45 GMT-02:00 Gary Roach <mailto:gary719_li...@verizon.net>>:


While I'm working with "Tango with Django" I am using Django 1.8
and Python 3.4 (debian linux).

My project tree (somewhat truncated) is in the /root directory and
looks as follows:

tango
├── bin
├── include
├── lib
└── tango
├── db.sqlite3
├── __init__.py
├── manage.py
├── rango
├── requirements.txt
├── static
│   ├── images
│   └── __init__.py
├── tango
│   ├── __init__.py
│   ├── __init__.pyc
│   ├── __pycache__
│   ├── settings.py
│   ├── settings.pyc
│   ├── urls.py
│   └── wsgi.py
├── tango.nja
└── templates
├── __init__.py
└── rango

The pertinent parts of the settings.py file are:

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {

STATIC_PATH = os.path.join(BASE_DIR, 'static')

STATIC_URL = '/static/'

STATICFILES_DIRS = (
STATIC_PATH,
)

The rango index.html file is:



{% load static from staticfiles %}



Rango



Rango says...
hello world! {{ boldmessage }}
About





The apache2.png is just a handy image file.

The result of 127.0.0.1:8000/rango/
<http://127.0.0.1:8000/rango/>   is:

Rango says...
hello world! I am bold font from the context
About
Picture of Apache logo

I've tried everything I can think of to try to get the image
served and have totally failed. The firefox debugger just says
"failed to load the given URL"

What am I doing wrong.

Gary R



-- 
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+unsubscr...@googlegroups.com
<mailto:django-users%2bunsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com
<mailto:django-users@googlegroups.com>.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/56661A1E.30803%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


--
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+unsubscr...@googlegroups.com 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto:django-users@googlegroups.com>.

Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAAB7jOxe-yN%3DVDpUc8ZzgX%2B8tw2CWf7OTTHA2svbeHm3G1sMPQ%40mail.gmail.com 
<https://groups.google.com/d/msgid/django-users/CAAB7jOxe-yN%3DVDpUc8ZzgX%2B8tw2CWf7OTTHA2svbeHm3G1sMPQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.

For more options, visit https://groups.google.com/d/optout.


--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/56670AAF.2060206%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


git exclude files

Since Python3, venv seems to be preferable to virtualenv. Most of the 
howto's are for virtualenv. The file setup between the two is completely 
different. So do I include the bin/, include/, lib/, and the lib64 -> 
/root/archive/lib files in the git repository or should they be 
excluded. If the need to be excluded, how.


This is a Django 1.8, Python3.4 project, Debian 8 (jessie) project.

Gary R

--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/566B3B2E.4040308%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: git exclude files

Unfortunately, venv doesn't give me a choice as to where the files are 
stored. They are all under the top directory of the same name as the 
project but are actually in the same directory as the top level project 
folder. ie /root/archive/ venv files, and archive/ project. From what 
you say, they should not be included in the git source control.


Gary R

On 12/11/2015 02:51 PM, Tim Graham wrote:
I don't know of a use case where virtualenvs are stored in source 
control. I wouldn't recommend putting the virtual environment in your 
project folder either. If you use a tool like virtualenvwrapper [1] 
you can store all your virtualenvs in a single directory on your 
system to make managing them easy.


[1] https://virtualenvwrapper.readthedocs.org/

On Friday, December 11, 2015 at 4:08:29 PM UTC-5, Gary Roach wrote:

Since Python3, venv seems to be preferable to virtualenv. Most of the
howto's are for virtualenv. The file setup between the two is
completely
different. So do I include the bin/, include/, lib/, and the lib64 ->
/root/archive/lib files in the git repository or should they be
excluded. If the need to be excluded, how.

This is a Django 1.8, Python3.4 project, Debian 8 (jessie) project.

Gary R

--
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+unsubscr...@googlegroups.com 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto:django-users@googlegroups.com>.

Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0aa43312-1070-4c21-94ca-4a39cd15096a%40googlegroups.com 
<https://groups.google.com/d/msgid/django-users/0aa43312-1070-4c21-94ca-4a39cd15096a%40googlegroups.com?utm_medium=email&utm_source=footer>.

For more options, visit https://groups.google.com/d/optout.


--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/566C3F47.4%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: git exclude files

As I mentioned earlier, venv and virtualenv do not work the same. There 
may be a way to force venv to  put the files in a different place but 
the default is to put them in the directory just above the start of the 
project not in a separate .virtualenv file. So a different directory is 
not an option.


Gary R.

On 12/13/2015 01:56 AM, graeme wrote:



On Saturday, December 12, 2015 at 2:38:29 AM UTC+5:30, Gary Roach wrote:

/root/archive/lib files in the git repository or should they be
excluded. If the need to be excluded, how.


Definitely exclude it. There are lots of things that may make it break 
on a different system.


As another reply pointed out your code and the virtualenv or venv 
should be in different directories, so you should not need to exclude 
anything.



This is a Django 1.8, Python3.4 project, Debian 8 (jessie) project.

Gary R

--
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+unsubscr...@googlegroups.com 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto:django-users@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/137832e1-f72e-4018-a3ea-6949d72412ee%40googlegroups.com 
<https://groups.google.com/d/msgid/django-users/137832e1-f72e-4018-a3ea-6949d72412ee%40googlegroups.com?utm_medium=email&utm_source=footer>.

For more options, visit https://groups.google.com/d/optout.


--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/566D99DC.9080303%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: git exclude files

Sorry Scott but don't think that venv and pyvenv are the same. I use 
venv. There may very well be a way to do as you say but I'm down the 
road a bit at this point and really don't want to start screwing around 
with my whole project structure. I just need to exclude the 
aforementioned files and be done with it. It may not be pretty but I 
think I will avoid a lot of headaches by not messing with my present 
environmental structure.


Gary R.

On 12/13/2015 09:50 AM, Scot Hacker wrote:

On Sunday, December 13, 2015 at 8:17:15 AM UTC-8, Gary Roach wrote:

As I mentioned earlier, venv and virtualenv do not work the same.
There may be a way to force venv to  put the files in a different
place but the default is to put them in the directory just above
the start of the project not in a separate .virtualenv file. So a
different directory is not an option.


The venv docs <https://docs.python.org/3/library/venv.html> say that 
the process of creating a new virtual environment is just:


pyvenv  /path/to/new/virtual/environment


It's not a matter of "forcing" the creation of the environment dir 
somewhere. If you are intentionally putting your project code in the 
same dir tree with the environment, you have a recipe for chaos. 
Again, there should be no need to .git exclude anything.



./s


--
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+unsubscr...@googlegroups.com 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto:django-users@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/117573f1-d6fd-431e-ac6f-b821ae2463ab%40googlegroups.com 
<https://groups.google.com/d/msgid/django-users/117573f1-d6fd-431e-ac6f-b821ae2463ab%40googlegroups.com?utm_medium=email&utm_source=footer>.

For more options, visit https://groups.google.com/d/optout.


--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/566E07C6.5020504%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


calling html file from within javascript

I use javascript in my  main.html (top template) to control the access 
to several buttons. The buttons call a javascript function. This setup 
works exactly as I wish except the buttons still don't really do 
anything. I need to have each button load a different template. The 
pertinent script is:



"use strict"
var bn = ""
function buttoncontrol(bn){
var i = 0;
var bx = "";
var x = []; /*array*/
if (bn=="resetDone")
{
for (var i = 0; i < 4; i++)
{
bx= "b" + (i+1);
document.getElementById(bx)
.removeAttribute("disabled");
}
return
}
else {
for (var i = 0; i < 4; i++)
{
bx= "b" + (i+1);
document.getElementById(bx)
.setAttribute("disabled", "true");
}
switch(bn) {
case "b1":
document.write("'Welcome.html'");
 break;
case "b2":
break;
case "b3":
break;
case "b4":
break;
default:
document.write("fell out the bottom");
}
return;
}
}



The code works till it hits the document.write statement and freezes. 
This just plain doesn't work. What would. I want to keep this approach, 
so I need an alternative to the  document.write statement.


Both my main.html and my welcome.html are in the same template 
directory. I bypassed the button during development and the two pages 
worked well together.


Django 1.8
Python 3.4

Gary R.

--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/566E0BC0.8020100%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: calling html file from within javascript


Hi Gergely

I agree that document.write is a bad idea. Freezing in this case may be 
a poor choice of words. I was trying to convey that the code executes OK 
until it gets to the .write line and hangs up. It never completes the 
.write line.


As for purpose. Main.html is a template contains the permanent headers 
and footers for the site with the body consisting of an iframe 
containing a {% block content %} {% endblock %} statement. When each 
button is pushed, all buttons are disabled and the .html template file 
associated  with the particular button is used to fill the block 
content. This worked when I didn't use javascript to call welcome.html. 
But I can't seem to figure out how to serve up the file with javascript. 
I really don't want to change the general method. I have never liked web 
sites that allow users to hit the same button twice or hit more than one 
button in mid load. I know that one can build buttons using link but 
this seemed more straight forward to me. ie have the  button call a 
javescript function and let the function do all of the heavy lifting.


I've had many years of various levels of programming and system 
maintenance but have been retired since 1998 and am pretty rusty. In 
addition, the technology has shifted significantly since. So for all 
practical purposes I'm an nooby and am trying to master python, html, 
javascript and django all at the same time. Learning by doing I guess.


So the bottom line is that I need a code snippet to put under case b1 
that will insert welcome.html into the block statement in main.html.


Any help will be sincerely appreciated.

Gary R.

On 12/13/2015 10:55 PM, Gergely Polonkai wrote:


Sorry, I have pressed Send too soon…

As you see, using document.write is a very bad idea. However, freezing 
is not mentioned in that document. What does freezing mean in this 
case? Are you sure it's this code that gets executed and freezes?


Also, what exactly do you want to achieve?

Best,
Gergely

On Dec 14, 2015 7:52 AM, "Gergely Polonkai" <mailto:gerg...@polonkai.eu>> wrote:


Hello,

although this is barelyDjango related, here are some notes.

From MDN[1]: Note: as* document.write* writes to the document
*stream*, calling *document.write* on a closed (loaded) document
automatically calls*document.open* which will clear the document
<https://developer.mozilla.org/en-US/docs/Web/API/document.open#Notes>.

[1] https://developer.mozilla.org/en-US/docs/Web/API/Document/write

On Dec 14, 2015 1:22 AM, "Gary Roach" mailto:gary719_li...@verizon.net>> wrote:

I use javascript in my  main.html (top template) to control
the access to several buttons. The buttons call a javascript
function. This setup works exactly as I wish except the
buttons still don't really do anything. I need to have each
button load a different template. The pertinent script is:


"use strict"
var bn = ""
function buttoncontrol(bn){
var i = 0;
var bx = "";
var x = []; /*array*/
if (bn=="resetDone")
{
for (var i = 0; i < 4; i++)
{
bx= "b" + (i+1);
document.getElementById(bx)
.removeAttribute("disabled");
}
return
}
else {
for (var i = 0; i < 4; i++)
{
bx= "b" + (i+1);
document.getElementById(bx)
.setAttribute("disabled", "true");
}
switch(bn) {
case "b1":
</pre><tt>document.write("<a href=
</tt><tt>'welcome.html'>'Welcome.html'</a>");
</tt><pre style="margin: 0em;">
 break;
case "b2":
break;
case "b3":
break;
case "b4":
break;
default:
document.write("fell out the bottom");
}
return;
}
  

Accessing view from javascript


Hi all

I am new to this and am really struggling with what should be a simple 
problem. I have a main.html that has javascript code. There is a switch 
statement. From the first case statement, I wish to load a template that 
is the child of main.html. I have a /home/view.py with:


def welcome(request):
return render(request, "home/welcome.html") in it.

I also have /template/home/welcome.html which is ultimately what I wish 
to have returned.


I have jQuery loaded in main.html but have no idea how to use it.

What can I put in the javascript case statement to return welcome.html.

Welcome.html is:


{% extends "home/main.html"  %}


{% block content %}
"yOU ARE IN WELCOME HTML"
 <<
{% endblock %}

There is a block content statement in the body of main.html


Gary R.

--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/5673591C.60508%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Migrate django project to eclipse/pydev ide


Hi all;

I have been working on a project for some time using Ninja-IDE. 
Unfortunately the development on Ninja has - for all practical purposes 
- stopped. It no longer works for me. I need to switch to Eclipse with 
the Pydev plugin and am having trouble finding out how to do this. I 
have looked at several howto's. So far I can follow them up to a point 
and then what shows up on the screen starts to depart from what's in the 
howto. The end result is that I can't finish the process. Also there is 
no mention of virtual environments. This worries me. I have multiple 
projects on my system.


I'm using:
Debian stretch Linux
Eclipse 3.8
pyDev 4.4.0
django 1.8,4
python 3.4
venv (not virtualenv) virtual environment
git with github repository
postgresql 9.4 dbms

Can someone point me in the right direction with this.

Gary R.

--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/5679DD71.708%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: Migrate django project to eclipse/pydev ide

To your first question, in one word $money. I would love to use PyCharm 
but I am not a commercial developer and can't see paying the freight for 
most of the commercial packages. I applied for a free version of PyCharm 
and never heard back from them. The biggest complaint with Eclipse that 
I have heard is the size of the package. I have a half terabyte of 
storage, a four processor cpu and 4 gbytes of ram expandable to 16 gB. I 
don't care if the package is functional. I'm not much of a purist in 
these matters.


Your second question is harder. Every howto I looked at was different. 
I'm sure that this is due to version changes. Bu still. So lets take the 
one at 
http://www.pydev.org/faq.html#PyDevFAQ-HowdoIimportexistingprojects/sourcesintoPyDev? 
since I am importing existing Django projects into PyDev and the project 
has never been in Eclipse we try option 1.
File > New . PyDev File > New > PyDev Project wizard and select as the 
directory the directory with your sources. So:
File (OK) > New (No pydev project wizard show ) > Project > Select a 
wizard (only Pydev shown) > dropdown PyDev .> PyDev Django Project and 
hit next. And we get a whole page full of choices  that are not covered 
in the tutorial. The next section talks about importing and setting the 
PyDev Django Project and adding 2 string sub variables ((on right click 
project > properties > PyDev PYTHONPATH) . Of course I'm still back 
there with this window with all of the choices starting with Project 
Name (easy), Project content (not sure), several selections that are 
pretty obvious and then 4 selections like Create 'src' folder and add to 
PYTHONPATH, Create link to ..., etc . By this time IV'E LOST IT. I can 
bumble along and come up with something but have no idea weather it's 
correct. This could really bite me later. Ever single howto that I have 
looked at has the same problem. I can figure out things if the howto is 
close but when big chunks have been left out? I've managed to get 
through Tango With Rango even using python 3.4 and Django 1.8 with not 
too much trouble. But this!


Like I said before, I can't afford to spend money on a commercial 
product and hope someone can point me in the right direction with 
Eclipse / PyDev.


Any help will be sincerely appreciated

Gary R.


On 12/22/2015 04:05 PM, Andrew Farrell wrote:

Could you also tell us:
1) Why you need to switch to Eclipse specifically rather than PyCharm 
<https://www.jetbrains.com/pycharm/>, SublimeText 
<http://www.sublimetext.com/>, or (the one I use) Atom 
<http://www.marinamele.com/install-and-configure-atom-editor-for-python>?

2) What error Eclipse is showing or what functionality is not working?

On Tue, Dec 22, 2015 at 5:32 PM, Gary Roach <mailto:gary719_li...@verizon.net>> wrote:


Hi all;

I have been working on a project for some time using Ninja-IDE.
Unfortunately the development on Ninja has - for all practical
purposes - stopped. It no longer works for me. I need to switch to
Eclipse with the Pydev plugin and am having trouble finding out
how to do this. I have looked at several howto's. So far I can
follow them up to a point and then what shows up on the screen
starts to depart from what's in the howto. The end result is that
I can't finish the process. Also there is no mention of virtual
environments. This worries me. I have multiple projects on my system.

I'm using:
Debian stretch Linux
Eclipse 3.8
pyDev 4.4.0
django 1.8,4
python 3.4
venv (not virtualenv) virtual environment
git with github repository
postgresql 9.4 dbms

Can someone point me in the right direction with this.

Gary R.

-- 
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+unsubscr...@googlegroups.com
<mailto:django-users%2bunsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com
<mailto:django-users@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/5679DD71.708%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


--
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+unsubscr...@googlegroups.com 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto:django-users@googlegroups.com>.

Visit this group at https://groups.google.com/gro

Re: Migrate django project to eclipse/pydev ide


On 12/22/2015 04:53 PM, Clifford Ilkay wrote:

On 22/12/15 07:05 PM, Andrew Farrell wrote:

Could you also tell us:
1) Why you need to switch to Eclipse specifically rather than PyCharm 
, SublimeText 
, or (the one I use) Atom 
?


Andrew, there are things Eclipse does that those three editors don't 
do. For example, the Mylyn plugin and how it integrates Eclipse with 
Trac is unparalleled. I also find debugging with Eclipse to be quite 
good for the odd time that I need to step through code as opposed to 
prototyping in iPython.


Gary, move your existing project to some directory outside of wherever 
your default workspace is and create a new Django PyDev project with 
the same name as your existing project. Look inside the directory that 
got created and you'll see a couple of hidden files, .project and 
.pydevproject. Move those somewhere safe, delete the new project 
directory, move the existing project directory to the default 
workspace, and move the hidden files to the project directory.


You can also import an existing project.

As for virtualenv or venv, all you have to do is go to the project 
properties, select "PyDev - Interpreter/Grammar", "Click here to 
configure an interpreter not listed." and add the Python binary for 
your venv.
Thanks for the help. I am still a little confused about venv. Since I 
lock the interpreter to the specific copy of python in the virtual 
environment for a specific project, do I still have to activate and 
deactivate venv on the command line or can I ignore this step.


Thanks for your help

Gary R

--
Regards,

Clifford Ilkay

+1 647-778-8696
--
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+unsubscr...@googlegroups.com 
.
To post to this group, send email to django-users@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/5679F095.70103%40dinamis.com 
.

For more options, visit https://groups.google.com/d/optout.


--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/568429E6.4010705%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: Is it a bad idea to start a project using Django 1.7 at this moment?

Do I detect someone using Tango With Rango as a tutorial. I agree that, 
for me, it made more sense than the other tutorials. I tried most of 
them. To bad that he hasn't updated to 1.8 and python 3 . I solved the 
problem by setting up a virtual environment using python 2.7 and django 
1.7.11 for the tutorial and another one using django 1.8 and python 3.4 
for the actual project. This works for me.


Gary R

On 01/03/2016 06:49 AM, Derek wrote:
"Explaining everything" is too much of a generalisation to be a useful 
criticism.  Django has been built incrementally, with a high degree of 
backwards-compatibility, so many older tutorials will still be valid. 
 The docs are *always* up-to-date and highlight clearly where new 
features have been added.  If you want a more tutorial-like approach, 
that also covers the latest features, then look no further than "Two 
Scoops of Django" (https://www.twoscoopspress.com/)



On Saturday, 2 January 2016 20:07:21 UTC+2, Tahmid Khan wrote:

Just a general lack of tutorials properly explaining everything I
would say. Though I could be wrong as I dont have that much
experience. Hosting in general just makes me sick.

On Saturday, January 2, 2016 at 9:01:46 PM UTC+6, Tim Graham wrote:

Yes, it's a bad idea. Django 1.7 is unsupported and no longer
receives security updates. Please use at least the Django 1.8
series (the latest is 1.8.8 as of now) which is a long-term
support release and will receive security updates until April
2018 as described at
https://www.djangoproject.com/download/#supported-versions
.

I'd be curious to hear under what circumstances using the
latest version of Django will cause headaches for hosting. It
really shouldn't affect any hosting providers as far as I know.

On Saturday, January 2, 2016 at 9:53:23 AM UTC-5, Tahmid Khan
wrote:

Hey guys, I am starting work on a website and I was
thinking if starting with Django 1.7 is a bad idea or not,
since 1.9 is out right now. With 1.7, I feel like hosting
will be less of a headache.

--
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+unsubscr...@googlegroups.com 
.
To post to this group, send email to django-users@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/33a9a579-2006-47bf-9219-eca8dfce4213%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/56898693.101%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


ImportError: No module named security

I've been trying different things with django and different tutorials. I 
was using Ninja as my IDE but had to give it up because of lack of 
support. I just switched to Eclipse with the PyDev plugin. (No I cant 
get Pycharm). The IDE is complicated but seems to do everything I wish 
it to do if I work at it long enough.


The problem:
I am working on Tango With Django tutorial and have a virtual 
environment setup with Python 2.7 and Django 1.7 . Debian Linux is still 
stuck with Eclipse 3.8 so I installed Eclipse Mars (4.5) from source. 
The project properties show that python 2.7 is sourced from the virtual 
environment's local/bin/ directory. Both Python 2.7 and Django 1.7 were 
installed in the virtual environment using pip with the no site packages 
switch. So everything should be walled off from the rest of the system. 
Further, the project was working OK until I tried to access the /admin/ 
app. It hasn't worked since.


When I run debug on the project no errors show and the internal web 
server starts fine. When I try to access either the rango/ app, the 
admin/ app or just the 127.0.0.1:8000 basic url the browser shows "A 
server error occurred.  Please contact the administrator." The Eclipse 
console shows the following:


Traceback (most recent call last):
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
self.result = application(self.environ, self.start_response)
  File 
"/home/gary/workspace/TangoWithDjango/local/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py", 
line 64, in __call__

return self.application(environ, start_response)
  File 
"/home/gary/workspace/TangoWithDjango/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py", 
line 168, in __call__

self.load_middleware()
  File 
"/home/gary/workspace/TangoWithDjango/local/lib/python2.7/site-packages/django/core/handlers/base.py", 
line 44, in load_middleware

mw_class = import_string(middleware_path)
  File 
"/home/gary/workspace/TangoWithDjango/local/lib/python2.7/site-packages/django/utils/module_loading.py", 
line 26, in import_string

module = import_module(module_path)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in 
import_module

__import__(name)
ImportError: No module named security
[05/Jan/2016 00:21:51] "GET / HTTP/1.1" 500 59

I notice that the first and last items on the traceback list are pulling 
data from the global (system) python package. I've searched the net for 
information. This problem shows up several times but It is obvious that 
no one really understands what is causing it. I rebooted the system but 
the problem persisted. Any help will be sincerely appreciated.


Gary R.



--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/568B2287.6000203%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError: No module named security(SOLVED)

Dead On knbk. I commented out the security line and the problem when 
poof. Thank you.


Gary R.

On 01/04/2016 06:29 PM, knbk wrote:
Seems like you have SecurityMiddleware in your middleware settings, 
which wasn't added until 1.8. If you started your project on 1.8+. 
your default settings file would include the new middleware and cause 
this error on 1.7.


On Tuesday, January 5, 2016 at 2:56:51 AM UTC+1, Gary Roach wrote:

I've been trying different things with django and different
tutorials. I
was using Ninja as my IDE but had to give it up because of lack of
support. I just switched to Eclipse with the PyDev plugin. (No I cant
get Pycharm). The IDE is complicated but seems to do everything I
wish
it to do if I work at it long enough.

The problem:
I am working on Tango With Django tutorial and have a virtual
environment setup with Python 2.7 and Django 1.7 . Debian Linux is
still
stuck with Eclipse 3.8 so I installed Eclipse Mars (4.5) from source.
The project properties show that python 2.7 is sourced from the
virtual
environment's local/bin/ directory. Both Python 2.7 and Django 1.7
were
installed in the virtual environment using pip with the no site
packages
switch. So everything should be walled off from the rest of the
system.
Further, the project was working OK until I tried to access the
/admin/
app. It hasn't worked since.

When I run debug on the project no errors show and the internal web
server starts fine. When I try to access either the rango/ app, the
admin/ app or just the 127.0.0.1:8000 <http://127.0.0.1:8000>
basic url the browser shows "A
server error occurred.  Please contact the administrator." The
Eclipse
console shows the following:

Traceback (most recent call last):
   File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
 self.result = application(self.environ, self.start_response)
   File

"/home/gary/workspace/TangoWithDjango/local/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py",

line 64, in __call__
 return self.application(environ, start_response)
   File

"/home/gary/workspace/TangoWithDjango/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py",

line 168, in __call__
 self.load_middleware()
   File

"/home/gary/workspace/TangoWithDjango/local/lib/python2.7/site-packages/django/core/handlers/base.py",

line 44, in load_middleware
 mw_class = import_string(middleware_path)
   File

"/home/gary/workspace/TangoWithDjango/local/lib/python2.7/site-packages/django/utils/module_loading.py",

line 26, in import_string
 module = import_module(module_path)
   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in
import_module
 __import__(name)
ImportError: No module named security
[05/Jan/2016 00:21:51] "GET / HTTP/1.1" 500 59

I notice that the first and last items on the traceback list are
pulling
data from the global (system) python package. I've searched the
net for
information. This problem shows up several times but It is obvious
that
no one really understands what is causing it. I rebooted the
system but
the problem persisted. Any help will be sincerely appreciated.

Gary R.





--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/568B3244.8070704%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Trouble getting posted

I have tried to post a couple of things in the last few days with no 
results. My posts are  never returned to me. So this is another test.


Gary R

--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/57094E0B.6080408%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: Trouble getting posted


On 04/09/2016 02:37 PM, jorrit...@gmail.com wrote:

Did you subscribe to the topics you posted?

Have been for months. This is a new problem but seems to not be a 
problem with this site. The trouble seems to be unique to the Debian 
User site. Thanks for your reply.


Gary R.

--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/570980ED.1030304%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: Trouble getting posted

Actually James, I don't think that is true. I run a group for a project 
and have no trouble getting returns on my posts. This is a feature that 
can be turned on/off a I recall. I have no trouble getting my posts 
returned with this site but only with my debian-user site. I think the 
trouble is with that site and have informed them as such. I hope I have 
not misunderstood your statement, but Google Groups does return the 
original post. The original post essentially sets up a new topic to 
which others can append comments. For my own group, I found that setting 
up categories and forcing the participants to post by logging into the 
group works best. But that is a special case and would be a mess for a 
large users  group.


Gary R.

On 04/09/2016 03:47 PM, James Schneider wrote:


>
> I have tried to post a couple of things in the last few days with no 
results. My posts are  never returned to me. So this is another test.

>

Google Groups does not send the post back to the OP, which is 
annoying, confusing and non-intuitive, and not configurable AFAIK.


-James

--
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+unsubscr...@googlegroups.com 
.
To post to this group, send email to django-users@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/CA%2Be%2BciVB2d8k0xBF7BpS8H7Yho-r5JvZcLOf-EuzQSK-AehgdQ%40mail.gmail.com 
.

For more options, visit https://groups.google.com/d/optout.


--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/570A9D29.7010303%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: Trouble getting posted


James

My original post was a test to see whether I had a global problem which 
I didn't. The rest is just a  discussion that ensued. ie Off topic by 
accident.


One last comment. I use a Debian Linux system with Mozilla's firebird 
email client. No insults intended but I stay as far away from Microsoft 
as I can.


Yours very opinionated

Gary R

On 04/10/2016 10:57 PM, James Schneider wrote:


Actually James, I don't think that is true. I run a group for a
project and have no trouble getting returns on my posts. This is a
feature that can be turned on/off a I recall. I have no trouble
getting my posts returned with this site but only with my
debian-user site. I think the trouble is with that site and have
informed them as such. I hope I have not misunderstood your
statement, but Google Groups does return the original post. The
original post essentially sets up a new



W...it may "appear" that way if you are using the web or 
mobile GMail email client (which I assume most people on this list 
do). GMail/Google does some funny business with Google Groups 
integration to make everything seem integrated and would have you 
believe that you are in fact receiving a copy of the message (does it 
really matter if your response just 'appears' in the right spot, 
though?). After a quick Google to confirm my own sanity, it appears 
that the GMail clients will automatically thread messages with the 
same Message-ID, even if they live in different folders (and in this 
instance, it would be my Primary inbox, and my Sent Items).


However, this account is also tied to an MS Outlook instance, and 
unless MS is doing something funny with my replies to this group, I 
have no copies of this response in my Inbox. I'm not claiming to be an 
Outlook wizard, but I don't believe I have any rules set up for this 
account, so I doubt Outlook is to blame.


You can also Google around to see others echoing concerns about the 
same "odd" behavior that Google Groups uses. Personally I think it is 
a passive attempt by Google to encourage you to use GMail, and also 
cuts down (marginally) the amount of email they send out. It's 
certainly one of the reasons I keep using the web interface and mobile 
app over my MS Outlook client.


It may be configurable (perhaps only by the list admin), but I seem to 
remember researching this same issue when I first posted to 
django-users, and was confused when I didn't see my response come back 
(GMail's integration was not as good at the time IIRC). I think I 
double-posted for that exact reason.
Perhaps someone else can confirm the behavior I'm describing, or echo 
that I'm crazy. I'm good either way.


topic to which others can append comments. For my own group, I
found that setting up categories and forcing the participants to
post by logging into the group works best. But that is a special
case and would be a mess for a large users  group.


Not sure why logging in to a group interface would have any effect on 
mail routing. I suppose it would be 'easier' to tie together threads 
that are posted directly to a forum/thread form than trying to 
correlate a random email address with the same subject line. Pure guess.
On a side note, you also mentioned an issue specifically with the 
Debian Users list, which this list is not. Other than maybe a "me too" 
response, I'm not exactly sure what the intention of the message to 
this list was about. I'm sure many of us are on that list as well, though.


-James
--
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+unsubscr...@googlegroups.com 
.
To post to this group, send email to django-users@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/CA%2Be%2BciW1O3ECV2AqaORPkM3Zngn%3DxkpzxtFr1gyB9%3D_PXMTx_w%40mail.gmail.com 
.

For more options, visit https://groups.google.com/d/optout.


--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/570C6B1D.5050306%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: Disappearing desktop icons

Sure did. Debian-list is just above Django list on my main client 
filter. Sorry


Gary R.

On 04/21/2016 08:24 PM, Mario Gudelj wrote:

I think you're posting this to a wrong list Gary. This od django list.

On Friday, 22 April 2016, Gary Roach <mailto:gary719_li...@verizon.net>> wrote:


Debian Stretch system
amd64 system

A couple of weeks  ago I updated my system and all of my desktop
icons start looking as shown in attachment.

Anyone have an idea what could cause this. I have looked thru the
log files and have found nothing. Rebooting doesn't help.

Gary R.

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/57198E16.6000606%40verizon.net.
For more options, visit https://groups.google.com/d/optout.

--
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+unsubscr...@googlegroups.com 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto:django-users@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/CAHqTbj%3DLoA8GdQjohk9Tyfaah0Ek_70LfKQ4ubPzpOhKVADNAg%40mail.gmail.com 
<https://groups.google.com/d/msgid/django-users/CAHqTbj%3DLoA8GdQjohk9Tyfaah0Ek_70LfKQ4ubPzpOhKVADNAg%40mail.gmail.com?utm_medium=email&utm_source=footer>.

For more options, visit https://groups.google.com/d/optout.


--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/5719CCDF.4060905%40verizon.net.
For more options, visit https://groups.google.com/d/optout.