Re: testing newbie - help requested: app works, tests give errors

2023-05-10 Thread 'Bob Aalsma' via Django users
Hmm, when I remove the raise CommandError statement and replace it with 
self.stdout.write, everything works well.

This helps me to point further studies. Thx!
On Wednesday, May 10, 2023 at 2:33:18 PM UTC+2 Bob Aalsma wrote:

> Ah, yes, thanks.
>
> I hesitate to comment on "If I understood the error right." ;)
>
> Umm, my problem here is that I think I'm using the exact same *code* 
> "manually" without errors. 
> I think I'm also using the same *values* for the manual and test runs.
> So I don't understand the reason for the differences in output.
>
> On Wednesday, May 10, 2023 at 2:18:33 PM UTC+2 Vishesh Mangla wrote:
>
>> If I understood the error right.
>>
>> On Wed, May 10, 2023 at 5:47 PM Vishesh Mangla  
>> wrote:
>>
>>> Probably this would help: 
>>> https://stackoverflow.com/questions/8609192/what-is-the-difference-between-null-true-and-blank-true-in-django
>>>
>>> On Wed, May 10, 2023 at 5:45 PM 'Bob Aalsma' via Django users <
>>> django...@googlegroups.com> wrote:
>>>
>>>> Sorry Vishesh, thanks for the quick answer but I have no idea what you 
>>>> mean.
>>>>
>>>> On Wednesday, May 10, 2023 at 2:00:51 PM UTC+2 Vishesh Mangla wrote:
>>>>
>>>>> False or True check for yourself.
>>>>>
>>>>> On Wed, 10 May, 2023, 17:29 Vishesh Mangla,  
>>>>> wrote:
>>>>>
>>>>>> It looks like you are passing a null but null=False is not set
>>>>>>
>>>>>> On Wed, 10 May, 2023, 17:27 'Bob Aalsma' via Django users, <
>>>>>> django...@googlegroups.com> wrote:
>>>>>>
>>>>>>> I'm trying to test a django-admin command and don't understand why 
>>>>>>> the tests give errors on the code while the code works as expected.
>>>>>>>
>>>>>>> I'm under the impression that the *raise CommandError* is ignored 
>>>>>>> by the test, but don't understand why this would be.
>>>>>>>
>>>>>>> Please help.
>>>>>>>
>>>>>>> Running the code shows:
>>>>>>>
>>>>>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
>>>>>>> populate_source 0
>>>>>>>
>>>>>>> *CommandError: Alleen hele getallen > 0 toegestaan*
>>>>>>>
>>>>>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
>>>>>>> populate_source 1
>>>>>>>
>>>>>>> *Teksten zijn gegenereerd voor tekstlengte 1*
>>>>>>>
>>>>>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
>>>>>>> populate_source 1
>>>>>>>
>>>>>>> *CommandError: Teksten voor nummer 1 zijn al eerder gegenereerd*
>>>>>>>
>>>>>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
>>>>>>> populate_source 7
>>>>>>>
>>>>>>> *CommandError: Opgegeven sleutel 7 niet gevonden*
>>>>>>>
>>>>>>> Running the tests shows
>>>>>>>
>>>>>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
>>>>>>> test tests.test_sources_app_command_populate
>>>>>>>
>>>>>>> Found 3 test(s).
>>>>>>>
>>>>>>> Creating test database for alias 'default'...
>>>>>>>
>>>>>>> System check identified no issues (0 silenced).
>>>>>>>
>>>>>>> EEE
>>>>>>>
>>>>>>>
>>>>>>> ==
>>>>>>>
>>>>>>> ERROR: test_command_output_been_there 
>>>>>>> (tests.test_sources_app_command_populate.PopulateSourceTests.test_command_output_been_there)
>>>>>>>
>>>>>>> Test for failure: in_use = True.
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>>
>>>>>>> Traceback (most recent call last):
>>>>>>>
>>>>>>>   File 
>>>>>>> "/Users/

Re: testing newbie - help requested: app works, tests give errors

2023-05-10 Thread 'Bob Aalsma' via Django users
Ah, yes, thanks.

I hesitate to comment on "If I understood the error right." ;)

Umm, my problem here is that I think I'm using the exact same *code* 
"manually" without errors. 
I think I'm also using the same *values* for the manual and test runs.
So I don't understand the reason for the differences in output.

On Wednesday, May 10, 2023 at 2:18:33 PM UTC+2 Vishesh Mangla wrote:

> If I understood the error right.
>
> On Wed, May 10, 2023 at 5:47 PM Vishesh Mangla  
> wrote:
>
>> Probably this would help: 
>> https://stackoverflow.com/questions/8609192/what-is-the-difference-between-null-true-and-blank-true-in-django
>>
>> On Wed, May 10, 2023 at 5:45 PM 'Bob Aalsma' via Django users <
>> django...@googlegroups.com> wrote:
>>
>>> Sorry Vishesh, thanks for the quick answer but I have no idea what you 
>>> mean.
>>>
>>> On Wednesday, May 10, 2023 at 2:00:51 PM UTC+2 Vishesh Mangla wrote:
>>>
>>>> False or True check for yourself.
>>>>
>>>> On Wed, 10 May, 2023, 17:29 Vishesh Mangla,  
>>>> wrote:
>>>>
>>>>> It looks like you are passing a null but null=False is not set
>>>>>
>>>>> On Wed, 10 May, 2023, 17:27 'Bob Aalsma' via Django users, <
>>>>> django...@googlegroups.com> wrote:
>>>>>
>>>>>> I'm trying to test a django-admin command and don't understand why 
>>>>>> the tests give errors on the code while the code works as expected.
>>>>>>
>>>>>> I'm under the impression that the *raise CommandError* is ignored by 
>>>>>> the test, but don't understand why this would be.
>>>>>>
>>>>>> Please help.
>>>>>>
>>>>>> Running the code shows:
>>>>>>
>>>>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
>>>>>> populate_source 0
>>>>>>
>>>>>> *CommandError: Alleen hele getallen > 0 toegestaan*
>>>>>>
>>>>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
>>>>>> populate_source 1
>>>>>>
>>>>>> *Teksten zijn gegenereerd voor tekstlengte 1*
>>>>>>
>>>>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
>>>>>> populate_source 1
>>>>>>
>>>>>> *CommandError: Teksten voor nummer 1 zijn al eerder gegenereerd*
>>>>>>
>>>>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
>>>>>> populate_source 7
>>>>>>
>>>>>> *CommandError: Opgegeven sleutel 7 niet gevonden*
>>>>>>
>>>>>> Running the tests shows
>>>>>>
>>>>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
>>>>>> test tests.test_sources_app_command_populate
>>>>>>
>>>>>> Found 3 test(s).
>>>>>>
>>>>>> Creating test database for alias 'default'...
>>>>>>
>>>>>> System check identified no issues (0 silenced).
>>>>>>
>>>>>> EEE
>>>>>>
>>>>>> ==
>>>>>>
>>>>>> ERROR: test_command_output_been_there 
>>>>>> (tests.test_sources_app_command_populate.PopulateSourceTests.test_command_output_been_there)
>>>>>>
>>>>>> Test for failure: in_use = True.
>>>>>>
>>>>>> --
>>>>>>
>>>>>> Traceback (most recent call last):
>>>>>>
>>>>>>   File 
>>>>>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/utils.py",
>>>>>>  
>>>>>> line 89, in _execute
>>>>>>
>>>>>> return self.cursor.execute(sql, params)
>>>>>>
>>>>>>
>>>>>>
>>>>>>   File 
>>>>>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/sqlite3/base.py",
>>>>>>  
>>>>>> line 328, in execute
>>>>>&

Re: testing newbie - help requested: app works, tests give errors

2023-05-10 Thread 'Bob Aalsma' via Django users
Sorry Vishesh, thanks for the quick answer but I have no idea what you mean.

On Wednesday, May 10, 2023 at 2:00:51 PM UTC+2 Vishesh Mangla wrote:

> False or True check for yourself.
>
> On Wed, 10 May, 2023, 17:29 Vishesh Mangla,  wrote:
>
>> It looks like you are passing a null but null=False is not set
>>
>> On Wed, 10 May, 2023, 17:27 'Bob Aalsma' via Django users, <
>> django...@googlegroups.com> wrote:
>>
>>> I'm trying to test a django-admin command and don't understand why the 
>>> tests give errors on the code while the code works as expected.
>>>
>>> I'm under the impression that the *raise CommandError* is ignored by 
>>> the test, but don't understand why this would be.
>>>
>>> Please help.
>>>
>>> Running the code shows:
>>>
>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
>>> populate_source 0
>>>
>>> *CommandError: Alleen hele getallen > 0 toegestaan*
>>>
>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
>>> populate_source 1
>>>
>>> *Teksten zijn gegenereerd voor tekstlengte 1*
>>>
>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
>>> populate_source 1
>>>
>>> *CommandError: Teksten voor nummer 1 zijn al eerder gegenereerd*
>>>
>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py 
>>> populate_source 7
>>>
>>> *CommandError: Opgegeven sleutel 7 niet gevonden*
>>>
>>> Running the tests shows
>>>
>>> (.venv) werker@Werkers-Mac-mini domain_reader % python3 manage.py test 
>>> tests.test_sources_app_command_populate
>>>
>>> Found 3 test(s).
>>>
>>> Creating test database for alias 'default'...
>>>
>>> System check identified no issues (0 silenced).
>>>
>>> EEE
>>>
>>> ==
>>>
>>> ERROR: test_command_output_been_there 
>>> (tests.test_sources_app_command_populate.PopulateSourceTests.test_command_output_been_there)
>>>
>>> Test for failure: in_use = True.
>>>
>>> --
>>>
>>> Traceback (most recent call last):
>>>
>>>   File 
>>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/utils.py",
>>>  
>>> line 89, in _execute
>>>
>>> return self.cursor.execute(sql, params)
>>>
>>>
>>>
>>>   File 
>>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/sqlite3/base.py",
>>>  
>>> line 328, in execute
>>>
>>> return super().execute(query, params)
>>>
>>>^^
>>>
>>> sqlite3.IntegrityError: NOT NULL constraint failed: 
>>> domain_sources_app_characternumber.number_of_combinations
>>>
>>>
>>> The above exception was the direct cause of the following exception:
>>>
>>>
>>> Traceback (most recent call last):
>>>
>>>   File 
>>> "/Users/werker/Projects/domain_reader/tests/test_sources_app_command_populate.py",
>>>  
>>> line 30, in test_command_output_been_there
>>>
>>> thingy.save()
>>>
>>>   File 
>>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
>>>  
>>> line 814, in save
>>>
>>> self.save_base(
>>>
>>>   File 
>>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
>>>  
>>> line 877, in save_base
>>>
>>> updated = self._save_table(
>>>
>>>   ^
>>>
>>>   File 
>>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
>>>  
>>> line 1020, in _save_table
>>>
>>> results = self._do_insert(
>>>
>>>   
>>>
>>>   File 
>>> "/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/models/base.py",
>>>  
>>> line 1061, in _do_insert
&g

testing newbie - help requested: app works, tests give errors

2023-05-10 Thread 'Bob Aalsma' via Django users
e 84, in _execute

with self.db.wrap_database_errors:

  File 
"/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/utils.py",
 
line 91, in __exit__

raise dj_exc_value.with_traceback(traceback) from exc_value

  File 
"/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/utils.py",
 
line 89, in _execute

return self.cursor.execute(sql, params)

   

  File 
"/Users/werker/Projects/domain_reader/.venv/lib/python3.11/site-packages/django/db/backends/sqlite3/base.py",
 
line 328, in execute

return super().execute(query, params)

   ^^

django.db.utils.IntegrityError: NOT NULL constraint failed: 
domain_sources_app_characternumber.number_of_combinations


--

Ran 3 tests in 0.008s


FAILED (errors=3)

Destroying test database for alias 'default'...

Code for test:
from io import StringIO

from django.core.management import call_command
from django.test import TestCase

from domain_sources_app.models import CharacterNumber


class PopulateSourceTests(TestCase):
"""Testcases for Django-admin command populate_source."""
def test_command_output_small(self):
"""Test for failure with value '0'."""
out = StringIO()
call_command("populate_source", 0, stdout=out)
self.assertIn("Alleen hele getallen > 0 toegestaan", out.getvalue())

def test_command_output_been_there(self):
"""Test for failure: in_use = True."""

thingy = CharacterNumber(
number_of_characters=1,
in_use=True,
)
thingy.save()

out = StringIO()
call_command(
"populate_source",
1,
stdout=out,
)
self.assertIn("Teksten voor nummer 1 zijn al \
eerder gegenereerd", out.getvalue())

def test_command_output_success(self):
"""Test for success: in_use = False."""

thingy = CharacterNumber(
number_of_characters=1,
in_use=False,
)
thingy.save()

out = StringIO()
call_command(
"populate_source",
1,
stdout=out,
)
self.assertIn("Teksten gegenereerd voor nummer 1", out.getvalue())



Code for the command:
from django.core.management.base import BaseCommand
from django.core.management.base import CommandError

from domain_sources_app.models import CharacterNumber
from domain_sources_app.generate_domain_strings import 
generate_domain_strings


class Command(BaseCommand):
"""Populate Result with inital strings of
a certain length.

Args:
BaseCommand (_type_): _description_

Raises:
CommandError: _description_
"""
help = "Genereert de te onderzoeken combinaties bij de opgegeven lengte"

def add_arguments(self, parser):
parser.add_argument("character_number_ids", nargs="+", type=int)

def handle(self, *args, **options):
for character_number_id in options["character_number_ids"]:
if character_number_id < 1:
raise CommandError('Alleen hele getallen > 0 toegestaan')
else:
try:
thingy = CharacterNumber.objects.get(
pk=character_number_id
)
except CharacterNumber.DoesNotExist:
raise CommandError(
f'Opgegeven sleutel {character_number_id} \
niet gevonden')

if not thingy.in_use:
# generate for this number:
generate_domain_strings(character_number_id)
# register use of CharacterNumber
thingy.in_use = True
thingy.save()

self.stdout.write(
self.style.SUCCESS(
f'Teksten zijn gegenereerd voor \
tekstlengte {character_number_id}'
)
)
else:
raise CommandError(
f'Teksten voor nummer {character_number_id} zijn al \
eerder gegenereerd'
)




Thanks,
Bob

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1d0ce155-35e7-4049-88d4-80124c83dedcn%40googlegroups.com.


Re: Discrepancy in rendering of content_subtitle block

2022-02-07 Thread Bob Kline
I figured it out. Before cloning the site I had upgraded from 3.1 to 3.2. 
After the upgrade I had stopped and restarted nginx, but I had not bounced 
the uwsgi daemon which was caching the older version of Django (not the 
first time I've been bitten by that, so shame on me, I have no excuse ). 
Once I did that, the behavior of the original server mirrored that of the 
cloned test server.

So somewhere between 3.1 and 3.2 the was a behavior change which added the 
display of a subtitle where there had been none before. Oddly, I went 
through every page of release notes between 3.1.0 and 3.2.0 and the string 
"subtitle" doesn't appear on any of those pages. If there was a mention of 
this very visible, non-trivial change using other wording, I missed it. So 
now I'm off to figure out the best way to suppress this new subtitle. 
Ideally there's a configuration setting which will do the trick, but I 
looked at the code and the docs and nothing jumped out at me, so it looks 
as if I'll just have to add some custom CSS.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6517c7c6-2087-4898-9289-b8934a8ba403n%40googlegroups.com.


Re: Discrepancy in rendering of content_subtitle block

2022-02-07 Thread Bob Kline
A few more data points:

   - no errors are shown in the browser's developer tools console for 
   either instance of the site
   - no resources are shown as having failed to load in the browser's 
   developer tools network tab
   - no errors are logged by either web server

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6c94b199-5b04-40b6-bb31-0cd8f516e88en%40googlegroups.com.


Re: Off topic slightly - Apache https redirect

2022-02-07 Thread Bob Kline
On Sunday, February 6, 2022 at 9:12:38 PM UTC-5 Mike Dewhirst wrote:

> There seems to be a multitude of ways to redirect from http to https.
> Any pointers to the absolutely correct way?
>
>
How about something like this?

 
  ServerName example.com
  ServerAlias www.example.com
  Redirect permanent / https://example.com/


  ...


 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c8c8177d-49c0-45f7-b382-31855ccb6b0an%40googlegroups.com.


Discrepancy in rendering of content_subtitle block

2022-02-07 Thread Bob Kline
I have a Django site I've been running for years (since before the 1.x 
days). Right now it's running 3.2 and I have "cloned" it to another Ubuntu 
20.4 server so that I can test the upgrade to 4.x. The cloning process 
involved:

   - pushing the site's code to a private GitHub repo
   - git clone to pull the code down to the second server
   - create a virtual Python environment
   - in the new environment: pip install -r requirements.txt
   - create the MySQL database and populate it from last night's backup

The version of Python is identical between the two servers (3.8.10, built 
Nov 26 2021, 20:14:08 with GCC 9.3.0 on linux). The version of Django is 
identical (3.2). The MySQL database server is at the same version 
(8.0.28-0ubuntu0.20.04.3) The site looks and behaves *exactly* the same, 
feature for feature, pixel for pixel, between the two instances with one 
puzzling exception. On the cloned site, an ... subtitle appears 
between the ... title (for example, "Change invoice") and the div 
containing the form's fields when editing an existing record for any record 
type. This subtitle does not appear on the form page for a new record, and 
(here's the puzzle) it does not appear on the form page for *any* record, 
new or existing, on the original site. I have tracked down the template 
which renders the subtitle to 
django/contrib/admin/templates/admin/base.html, line 89.

{% block content_subtitle %}{% if subtitle %}{{ subtitle }}{% 
endif %}{% endblock %}

What's the best way to go about figuring out why {% if subtitle %} would be 
true on the cloned site, but false on the original site? I'll feel a lot 
more like the testing of the upgrade is on a solid footing if the existing 
3.2 instances start off behaving identically.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a4f11de0-abb4-415e-b3e8-a831c8e33627n%40googlegroups.com.


Re:

2019-11-20 Thread Bob Gailer
On Nov 20, 2019 10:27 AM, "Paras Jain"  wrote:
>
> how to take pass one object of one function to other in django

I do not understand your question. Perhaps someone else will understand it
and give you the answer you're seeking. If you don't get an answer please
try restating your question or give us an example of what you're trying to
do.

Bob Gailer

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAP1rxO4fZcKofjNFkF9VNkW%3DMPrRD%3DcBfOz8xKq-z2_HcHqhKA%40mail.gmail.com.


Re: how to login to Django

2019-11-05 Thread Bob Gailer
Please always provide a subject in your email.

Your question unfortunately is vague could you flesh it out with more
detail?

On Nov 5, 2019 8:00 AM, "Suraj Thapa FC"  wrote:

Send it then

On Tue, 5 Nov 2019, 5:38 pm Paras Jain,  wrote:

> on hitting submit i have to send email and password to user email id which
> will be used for login in 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 view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAMtmBS8KETpX74D8nRpPiDdnb_GYSeHYGgc3c_6TVgA15dKa4g%
> 40mail.gmail.com
> 
> .
>
-- 
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/django-users/CAPjsHcFZSKeebvqZe7_Eyiz5gJF6dmBv9o-
S6ef5rqLVj5SSjw%40mail.gmail.com

.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAP1rxO6PDDDkWgOgB0iizq1%2B%3DXH89ZLRCBV29LdPuragxVMrcg%40mail.gmail.com.


Re: backend for Arduino

2019-11-05 Thread Bob Gailer
Google hotbot Arduino.

On Nov 5, 2019 8:02 AM, "Pranjul Kimothi"  wrote:

> How Can I use Django as backend for an Arduino application .?? Any
> suggestions
>
> --
> 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 view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAH8L0J4U%2BzLcuKVKMcQSaYGwWBYza1KMW5z%
> 3DCfYX%3DV53VnoGbw%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAP1rxO7vbRds%2BKbxXYUvUgh_MceDfSz9CeNkGmxyGF%2BzX0UroQ%40mail.gmail.com.


Re:

2019-06-25 Thread Bob Gailer
Oh goodie. When will they be delivered?

On Jun 25, 2019 2:53 AM, "Benjamin SOULAS" 
wrote:

> --
> 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/CABG7fFXkw1G7ZG6XrJYjuEGuZFS0WpX%2BVxSdS3i2JXu9m9Upag%
> 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/CAP1rxO70z0TnsXPQgTkKFLMP7MxPb6D%2BuxbwE3sYm%2Bh8KfUN%2Bw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Bugs: cannot start runserver since Django 2.2.2

2019-06-05 Thread Bob Voorneveld
Since the security fix there were 2 problems:

The package cryptography is required (wasn't before updating the pip 
package). I'm running Django 2.2.2 with Daphne 2.3.0. See stacktrace:

Loading .env environment variables…
[05/Jun/2019 15:05:43] INFO [django.utils.autoreload:584] Watching for file 
changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/threading.py", line 917, in 
_bootstrap_inner
self.run()
  File "/usr/local/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/utils/autoreload.py"
, line 54, in wrapper
fn(*args, **kwargs)
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/core/management/commands/runserver.py"
, line 109, in inner_run
autoreload.raise_last_exception()
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/utils/autoreload.py"
, line 77, in raise_last_exception
raise _exception[1]
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/core/management/__init__.py"
, line 337, in execute
autoreload.check_errors(django.setup)()
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/utils/autoreload.py"
, line 54, in wrapper
fn(*args, **kwargs)
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/__init__.py"
, line 24, in setup
apps.populate(settings.INSTALLED_APPS)
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/apps/registry.py"
, line 91, in populate
app_config = AppConfig.create(entry)
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/apps/config.py"
, line 116, in create
mod = import_module(mod_path)
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/importlib/__init__.py"
, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 1006, in _gcd_import
  File "", line 983, in _find_and_load
  File "", line 967, in _find_and_load_unlocked
  File "", line 677, in _load_unlocked
  File "", line 728, in exec_module
  File "", line 219, in 
_call_with_frames_removed
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/channels/apps.py"
, line 6, in 
import daphne.server
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/daphne/server.py"
, line 32, in 
from .ws_protocol import WebSocketFactory
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/daphne/ws_protocol.py"
, line 6, in 
from autobahn.twisted.websocket import (
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/autobahn/twisted/__init__.py"
, line 58, in 
from autobahn.twisted.wamp import ApplicationSession
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/autobahn/twisted/wamp.py"
, line 50, in 
from autobahn.wamp import protocol, auth
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/autobahn/wamp/auth.py"
, line 43, in 
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
ModuleNotFoundError: No module named 'cryptography'




Installing the package fixed the above, but couldn't find any required 
dependencies for the package?

Another one is that starting runserver, it crashes immediately. This is the 
stacktrace. Maybe something broke with StatReloader? I'm running Django in 
a docker-compose environment.

As a workaround I reverted back to Django 2.2.1, please let me know how the 
latest problem can be mitigated. And I'm curious how cryptography is 
suddenly required.

Loading .env environment variables…
[05/Jun/2019 15:28:12] INFO [django.utils.autoreload:584] Watching for file 
changes with StatReloader
Performing system checks...
Traceback (most recent call last):

  File "manage.py", line 15, in 
execute_from_command_line(sys.argv)
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/core/management/__init__.py"
, line 381, in execute_from_command_line
utility.execute()
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/core/management/__init__.py"
, line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/core/management/base.py"
, line 323, in run_from_argv
self.execute(*args, **cmd_options)
  File 

Re: AutoField

2019-05-26 Thread Bob Gailer
On May 26, 2019 8:16 PM, "Saeed Pooladzadeh"  wrote:
>
>
> Hi
>
> When I add this line in my model:
>
> eid=models.AutoField()
>
> I see error in my migration!!
>
> What is the problem?
>
> I don't know what your problem is but our problem is that we have no idea
what error you got. Please copy and paste the entire error message into
your reply and also reply all so that everyone gets to read your response
stop

-- 
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/CAP1rxO7ROcWYL9LYO4XMt8_gHmgd74gMJ%3D0yo2pjdegkNekZfQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Working with Databases

2019-05-26 Thread Bob Gailer
Miscellaneous thoughts follow in no particular order.

I always like to start with some kind of entity relationship (ER) diagram.
This makes it easy to visualize the overall structure of things.

Read the description in the Django Docs of JSONfields. They don't really do
what you want.

I think what you want instead is what I call  an association table.

Your problem description is somewhat scattered and hard to follow. A good
ER diagram will help clean that up.

I suggest you start with a subset of your problem, one that can be easily
diagrammed and programmed. Once you get that working then consider adding
another piece of the puzzle.

Regarding data entry forms: consider drawing a diagram or what sometimes we
call wireframe description of the form.

In several places you refer to weighting but you never describe the actual
algorithm for weighting.

Since I'm dictating this to my mobile phone it's hard to refer back to your
original email. So I will end here and perhaps write more later.

Thank you for starting this discussion. Please let me know your thoughts
regarding my comments.

Bob gailer

-- 
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/CAP1rxO57oH%2BzC%3D1mfQQiaLn%3Dw46TLetVD4iqSGSGe-wRethfRA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: TypeError

2019-05-22 Thread Bob Gailer
On May 22, 2019 6:09 AM, "Soumen Khatua"  wrote:
>
> Hi Folks,
>
> I'm getting this error "TypeError:" everytime, Can You guys tell me where
is the problem in this code.

it would help us a lot if you would copy the entire traceback and paste it
into an email reply.

> Cart
>
> views.py
> @require_POST
> def cart_add(request,product_id):
> cart = Cart(request)
> product = get_object_or_404(Product,id  = product_id)
> form = forms.CartAddProductForm(request.POST)
> if form.is_valid():
> cd  = form.cleaned_data
> cart.add(
>product = product,
>quantity = cd['quantity'],
>update_quantity = cd['update'])
> return redirect('cart:cart_detail')
>
>
> def cart_detail(request):
> cart = Cart(request)
> return render (request,'cart/cartdetail.html',{'cart':cart})
>
>
>
> cartdetail.html:
> {% for item in cart %}
> {{ item.quantity }}
> {% endfor %}
>
> --
> 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/CAPUw6WYVTQWq-5WtiMo6HekSmaw6%2BRCxfRu4wbFF9BgYaDsPqg%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/CAP1rxO6ck3Mg1w6Rz_TjZq51G06brVK08zHa4_XtehA%2BKn78Kg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: ORM help with INNER JOIN and GROUP BY

2019-05-06 Thread bob
class Monolithic(models.Model):
facepng_id = models.IntegerField(blank=True, null=True)


facepng_id as Integer not ForeignKey?


> UPDATE items_monolithic SET facepng_id=items_monolithic.id FROM 
items_monolithic INNER JOIN items_facepng ON 
items_monolithic.object=items_facepng.obj ;
Error: near "from": syntax error
 
I'll keep working on the code.

Add a facepng_id Integer Field to Monolith. Run makemigrations. Add a 
> RunSQL command to the new migrations file (
> https://docs.djangoproject.com/en/2.2/ref/migration-operations/#runsql).  
> Something like this:
>
> Update items_monolith SET facepng_id=items_monolith.id FROM 
> items_monolith INNER JOIN items_facepng ON 
> items_monolith.object=items_facepng.obj 
>
>  
>
> Then delete the object and obj fields from the models. Run makemigrations 
> again. Verify that your app doesn’t reference those fields anywhere else.
>
>  
>
> Then you could access facepng like so:
>
> monolithic.facepng_set
>
>  
>
> Of course, this is just a very rough idea of what to do, and I’m not sure 
> what the whole structure of your tables is.
>
>  
>
> *From:* django...@googlegroups.com  [mailto:
> django...@googlegroups.com ] *On Behalf Of *b...@tanners.org 
> 
> *Sent:* Monday, May 6, 2019 11:28 AM
> *To:* Django users
> *Subject:* ORM help with INNER JOIN and GROUP BY
>
>  
>
> I've inherited an application written django 1.11. The old application 
> uses raw() with INNER JOIN and GROUP BY. 
>
>  I cannot seem to figure out how to do inner join and group by properly 
> the ORM way.
>
>  
>
> The raw() query is below.
>
>  
>
> SELECT  * FROM items_monolithic
>
> INNER JOIN items_facepng
>
> ON items_monolithic.object == items_facepng.obj
>
> GROUP BY items_monolithic.object
>
> ORDER BY object ASC
>
>  
>
>  
>
> Things kind of work with raw() but that doesn't feel right. And I get 
> nasty warnings about RawQuerySet not supporting certain things when I try 
> to use the query set that is returned.
>
>  
>
> From what I understand every monolithic object has 1 or more faces 
> (graphic/picture).
>
>  
>
> I would call the monolithic a one-to-many relationship with facepng but I 
> see django calls this a ForeignKey.
>
>  
>
> I'm working with these models (yes, a field named object is "bad", it's 
> what I was given)
>
>  
>
>  
>
> class Monolithic(models.Model):
>
>object = models.CharField(max_length=128, blank=False, null=False, 
> unique=True)
>
>  
>
> class FacePng(models.Model):
>
> obj = models.CharField(max_length=128, blank=True, null=True)
>
>  
>
>  
>
> I do not see the ForeignKey relationship between Monolithic and FacePng. 
>
>  
>
> Changing Monolithic class to models.ForeignKey() breaks lots of things.
>
>  
>
> So I'd prefer to figure out how to do the inner join and group by query 
> but if that's not the django way and I need to change Monolithic.objects to 
> a ForeignKey() and fix all the stuff that is broken I can do that that too. 
>
>  
>
> Just need some guidance on how to proceed.
>
>  
>
>  
>
>  
>
> -- 
> 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...@googlegroups.com .
> To post to this group, send email to djang...@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/ab7ecf5b-9ae8-4428-9502-6b7d5dec03b5%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/7af29fa6-5cfc-4bda-a471-ed8ee26b37ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ORM help with INNER JOIN and GROUP BY

2019-05-06 Thread bob
Just want to make sure I understand. ForeighKeys need to be integers?

Only integers?


You need a ForeignKey relationship between the two models, which is an 
> integer value, not a char. You’d have to do migrations to get this adjusted 
> properly.  
>

-- 
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/9697de34-3d20-4023-81a7-8ea9f257f7f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


ORM help with INNER JOIN and GROUP BY

2019-05-06 Thread bob
I've inherited an application written django 1.11. The old application uses 
raw() with INNER JOIN and GROUP BY. 
 I cannot seem to figure out how to do inner join and group by properly the 
ORM way.

The raw() query is below.

SELECT * FROM items_monolithic
INNER JOIN items_facepng
ON items_monolithic.object == items_facepng.obj
GROUP BY items_monolithic.object
ORDER BY object ASC


Things kind of work with raw() but that doesn't feel right. And I get nasty 
warnings about RawQuerySet not supporting certain things when I try to use 
the query set that is returned.

>From what I understand every monolithic object has 1 or more faces 
(graphic/picture).

I would call the monolithic a one-to-many relationship with facepng but I 
see django calls this a ForeignKey.

I'm working with these models (yes, a field named object is "bad", it's 
what I was given)


class Monolithic(models.Model):
object = models.CharField(max_length=128, blank=False, null=False, unique=
True)

class FacePng(models.Model):
obj = models.CharField(max_length=128, blank=True, null=True)


I do not see the ForeignKey relationship between Monolithic and FacePng. 

Changing Monolithic class to models.ForeignKey() breaks lots of things.

So I'd prefer to figure out how to do the inner join and group by query but 
if that's not the django way and I need to change Monolithic.objects to a 
ForeignKey() and fix all the stuff that is broken I can do that that too. 

Just need some guidance on how to proceed.



-- 
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/ab7ecf5b-9ae8-4428-9502-6b7d5dec03b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ManyToManyField how to get the fields in a ListView?

2019-04-19 Thread bob
I feel something like this is what I need

select obj,name,png from items_monolithic, items_facepng where object==obj;




But I do not know how to do that in 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6f7210d7-f477-44d6-a589-454a450c73e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


ManyToManyField how to get the fields in a ListView?

2019-04-19 Thread bob
I do not understand how to get my queryset from the ManyToManyField in my 
ListView

*Models*

class Monolithic(models.Model):
  obj = models.CharField( max_length=128, blank=False, null=False, unique=
True)
  face2 = models.ManyToManyField(FacePng)


class FacePng(models.Model):
obj = models.CharField( max_length=128, blank=False, null=False, unique=
True)
png = models.CharField(max_length=128, blank=True, null=Tr

ue)


My details view works as expected. 

*View*

class MonolithicDetailView(DetailView):
model = Monolithic
template_name = 'items/monolithic_detail.html'


def get_object(self):
id_ = self.kwargs.get("id")
return get_object_or_404(self.model, id=id_)


def get_context_data(self, *args, **kwargs):
context = super(MonolithicDetailView, self).get_context_data(**
kwargs)
context['cdn_face'] = settings.CDN_URL
context['rvcs_url'] = settings.RVCS_URL
context['the_faces'] = self.get_object().face2.all()
return context


*Template*


{{ object.name|title|default:"Missing" }}
{{ object.object }}
{{ 
object.arc_filename }}

{% for item_face in the_faces %}

{% empty %}
No Face
{% endfor %}

{{ object.ac }}
{{ object.weight }}
{{ object.value }}

{% for mat in material %}
{{ mat }}
{% empty %}
None
{% endfor %}




*Screenshot (detail view)*

[image: Pasted Graphic.png]


How do a do something similar for the ListView?

*View*

class MonolithicListView(ListView):
model = Monolithic
template_name = 'items/monolithic_list.html'
paginate_by = 15


def get_queryset(self):
items = self.model.objects.all()
return items


def get_context_data(self, **kwargs):
context = super(MonolithicListView, self).get_context_data(**kwargs)
context['cdn_face'] = settings.CDN_URL
return context


*Template*

{% for item in object_list %}

{{ forloop.counter }}
{{ item.name}}({{item.
object}})

{{ item.ac }}
{{ item.weight }}
{{ item.value }}
{{ item.material }}
{% empty %}
No armour found.

{% endfor %}


I do not need to display all the faces, just one would be fine. What I do 
not know how to do is build a query for all objects in the Monolithic table 
with their associated graphics from the FacePng table.

I tried something like this:

 
   def get_queryset(self):
items = self.model.objects.all()
for item in items:
face = self.model.objects.filter(face2__obj=item.object)
item.face = face.first()
return items


Super slow, ton of SQL queries, shows my ignorance. 

Any help would be appreciate. 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d71b6594-da1f-4d60-aca4-83914a0233e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ML-Python

2019-03-13 Thread Bob Gailer
On Mar 13, 2019 7:44 AM, "Hafit Omar"  wrote:
>
> Hi Everyone I'm Hafit from Libya,
> Can anyone help me in in sklearn library I want to import
cross_validation it doesn't work

Please be more specific. What is the evidence that it doesn't work?

-- 
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/CAP1rxO7yws2wsRK6Zs32XCe9SU-j-zgFLNogX_jZWb3W_QCkFg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Multi-level inheritance for the model and migrations?

2019-03-04 Thread bob
Can you have multiple levels if inheritance in your models?

Not "multiple inheritance" multiple level inheritance. 

Something like


class ArchBase(models.Model):
obj = models.CharField(max_length=128, blank=False, null=False)

class Meta:
abstract = True

class Armour(ArchBase):
name_pl = models.CharField(max_length=128, blank=False, null=False)

class Meta:
abstract = True

class Boots(Armour):
body_foot = models.IntegerField(blank=False, null=False, default=-1)

The error I get when I try to create some Boots

Exception Type: OperationalError
Exception Value: 

no such table: items_boots



And I do not see the items_boots table in my SQL Lite database.

-- 
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/c0f363f8-c8de-419f-b114-0e8b729148d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problems with first program

2019-02-28 Thread bob gailer

On 2/28/2019 6:08 PM, Edvani Pascoal wrote:
hey guys I'm beginner on django I never worked with this framework 
before and then I've problems to started polls app this is the error:



deleting most of the traceback since in this case it is not relevant.

  File "/home/edvani/django-test/djangoproject/polls/models.py", line 5
    question_text = models.CharField(max_length=200)
    ^
IndentationError: expected an indented block


Here is the head of models.py, as copied from the tutorial

from django.db import models


class Question(models.Model):
    question_text = models.CharField(max_length=200)

Your copy of that file is different. Statement that end in : must be 
followed by at least one indented line. These are known as "compound 
statements" (if, elif, else, while, for, try, except, finally, with).


--
Bob Gailer


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

--
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/580f4cd8-1d87-56a0-7548-c20e26e3e446%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: looking for team members as my technical Advisory

2019-02-22 Thread Bob Gailer
Sounds interesting. Tell me more.

On Feb 22, 2019 5:02 AM, "Nura Bash"  wrote:

> Good day, all am Nura bashir CEO of Teamlead enterprise Nigeria, am
> looking for Technical advisory members for my project which am about to
> start here in West Africa, is a plot project from 10 selected schools to
> help train  kids django..
>
> If any one is interested I can be reach out via whatpp +23434832618 or my
> email nurabas...@gmail.com
> Thank you
>
> --
> 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/4298c126-9392-4691-a40b-51420ebbaea1%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/CAP1rxO507W5E5QqQeoEue%3DcgfZ%3Dsgji7evwhs%2BLi%3Dag%3DP3-Mrg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


class view with filter on form input

2019-02-11 Thread Bob Bobsled
Hi,
I have form on a search page  called SearchForm where the user selects
items to search.
The rest part creates a URI which appears as below from the selected items
to search.

http://archive/ephemera/searchresult/?choose_collection=Macmillan_input=GuitarBuilder_item=title

I'm trying to write a classview in views.py to get the URI parameters, then
fashion a query to place those in an object_list for viewing in a search
results template.

views.py
class SearchResultsView(django.views.generic.ListView):
template_name = 'ephemera/searchresults.html'
model = Item  #my model class

def get_queryset(self, **kwargs):

form = SearchForm()
choose_collection = self.request.GET.get('choose_collection')
user_input = self.request.GET.get('user_input')
choose_item = self.request.GET.get('choose_item')

object_list =
self.model.objects.filter(collection__icontains =
choose_collection).filter(choose_item__icontains = user_input)   #XXX

return object_list

I can't seem to figure out how to pass the choose_item get variable to the
filter.  Django complains cannot resolve keyword 'choose_item' into field.
The correct field is 'title' but I won't know that until the user selects
one of the choices from the form pull down menu.

The following query works fine directly on sqlite, but I can't seem to
figure out how to do it in the class view.

select * from ephemera_item where collection = 'MACMILLAN' AND title =
'Guitar Builder';

Could be my basic approach is bad too, because I'm only just starting out
with this.

Thank you for any advice.

Regards,
Bob

-- 
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/CALWZDaPAr0VYra-HazcwCXcvmh%3DYY9O9m1e6oKBTrxF9ouRz6w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: beginner

2019-02-01 Thread Bob Gailer
I would be glad to give mentoring a shot. Send me your questions. If we
enjoy working with each other then we'd need to negotiate some kind of
payment for my services.

Bob Gailer

On Jan 31, 2019 4:36 PM, "Emmanuel klutse"  wrote:

> I want to be one of the best in the field (python n Django), so I will be
> happy if you can help as my mentor .
>
> I’m currently stack on dictionary for the best two day.
>
> On Thu, 31 Jan 2019 at 9:09 PM, Tim Vogt (Tim Vogt) 
> wrote:
>
>> Wat do you want to accomplish?
>>
>> Tim
>> t...@officerebels.nl
>>
>> Op 31 jan. 2019, om 21:51 heeft Emmanuel klutse  het
>> volgende geschreven:
>>
>> I'm Emmnuel klutse, and very new to programming.
>> CAN I GET SOMEONE TO MENTOR ME PLEASE.
>> i'm currently taking a python course on udemy and also learning on django
>> via youtube.
>> I NEED A MENTOR PLEASE
>>
>> --
>> 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/63ac66bb-ea6e-402d-aa91-2eb82abaf4d2%
>> 40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/63ac66bb-ea6e-402d-aa91-2eb82abaf4d2%40googlegroups.com?utm_medium=email_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/31162D20-A423-4EE3-869D-5156F4561910%40gmail.com
>> <https://groups.google.com/d/msgid/django-users/31162D20-A423-4EE3-869D-5156F4561910%40gmail.com?utm_medium=email_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/CAAw18mCHakG7vEAfQMgkRJv%2B_FfZpHT-CC80TWVqkez1TXJKzQ%
> 40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAAw18mCHakG7vEAfQMgkRJv%2B_FfZpHT-CC80TWVqkez1TXJKzQ%40mail.gmail.com?utm_medium=email_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/CAP1rxO7z4gJDkOc8hn2gphvSTWJhyEaRrsvZTudp4kd-Y%3Dr81A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error

2019-01-02 Thread Bob Gailer
On Jan 2, 2019 2:03 AM, "Suresh"  wrote:
>
> def chapter(request, course_name=None, slug=None):
> place = Chapter.objects.get(course__course_name=course_name,
slug=slug)
>
> add_link_form = AddLinkForm(request.POST or None)
> add_txt_form = AddTxtForm(request.POST or None)
> file_upload_form = FileUploadForm(request.POST or None, request.FILES
or None)
>
> queryset_txt_block = TextBlock.objects.filter(text_block_fk__id=
place.id)
> queryset_yt_link = YTLink.objects.filter(yt_link_fk__id=place.id)
> queryset_files = FileUpload.objects.filter(file_fk__id=place.id)
>
> context = {
> "title": place.chapter_name,
> "course_name": course_name,
> "slug": slug,
> "add_link_form": add_link_form,
> "add_txt_form": add_txt_form,
> "queryset_yt_link": queryset_yt_link,
> "queryset_txt_block": queryset_txt_block,
> "queryset_files": queryset_files,
> "path": "Profile",
> "redirect_path": "profile",
> "file_upload_form": file_upload_form,
> }

What would you like us to do? Personally I won't  / can't do anything with
the code you sent because I don't know what error you got nor do I know the
environment in which you run that code. I sure wish my crystal ball ball
was working.

If I ran that code I would get an error reporting unknown name Chapters.

So give us enough so that we could at least get started. If you got a trace
back please copy and paste the entire traceback.

If you included an attachment it did not come through.

Bob Gailer

-- 
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/CAP1rxO4mECG4b81R%3DN6xWjzvE6ewC5Y7y4Q6AbZbonT_RzDc7A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: New to this list question

2018-11-23 Thread Bob Gailer
On Nov 23, 2018 3:16 PM, "Dean Karres"  wrote:
>
> Hi,
>
> I just joined this list.  I am new to Django.  I have seen several of the
most recent postings.  I have a question i want to ask but am not sure if
this is the correct forum.  The question I want to ask is to get advice on
what Django module(s) I should use to either get me close to a final
application or get me all the way there.

The place to start is the Django tutorials.

I have looked at the list of Django modules but there are lots of them and
trying to compare/contrast while keeping my app goals in mind is proving
difficult.  I am hoping folks with more experience an help me filter things
a bit.  I would offer a 1000 foot view of what I want to accomplish but it
might be longish.  Is that Ok here?

Technically anything Jango related is okay here. Keep in mind the longer
your post the more likely it is to be not fully read. Could you give us a
10,000 foot overview?

Bob Gailer

-- 
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/CAP1rxO5D1%3Dmpi06_r9rC%2B9of8xocYSkV%3DM0gjEFrnqYFBNgDdw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Toby McGuire

2018-11-12 Thread Bob Gailer
On Nov 12, 2018 12:05 PM, "toby mac"  wrote:
>
> Im a newbie to this. Used to program on COBOl, Fortran and 370 assembler,
plus many others

Welcome to A Whole New World. How can we help you?

Bob Gailer

-- 
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/CAP1rxO6i9UpXonLE%2BjT3ohjQGEei5Yj41o5dT%3D82LoQPzp4RWw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django admin widget

2018-10-15 Thread Bob Bobsled
Hi,
The idea for a separate model for author with a foreign key back to book is
interesting.  I hadn't thought of that.  Thanks for the ideas about how to
approach this problem.

On Sat, Oct 13, 2018 at 12:10 PM Ryan Nowakowski 
wrote:

> I've done something similar in the past but I use a separate model for
> author that has a foreign key back to book. You can limit the number of
> authors to 3 in the author save method.
>
> Then you can use an inline form for author in the admin. That will give
> you the + functionality you're looking for.
>
> If you want to keep you current book model the same with authors as
> fields, take a look at admin fieldsets.
>
> On October 12, 2018 8:43:26 PM CDT, thebobbobs...@gmail.com wrote:
>>
>> Hi,
>> I'm still a bit new to django, but making slow progress.
>>
>> I'm wondering how to move forward with a book class as model which has an
>> author field which
>> allows adding additional authors.
>>
>> I have three fields allocated in the SQLite db for up to three different
>> authors.
>>
>> What I'm trying to do is only expose the additional author text entry box
>> for the book class in admin
>> when say for example a plus or other widget is clicked.
>>
>> ex.  Author [  ]  +
>> ...then
>>   Additional Author1 [ ]  +
>> ...and finally
>>   Additional Author2 [ ]
>>
>> So if you click the plus the additional author1 text entry shows up, then
>> click again the last or third
>> author entry shows up, but no more plus we're out of db fields at that
>> point.
>>
>> Not trying to dynamically add fields to the db.  Just expose when needed
>> for up to three authors.
>>
>> Prefer to not use jquery and/or javascript, but stick to pure python
>> django if possible.
>>
>> I've been reading alot about admin but still confused as to best way to
>> proceed.
>>
>> Thank You,
>>
>> --
> 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/96rMeBTLgOY/unsubscribe.
> To unsubscribe from this group and all its topics, 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/38283332-0AB7-4F6B-93E2-F4BD347CAFD6%40fattuba.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/CALWZDaM7V4EXSHTJUtnemJr0LQxeHykyhR4nxmnCVx0N1KUh%2BA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Creating superuser

2018-10-04 Thread Bob White
give me you id and password teamviwer i will help you

El jue., 4 oct. 2018 a las 12:07, VIPIN VIPIN ()
escribió:

> This is not working
>
>
> On Thu, 4 Oct 2018, 11:25 pm Bob White,  wrote:
>
>> you must do makemigrations and then migrate
>>
>> after that you will be enable to see panel admin
>>
>> python manage.ty makemigrations
>> python manage.py migrate
>>
>> this process will make the tables for admin
>>
>> El jue., 4 oct. 2018 a las 11:07, VIPIN VIPIN ()
>> escribió:
>>
>>> --
>>> 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/29d58131-a720-4ca4-9e1b-e09676324c25%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/29d58131-a720-4ca4-9e1b-e09676324c25%40googlegroups.com?utm_medium=email_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/CAKARMDDBC5TwBeKENCfCQVNd01ZnnmuMS%2B5Jk1uA5D4sq0M35w%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAKARMDDBC5TwBeKENCfCQVNd01ZnnmuMS%2B5Jk1uA5D4sq0M35w%40mail.gmail.com?utm_medium=email_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/CACAC_cCf1wJGo97za06MCvvrsSuaq_XRobi4mrR-b66V2B%3DgKA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CACAC_cCf1wJGo97za06MCvvrsSuaq_XRobi4mrR-b66V2B%3DgKA%40mail.gmail.com?utm_medium=email_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/CAKARMDDnU-5Xpehv2-dwY8YjpE0DSXWzYS3LFtTRjV4P4tPfZg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Creating superuser

2018-10-04 Thread Bob White
you must do makemigrations and then migrate

after that you will be enable to see panel admin

python manage.ty makemigrations
python manage.py migrate

this process will make the tables for admin

El jue., 4 oct. 2018 a las 11:07, VIPIN VIPIN ()
escribió:

> --
> 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/29d58131-a720-4ca4-9e1b-e09676324c25%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/CAKARMDDBC5TwBeKENCfCQVNd01ZnnmuMS%2B5Jk1uA5D4sq0M35w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django wamp

2018-07-08 Thread Bob Bobsled
Hi,
Thanks for the direction.  It seems that running mod_wsgi on a different
port thru a virutal host conf for apache is the way to move forward.  I'll
see if I can figure out how to do that.
Regards,


On Sat, Jul 7, 2018 at 9:39 PM, Avraham Serour  wrote:

> yes, it is possible.
>
> You are correct, they need to listen to a different port
>
> On Sun, Jul 8, 2018 at 9:24 AM Gerald Brown  wrote:
>
>> Is it possible to run 2 servers (Apache & Nginx) on the same system?
>>
>> Maybe if they listen on different ports i.e. 80 & 81
>>
>> On Sunday, 08 July, 2018 01:09 PM, m1chael wrote:
>>
>> best not to fight Apache and just use nginx for django
>>
>> On Sat, Jul 7, 2018, 11:07 PM  wrote:
>>
>>>
>>> Hi,
>>> I'm a novice with django but have been setting up django on a Win7 Wamp
>>> stack.  We have several small non-django websites running on wamp.
>>> Those projects are in c:/wamp/www/myproject for ex. and are accessed as
>>> localhost/myproject or myipxxx/myproject.
>>>
>>> Under wamp I have tried putting the django project in c:/wamp/apps, in
>>> c:/wamp/www, and just in c:/wamp too.  They all work fine with apache and
>>> mod_wsgi.
>>> At least I get a sample "helloworld" message in the webpage when I
>>> access the django site as localhost/mydjangosite or myipxxx/mydjangosite.
>>> This is basically the simple tut01 or polls app kindof django project.
>>>
>>> But the django project, wherever I put it in wamp, buggers our other
>>> non-django websites.  I get a message back from urls.py saying it's been
>>> thru all the urls listed and it cannot access our regular (non django
>>> sites) in c:/wamp/www when I try to access one as localhost/myproject or
>>> myipxxx/myproject from the browser.
>>>
>>> I'm a bit stuck on how to get these two to play together nicely.  I'm
>>> not sure if it's a django project configuration, an apache httpd.conf
>>> problem, or a wamp issue.  I'm wondering if someone has experience with
>>> this issue and could point me in the right direction for how to use django,
>>> but continue to use localhost or myipxxx/ to access our non-django wamp
>>> sites.
>>>
>>> Thank you,
>>> Bob
>>> --
>>> 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/f9e69bf3-5192-41b9-9b80-d80617c9f5d9%
>>> 40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/f9e69bf3-5192-41b9-9b80-d80617c9f5d9%40googlegroups.com?utm_medium=email_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/CAAuoY6Nan7vxHE%3DLXAMYnMhh58%
>> 3DiV6DwFxQnt0FPBd7vvS6J_w%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAAuoY6Nan7vxHE%3DLXAMYnMhh58%3DiV6DwFxQnt0FPBd7vvS6J_w%40mail.gmail.com?utm_medium=email_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/c1af585f-19c4-5cd0-7697-e167726ae65e%40gmail.com
>> <https://groups.google.com/d/msgid/django-users/c1af585f-19c4-5cd0-7697-e167726ae65e%40gmail.com?u

Re: Django object to json

2018-07-07 Thread Bob Gailer
On Jul 7, 2018 7:42 AM, "Kamal Sharma"  wrote:
>
> hi,
>
> I am facing a problem to get data from database in form of JSON.
>
> data = model.objects.all()
>
> now i have a big list in data and want to convert it into JSON.
> how can i do it.

import json
json_biglist = json.dumps(biglist)

Django may offer an alternative.

>
> Thanks
>
> Kamal Sharma
>
> --
> 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/CAHfh8PQmAZ5EB4ENunxjwdd%3DQcXDH-x8db9e6kP%2BtuY2Zr8vxw%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/CAP1rxO6CidFamw_L-160U_jkXq9pGDp-ajzHqsXFMQEasBtJkw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django windows apache tell if apache is working

2018-07-03 Thread Bob Bobsled
Hi,
I think I see the problem now.

WAMP is a special case for aliases, and it's root directory default setup
in c:wamp\www for ex..  I need to do some more work on, say for ex. using
Django Tut 01, setting up mysite as an alias in wamp, and then putting the
polls app in it.  I believe apache might start to work then with django if
the wamp alias is setup correctly.

I also found this vid tut:  really good, but for XAMPP, not WAMP...but it
shows how to get the mod_wsgi.so from a renamed and extracted .whl file.
And using the mod_wsgi.so with apache simplifies things a bit, so this is
good too.

XAMPP
This shows how to create a mod_wsgi.so from the .pyd extracted from the
.whl file
https://www.youtube.com/watch?v=VnR5O4IjmOs

Regards


On Sat, Jun 30, 2018 at 10:08 AM, Jason  wrote:

> I meant the tutorial at https://docs.djangoproject.
> com/en/2.0/intro/tutorial01/
>
> That said, there's a few different ways you can actually deploy, but
> digitalocean has some good resources for starting out.
>
> https://www.digitalocean.com/community/tutorials/how-to-
> serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-14-04
>
> This one shows how to use apache on ubuntu, and you should be able to
> extrapolate to use wamp.
>
> what I would do is just set up a simple view to return a http response
> saying "working", and map that to the root.  Something like
>
> app/views
>
> def index(request):
> return HttpResponse("Working!")
>
> app/urls
>
> from app.views import index
> urlpatterns = [
> path('', index),
> ]
>
> and hit localhost.  That'll be all you need.
>
> Hi,
>> Thanks.
>> Yes, I went thru the Mozilla library tutorial on a fedora dev machine to
>> the point where I realized I needed to do more with the last mile, so to
>> speak working on setup of the production server part on Windows and wamp.
>> Seems most tuts end at manage.py runserver, or start into deployment from
>> dev to production.  I can't seem to locate a good uptodate tut for wamp
>> that shows how to test everything is working properly in a simple manner
>> for the wsgi part.
>>
>> I'm just trying to verify the plumbing (httpd.conf, settings.py wsgi.py)
>> is working with apache, before spending too much more time building a site.
>>
>>
>> On Sat, Jun 30, 2018 at 2:54 AM, Jason  wrote:
>>
>>> appreciate the detailed report :-)
>>>
>>> so, have you set up the django tutorial project?  that application
>>> method in wsgi doesn't make any sense.  you should have urls and views set
>>> up in your project
>>>
>>> --
>>> 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/to
>>> pic/django-users/-eJaLuJ85KE/unsubscribe.
>>> To unsubscribe from this group and all its topics, 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/ms
>>> gid/django-users/6d241c04-55be-4524-959e-09630a7bc21f%40googlegroups.com
>>> 
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> 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/-eJaLuJ85KE/unsubscribe.
> To unsubscribe from this group and all its topics, 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/6f5e5996-a85e-4eb6-b5e4-804f7379a2b4%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/CALWZDaNY4miqCqxy%3DLvH4417%3DP4XGOuHAOepCBT2tPpg0wqkrA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django windows apache tell if apache is working

2018-07-02 Thread Bob Bobsled
Hi,
I'm still stuck on getting Apache to verify as working with wsgi.
Wondering what I might be doing incorrectly.
I'm reading lots of tuts, but it's a jungle out there.

I changed the folder hierarchy for the project and app so
venv, django_project, and  django_app are all on the same level as manage.py
thus:
c:/wamp/www-src/django_project
c:/wamp/www-src/django_app
c:/wamp/www-src/venev
c:/wamp/www-src/manage.py

In wamp create folder named www-src alongside the www folder.
cd into www-src.

created a virtual environment:
Inside www-src run > virtualenv venv

ACTIVATE and DEACTIVATE:

then activate by
> venv\Scripts\activate

if that works see (venv) as a prefix to the command line.  To deactivate
type:
>venv\Scripts\deactivate.bat.
...or can also just use
(venv) c:\wamp\www-src >deactivate
-

DJANGO PROJECT, APP, and VENV:
Then with the virtual environment active, install Django with the local
instance of pip by typing: >pip install django

then created a new django project >python django-admin.py startproject
django_project

and on the same level as manage.py type
>django-admin.py startapp django_app

Should have django_app folder, django_project folder, venv folder, and
manage.py all on the same level.

SETUP SQLITE DATABASE:

in the top level folder (the one with manage.py in it), type this in:
> python manage.py migrate


START RUNSERVER:
> python manage.py runserver

see success...so far.
-
Trying to get Apache production server working...

SETUP STATIC files location:

in settings.py

SETTINGS.PY:

in settings.py change STATIC_URL to:

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

...also set
STATIC_ROOT = os.path.join(BASE_DIR, "static/")

then run
>(venv) c:\wamp\www-src>manage.py collectstatic

(should see new static dir under www-src)
---

MIGRATIONS:

then from c:\wamp\www-src run
(venv) c:\wamp\www-src >manage.py makemigrations
then
(venv) c:\wamp\www-src >manage.py migrate

SETTINGS.PY

in settings.py change STATIC_URL to:

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

...also set
STATIC_ROOT = os.path.join(BASE_DIR, "static/")

then run
>(venv) c:\wamp\www-src>manage.py collectstatic

(should see new static dir under www-src)
--
...per Jason's suggestion for simple view and url...

in DJANGO_APP/VIEWS.PY

def index(request):
return HttpResponse("Working!")

--
in DJANGO_APP/URLS.PY

from django_app.views import index
urlpatterns = [
path('', index),
]

-
APACHE HTTPD.CONF

#---mod_wgi-express config for location in python ---
LoadFile
"c:/users/administrator/appdata/local/programs/python/python36-32/python36.dll"
LoadModule wsgi_module
"c:/users/administrator/appdata/local/programs/python/python36-32/lib/site-packages/mod_wsgi/server/mod_wsgi.cp36-win32.pyd"

WSGIPythonHome
"c:/users/administrator/appdata/local/programs/python/python36-32"
WSGIScriptAlias /django-project "C:/wamp/www-src/django_project/wsgi.py"
#WSGIPythonPath
"C:/wamp/www-src/django_project/:C:/wamp/www-src/venv/Lib/site-packages"
WSGIPythonPath "C:/wamp/www-src:C:/wamp/www-src/venv/Lib/site-packages"



Order deny,allow
Require all granted




APACHE HTTPD-VHOSTS.CONF


ServerName localhost
ServerAlias localhost
DocumentRoot c:/wamp/www

Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
#Require local
Require all granted




Alias /static c:/wamp/www-src/static

Require all granted



---

restart APACHE

...but what is the correct URL to test here?

tried localhost:8000 all pointing to various folders but nothing connects
so far.



On Sat, Jun 30, 2018 at 10:08 AM, Jason  wrote:

> I meant the tutorial at https://docs.djangoproject.
> com/en/2.0/intro/tutorial01/
>
> That said, there's a few different ways you can actually deploy, but
> digitalocean has some good resources for starting out.
>
> https://www.digitalocean.com/community/tutorials/how-to-
> serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-14-04
>
> This one shows how to use apache on ubuntu, and you should be able to
> extrapolate to use wamp.
>
> what I would do is just set up a simple view to return a http response
> saying "working", and map that to the root.  Something like
>
> app/views
>
> def index(request):
> return HttpResponse("Working!")
>
> app/urls
>
> from app.views import index
> urlpatterns = [
> path('', index),
> ]
>
> and hit localhost.  That'll be all you need.
>
> Hi,
>> Thanks.
>> Yes, I went thru the Mozilla library tutorial on a fedora dev machine to
>> the point where I realized I needed to do more with the last mile, so to
>> speak working on setup of the production server part on Windows and wamp.
>> Seems most tuts end at manage.py runserver, or start into deployment from
>> dev to production.  I can't seem to locate a good uptodate tut 

Re: django windows apache tell if apache is working

2018-06-30 Thread Bob Bobsled
Hi,
Thanks.
Yes, I went thru the Mozilla library tutorial on a fedora dev machine to
the point where I realized I needed to do more with the last mile, so to
speak working on setup of the production server part on Windows and wamp.
Seems most tuts end at manage.py runserver, or start into deployment from
dev to production.  I can't seem to locate a good uptodate tut for wamp
that shows how to test everything is working properly in a simple manner
for the wsgi part.

I'm just trying to verify the plumbing (httpd.conf, settings.py wsgi.py) is
working with apache, before spending too much more time building a site.

On Sat, Jun 30, 2018 at 2:54 AM, Jason  wrote:

> appreciate the detailed report :-)
>
> so, have you set up the django tutorial project?  that application method
> in wsgi doesn't make any sense.  you should have urls and views set up in
> your project
>
> --
> 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/-eJaLuJ85KE/unsubscribe.
> To unsubscribe from this group and all its topics, 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/6d241c04-55be-4524-959e-09630a7bc21f%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/CALWZDaPoCygU8hSSYcsEpQnHGE%2B52EUxAyOko3kPRhR12t6HCQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


help me formset

2018-04-26 Thread Bob White
hello.

i have an issue.

i want to render formset as table then add row (form) using a modal. then
in table should show just data instead of input. as vb we can use a modal
to add row to table

have you ever done this before?

-- 
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/CAKARMDD4Za4Xntox-hJe32T%2B1-EyHCu9KfmoeKPibpudFGmZfw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Static/constant dictionary for get_initial or get_form_kwargs

2018-02-27 Thread Bob Glassett
Hello, 

Trying to bring a django app into production, and I ran into a real 
headscratcher.

I have a Class based view inherited from create.  When the page reloads, 
after validation, I check the initial dictionary for a field's value to 
fill in the queryset for a different field.

I'm getting sporadic errors about one of the fields not found in the 
initial object.  When I looked closer into the problem, the initial 
dicitonary matched a form for a totally different model.

If I need to pre-populate the initial dictionary, I override the 
get_initial and return the dictionary that I want.  I am not setting 
initial= in the class definition.  Is this the right way to do this task?

I am concerned about a static initial dictionary sticking around.  The base 
edit class returns a copy of the initial dictionary, but if the initial 
dicitonary somehow has invalid values in it, I could be seeing this for all 
my forms.

This is what I did for the initial dictionary:

class UserCreateView(AdminCreateView):

model=User

success_url='/portal/accounts/list'

form_class=PortalUserForm 



def get_form_kwargs(self):

kwargs = super(UserCreateView, self).get_form_kwargs()

kwargs.update({'request' : self.request})

return kwargs 



def get_initial(self):

return {}


On a ModelForm (unrelated to the form/model above) I was trying to access 
the self.initial for a particular field, which threw a Key exception.  The 
initial dictionary passed down on the yellow screen did not match the form 
or data for the view at all.


kwargs:  



{'initial': {'agency': ,
 'canEnterMealCounts': False,
 'canManageCalendar': True,
 'canManageCustomerAllergies': True,
 'canManageFieldTrips': True,
 'canManageSocializations': True,
 'canManageSpecialOrders': True,
 'canManageSupplies': False,
 'canPrintMenus': True,
 'chefablesUser': False,
 'location': ,
 'phone': PhoneNumber(country_code=1, national_number=2018158136, 
extension=None, italian_leading_zero=None, number_of_leading_zeros=None, 
country_code_source=1, preferred_domestic_carrier_code=None)},
 'instance': None,
 'prefix': None}


I have no idea where that initial dictionary came from.  My get_form_kwargs 
looks like this:


def get_form_kwargs(self):

kwargs = super(PendingLabelsCreateView, self).get_form_kwargs()

kwargs.update({'user': self.request.user})

return kwargs


The direct ancestor doesn;'t have get_form_kwargs defined, and that is 
defined as such:


class AdminCreateView(LoginRequiredMixin, UserPassesTestMixin, CreateView):


I need to understand where that initial value came from and determine if I 
have static values where I don't want them.


Thanks in advance



-- 
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/db24def3-f8cc-4954-bbd3-72b6ed3fa0d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Html Page rendered when i hit this below url instead of json objects

2017-09-29 Thread Bob Gailer
On Sep 28, 2017 7:31 AM, "Rakhee Menon"  wrote:
>
> Hi Everyone,
>
> When i hit the url  localhost:8000/forms it gives a html page and on the
other hand when i do it through the django admin ie
>
> localhost:8000/admin/forms it gives me the result...What can be the
reason??Can anyone help??

Check your URLs. Py files.

You will probably find they are directing traffic to two different places.

>
> Thank You.
>
> Regards,
> Rakhee Menon
>
> --
> 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/a74fd16b-8e82-4f08-9791-dd967367c8bd%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/CAP1rxO4qMtZ%2BaOw4X2RREC3-crk0UEyqWJ_kZVMhA8LF-Tz1Jg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: count the selected chechboxes in multipleselectfield

2017-07-05 Thread Bob Gailer
On Jul 5, 2017 6:55 AM, "elloy"  wrote:
>
> I need your help with a problem I'm trying to solve
> I'm making a questionnaire and I have to count the selected choices that
the user have checked in a certain question with 5 possible answers(choices)
> The model I'm using is:
>
> class Reuse(models.Model):
> REUSE_OPTIONS = (
> ('1', 'first choice'),
> ('2', 'second choice'),
> ('3', 'third choice'),
> ('4', 'fourth choice'),
> ('5', 'none of the above'),
> )
>
> user = models.ForeignKey(settings.AUTH_USER_MODEL, null=True,
blank=True)
> reuse = MultiSelectField(max_length=250, choices= REUSE_OPTIONS,
max_choices=4, null=True)
> m = models.DecimalField(max_digits=5, decimal_places=3, default=0)
> numchoices = models.IntegerField()
I am not an expert in Django, but I will point out some problems. You just
made an assignment to numchoices, then you redefine numchoices in the next
line.
> def numchoices(self):   (I tried
this but it didn't work)
Telling us it didn't work is not helpful. You need to be much more
explicit. What led you to say this didn't work?
> self.choices_count = self.choice_set.count()
What are choices_count any choice_set?
> self.save()
>
> I wrote this view:
> def reuse (request):
> if request.method == "POST":
> form = ReuseForm(request.POST)
> if form.is_valid():
> reuse = form.save(commit=False)
># if reuse.get_choices.count() == 1 : reuse.m=0.075
(this doesn't work either)
>   #  elif reuse.get_choices.count() == 2 : reuse.m=0.15
># elif reuse.get_choices.count() == 3 : reuse.m=0.225
>  #   elif reuse.get_choices.count() == 4 : reuse.m=0.3
Rather than calling the method so many times it's better to call it once
and assign the result to a variable. Also in this case you can compute m
from the count
> reuse.save()
> return redirect('../22')
> else:
> form = ReuseForm()
> return render(request, 'questionnaire/reuse.html', {'form':form})
>
> And the form I'm using is:
>
> class ReuseForm(forms.ModelForm):
>
> class Meta:
> model = Reuse
> fields = ('reuse',)
>
> Please, have you got any suggestions;
By the way I don't know what the effect is of defining a function in a
model. Someone else will have to deal with that. I suggest you fix problems
I've pointed out run the program tell us exactly what goes wrong and where
>
>
>
> --
> 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/ca1f528d-903a-428f-b781-6506dff69e0f%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/CAP1rxO4koSXY--T3eCjmTMtNrHDLkxsoXYS-3hCm-znovwAeWg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Does anyone in this group hire out to update code .

2017-04-12 Thread Bob Gailer
I'd be glad to take a look at the Django code. That way I could tell if I
have the expertise to help you , and yes, I am available for hire.

If you would give me access in some form to the Django modules and your
requirements I will let you know what I can do, and my cost estimate.

On Apr 11, 2017 8:26 PM,  wrote:

>  I am looking for a django programmer
> I have a site that was written in python django code and I am not
> proficient enough to make page correction. 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/58de7b2a-bcc8-40d7-a26a-42b0d0491bc9%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/CAP1rxO4zN4DhML8HsN3KBDR8rRXRLLujcgf%2Bg-SPbmfgmqn56A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Request for advice on refactoring a big Django project

2017-03-06 Thread Bob Haugen
Antonis, thank you very much for the feedback! You are absolutely
correct! I apologize to you and the list, and will strive to follow
your suggestions in the future.

I suspect, however, that the very long explanation that would have
been required to avoid the links would have been offputting, too. This
might be a request that was just inappropriate for this list.

As for now, we're charging happily ahead.

On Mon, Mar 6, 2017 at 5:45 AM, Antonis Christofides
 wrote:
> Hi,
>
> I, like many people, am busy. I will generally not spend too much time on
> the messages of this list. I delete most of them after only reading the
> subject line. If I do choose to read the body, I expect to understand what
> it is about after a few seconds of reading. But all I can see in your
> original message is that you have a big Django project that needs
> refactoring, and several links with the code and your discussions about
> them. Essentially the message I'm getting is "I can't tell you what I want
> in this email message, but if you click on these links and study them for
> about half an hour, you'll get it".
>
> Likewise, it would have been way better to include your original message in
> the reply. In order to find your original message I had to dig in my Trash
> folder. I would normally not do that, and I would have ignored your reply as
> well. It just happens that I'm travelling and I'm quite relaxed.
>
> Bottom line: you need to make it very easy for me to help you, and I believe
> the same goes for other people as well.
>
> Regards,
>
> Antonis
>
> Antonis Christofides
> http://djangodeployment.com
>
> On 03/06/2017 12:36 PM, bobhaugen wrote:
>
> I was disappointed to get no response on this topic, and would be grateful
> for any feedback on why that might have been.
>
> Too big? Big ball of mud? Stupid project? ? (I have very little
> touchiness...)
>
> I hope people did not think we wanted to get them to do all or even very
> much work for us. We are charging ahead here:
> https://github.com/django-rea
>
> We did find, and are using, some delicious advice from Marty Alchin:
> http://martyalchin.com/2008/jan/10/simple-plugin-framework/
> And upgrading to the latest version of django, changing to class-based
> views, and breaking up both models and views into several files.
>
> Next: a bunch of abstract base classes.
>
> After that: more API work and a mobile app to use it.
> --
> 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/a3e12fd2-fc27-447a-a5f5-e394c3d67cff%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> 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/9OU0TfwcmTQ/unsubscribe.
> To unsubscribe from this group and all its topics, 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/4d7559f1-e3a2-64f0-d6b3-60c902e17921%40djangodeployment.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/CA%2BSvw0WRHpTUUV1RceS8MWuRjGQ3JyJqZ%3DCKdKGSLYV8%2BQma2g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: where does logging configuration go?

2016-11-26 Thread bob gailer

On 11/26/2016 9:02 AM, ludovic coues wrote:

the settings.py file of your project
Thank you. Is that documented anywhere? I followed various links; none 
of which pointed me to that.




2016-11-25 23:15 GMT+01:00 bob gailer <bgai...@gmail.com>:

https://docs.djangoproject.com/en/1.9/topics/logging/

shows some logging configurations, but does not tell me where to put them.

Where would you suggest?

--
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/01889686-1fba-7d2c-6dec-1965d3156622%40gmail.com.
For more options, visit https://groups.google.com/d/optout.






--
Image and video hosting by TinyPic

--
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/4f753b10-c82d-b068-4567-d37414cc9242%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


where does logging configuration go?

2016-11-25 Thread bob gailer

https://docs.djangoproject.com/en/1.9/topics/logging/

shows some logging configurations, but does not tell me where to put them.

Where would you suggest?

--
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/01889686-1fba-7d2c-6dec-1965d3156622%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


question re built-in server

2016-11-25 Thread bob gailer

Sometimes requests get displayed at the console, other times they do not.

Example:

(myproject) C:\Users\bgailer\mysite>manage.py runserver 0.0.0.0:8000
Performing system checks...

System check identified no issues (0 silenced).

You have 1 unapplied migration(s). Your project may not work properly 
until you apply the migrations for app(s): auth.

Run 'python manage.py migrate' to apply them.
November 25, 2016 - 16:44:45
Django version 1.10.3, using settings 'mysite.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CTRL-BREAK.
Performing system checks...

System check identified no issues (0 silenced).

You have 1 unapplied migration(s). Your project may not work properly 
until you apply the migrations for app(s): auth.

Run 'python manage.py migrate' to apply them.
November 25, 2016 - 16:46:45
Django version 1.10.3, using settings 'mysite.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CTRL-BREAK.
test[25/Nov/2016 16:46:50] "GET /vapi/ HTTP/1.1" 200 38

The first time server is started requests don't get displayed. I edit a 
file to force a restart, and then requests get displayed.In each case 
the view is executed, based on the browser display. Any ideas as to why 
the inconsistent behavior?


--
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/4e8d5514-1984-1dbf-3b11-208381d3c43f%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


What is meaning of '[::1]'?

2016-11-20 Thread bob gailer
From 

https://docs.djangoproject.com/en/1.10/ref/settings/#std:setting-ALLOWED_HOSTS:

"When DEBUG  is |True| and |ALLOWED_HOSTS| is empty, the host is 
validated against |['localhost', '127.0.0.1', '[::1]']|."


What is meaning of '[::1]'?

--
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/02858789-fa42-f8fe-817f-94360b3ddd7d%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


how to run django under apache on windows 10

2016-11-18 Thread bob gailer
Goal: run django under apache on windows 10. I have tried many things, 
none of which have worked. Errror messages up to wazoo. Google has not 
been my friend: I found a lot of articles Everything I read is either 
oriented to linux and/or assumes knowledge I don't have.


Example: today I discovered 
https://docs.djangoproject.com/en/1.10/topics/install/. There is a 
section titled  "Install Apache and mod_wsgi". Unfortunately it does not 
tell us how to install either!


Do you know the best, proper, user-friendly, successful way to get 
django running under apache on windows 10?


--
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/833d8b08-84a4-8687-2f38-0b8a4914bd78%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Basic configuration for running under Apache

2016-11-14 Thread bob gailer

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

This page offers:

WSGIScriptAlias  //path/to/mysite.com/mysite/wsgi.py
WSGIPythonPath  /path/to/mysite.com



In my setup this becomes c:\Users\myname\mysite\mysite\wsgi.py

I am puzzled by the .com in the example. Can you explain?

--
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/c9f26e89-87f9-5ba8-d708-6ceb236a8e5e%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: External access

2016-11-09 Thread bob gailer

Here is an update on my situation.

Windows firewall - I setup in and outbound rules for port 8000 (UDP and TCP)
Router - I set up port forwarding for port 8000 (UDP and TCP)
Using example code in the socket module documentation I ram 
socket_client and socket_server on my local machine with the port=8000  
and host=my external IP . It worked just fine.
When I run the django server instead of the socket server and attempt 
browser access thru my external IP I get a timeout.

Nothing appears on the console running the server.

So something is different . Any ideas?

I presume that the browser - django server communication at most uses 
TCP and/or UDP.


Any ideas are welcome.

--
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/f102f6e2-ca8c-f6b2-43a4-51b1439d5ae5%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: External access

2016-11-07 Thread bob gailer

On 11/7/2016 1:23 PM, GMail wrote:
Wow... Indeed, in Windows telnet is disabled by default. Here's how 
you can enable it (first link on Google): 
https://www.rootusers.com/how-to-enable-the-telnet-client-in-windows-10/

C:\Users\bgailer>telnet 24.211.133.163
Connecting To 24.211.133.163...Could not open connection to the host, on 
port 23: Connect failed.


C:\Users\bgailer>ftp 24.211.133.163
> ftp: connect :Connection timed out
I believe the problem is (how somebody already mentioned earlier) your 
port is inaccessible from external network or server is only serving 
on lo (loopback interface, also was mentioned earlier). You could 
easily test both cases with telnet.

How would I do that?
And I forgot to mention, that you should probably run telnet on 
separate machine (not the one serving Django), since you have no 
problem accessing your server locally.

I have no machines that are not on my lan.


On 7 Nov 2016, at 21:19, bob gailer <bgai...@gmail.com 
<mailto:bgai...@gmail.com>> wrote:


On 11/7/2016 8:51 AM, GMail wrote:
Hi! Seems like port forwarding doesn't work correctly. Do you have 
any other ports forwarded (like ssh or ftp)? If so, do they work as 
expected?


What is this command's output:
telnet  8000

Sorry but I'm running Windows 10 which does not recognize "telnet"

Bob

--
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/41e7d76b-3938-43c3-d61a-21e94ecbd067%40gmail.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/5F9B0BC5-2D58-46A9-B304-AFA2FF777419%40gmail.com 
<https://groups.google.com/d/msgid/django-users/5F9B0BC5-2D58-46A9-B304-AFA2FF777419%40gmail.com?utm_medium=email_source=footer>.

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



--
Image and video hosting by TinyPic

--
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/4a92ce05-eee8-038c-b1ef-6dd15e699087%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: External access

2016-11-07 Thread bob gailer

On 11/7/2016 8:58 AM, Andreas Kuhne wrote:

Do you have "ALLOWED_HOSTS" correclty configured in django settings?

Thanks - was not aware of that. Now it looks like:
ALLOWED_HOSTS = ['209.216.2.211', '209.216.15.70', '24.211.133.163']
The last one is my external ip

Adding the ip addresses did not fix the problem.


Regards,

Andréas

2016-11-07 14:48 GMT+01:00 bob gailer <bgai...@gmail.com 
<mailto:bgai...@gmail.com>>:


I am running a the django server, listening at port 8000. I can
access the server using localhost. When I try using my external ip
address I get "The server at 24.211.133.163 is taking too long to
respond." I have port 8000 forwarded to my server computer in my
router. What more do I need to do?


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

https://groups.google.com/d/msgid/django-users/0fb3e7f8-0c7c-4976-4f8d-a8e914b0b3cb%40gmail.com

<https://groups.google.com/d/msgid/django-users/0fb3e7f8-0c7c-4976-4f8d-a8e914b0b3cb%40gmail.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+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/CALXYUbmDO8hxr%2B1tFbUqtwkaQ9eECkPy%2BtT2M1%2Bj3%3DUj1-oJHA%40mail.gmail.com 
<https://groups.google.com/d/msgid/django-users/CALXYUbmDO8hxr%2B1tFbUqtwkaQ9eECkPy%2BtT2M1%2Bj3%3DUj1-oJHA%40mail.gmail.com?utm_medium=email_source=footer>.

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



--
Image and video hosting by TinyPic

--
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/1e8c42da-150a-12d0-2a67-9c352970392a%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: External access

2016-11-07 Thread bob gailer

On 11/7/2016 8:51 AM, GMail wrote:

Hi! Seems like port forwarding doesn't work correctly. Do you have any other 
ports forwarded (like ssh or ftp)? If so, do they work as expected?

What is this command's output:
telnet  8000

Sorry but I'm running Windows 10 which does not recognize "telnet"

Bob

--
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/41e7d76b-3938-43c3-d61a-21e94ecbd067%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: External access

2016-11-07 Thread bob gailer

On 11/7/2016 8:50 AM, Larry Martell wrote:

On Mon, Nov 7, 2016 at 8:48 AM, bob gailer <bgai...@gmail.com> wrote:

I am running a the django server, listening at port 8000. I can access the
server using localhost. When I try using my external ip address I get "The
server at 24.211.133.163 is taking too long to respond." I have port 8000
forwarded to my server computer in my router. What more do I need to do?

Is the port open on the firewall?

How would I determine that?

What OS are you on?

Windows 10.

Bob

--
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/d4b6210e-2fe5-edcd-79fe-1e1731cd1971%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


External access

2016-11-07 Thread bob gailer
I am running a the django server, listening at port 8000. I can access 
the server using localhost. When I try using my external ip address I 
get "The server at 24.211.133.163 is taking too long to respond." I have 
port 8000 forwarded to my server computer in my router. What more do I 
need to do?



--
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/0fb3e7f8-0c7c-4976-4f8d-a8e914b0b3cb%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Need help with a hostel management system project using django

2016-10-30 Thread Bob Gailer
On Oct 30, 2016 9:53 AM, "YOGITHA A N"  wrote:
>
> I am beginner in django please help me out with my project
To help us help you be more specific. What kind of help do you need?
>
> --
> 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/35fed150-9a4e-4ba9-a81b-1a5301119f7f%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/CAP1rxO5GPt155WmMB8NUO7fbwz7%3DP%2Brq0NaEbLJsQ7UXeUjqtA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie question - data structure for game

2016-10-29 Thread Bob Gailer
On Oct 28, 2016 7:59 PM, "Ken Albright"  wrote:
>
> I'm just learning Python and Django so please be gentle...
>
> I've written a quote decryption game (like you see in the newspaper) in
Python. I'd like to put it on a web page with Django. However, I'm not sure
of the best way to structure the data. The original quote and the encrypted
quote need to have a one-to-one relationship at the letter level. So it
could be two strings on the same row (same id)

That is the simplest, and I see no need for anything more complex.

or a set of tuples, a dictionary, or ???
>
> How to set up the database

What do you mean?

and models.py?

class Quote:
plain= Models.CharField()
crypt = Models.CharField()

> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/b37833bf-e474-4b15-844d-4ef8d8e854b6%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/CAP1rxO7uhPGRD8MdDaZxPM9ZWpViMMoFdy0_dBfb5ahuZiEB4w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: a question about redis cache

2016-04-10 Thread Bob Gailer
Why not just use Redit?

On Apr 10, 2016 8:38 AM, "Xin Liu"  wrote:
>
> Let's look at the following scenario:
> A website has 1 player, to make question easier, I use mysql  storage
player with just one table: "player_table"
> --table here-
> name string
> score int
>
> now, I want to show Top 100 of those players  by socre.
> if only with mysql, I have to caculate Top 100 every time, so I choice
Redis to storage Top 100 with sorted set data type.
>
> But if one of those players' score chaning, what should I do, update Top
100 every time??
>
> Thanks for you advance
>
> --
> 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/487b5298-d478-448a-b498-f9def7ec74f3%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/CAP1rxO7p%3Dd74hcLAAZTtZOfMjB-m7X_E9M5qv4QjxHyic0CgJw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django on Codenmvy

2016-04-09 Thread bob gailer
I am new to Codenvy. Do you have any experience with Codenvy / Django? I 
could use some help. I will post questions if I hear from an experienced 
user.


--
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/5709D034.9060207%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multiple values to Django

2016-04-03 Thread bob gailer

On 4/2/2016 6:20 PM, Denis Makarov wrote:

Hello! I have a MyForm which have name, quantity and quandesc fields.

I have a basic UI form for adding this fileld.

I added button for adding another instances of field on web page. 
Jquery func below:


|
functionaddContainer(){
$("#name").clone().appendTo("#food-container");
$("#quantity").clone().appendTo("#food-container");
$("#quandesc").clone().appendTo("#food-container");
}
|

This gives you duplicate IDs. IDs in HTML should be unique. It appears 
that the 1st occurrence of an ID is ignored, since you are getting the 
value of the 2nd.


To solve this you must generate a new (unique) ID each time you clone a 
field. I suggest you maintain a counter that is incremented by 1 each 
time you run addContainer. Append this counter to the original ID.


Something like (I don't know the precise syntax)
|ctr = ctr + 1;
field = $("#name").clone();
field['id']="name"+ctr; ?? not sure if this is the way to set the ID
field.appendTo("#food-container");
ditto for the other 2 fields.

While you are at it how about making an array of the 3 original fields, 
then applying the code to each element of that array.



Bob Gailer|

--
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/5701AB4A.7060303%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Model design

2016-03-27 Thread Bob Gailer
On Mar 27, 2016 9:41 AM, "Paria Parsamanesh" 
wrote:
>
> Hi ,
> I am new to Django and python and I want to connect to cloudera metadata
database (postgre. )
> I have background in java, and db2, to design java model classes , we
used logical data model and create UML modeling tools. .
>
> Can you direct me on
> 1) How to make this connect from Django on windows to Cloudera postgre.
I am not an expert. My guess is you will accomplish this via settings.py.
> 2) How to design model classes.
Start with the Django tutorial. This will give you the basics. Then look at
the models section of the documentation. Start to build a model.py, then
come back with questions.

Just my opinion. Others may have other ideas.

-- 
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/CAP1rxO7_f2Yj0uasxutn86qZG36bO-c4coA5-3KEgxF%3DN-Qxqg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: DJANGO TUTORIAL

2016-03-22 Thread Bob Gailer
On Mar 21, 2016 7:24 PM, "Anthony W Smith"  wrote:
>
> When I follow django tutorial on the django site for the polls app I keep
getting the error after runnig the python manage.py runserver command it
says no modsule named my site.

You could
1) show us your directory structure
2) delete the directories and start over. Especially when you don't have a
lot of effort invested that. Pay attention carefully to each step.

-- 
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/CAP1rxO7_OZX4QTmi%3DeByxtLHVWb6O0ietg%2BAjXRVCYADrnPM4g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Model or Form class

2016-03-10 Thread Bob Gailer
On Mar 10, 2016 9:01 PM, "Denis Makarov"  wrote:
>
> Hello guys! In whitch cases need to use models.Model class  and in whitch
forms.Form?

Models define tables in a database. Forms assist in creating HTML forms for
gathering, valididating and saving user input. Does that 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/CAP1rxO5zTA0V-eYG%2Bf-yfu2OqB24dDHX3Dk5hJYHx56z_rdGEg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: execute python through ajax

2016-03-09 Thread Bob Gailer
On Mar 9, 2016 9:22 AM, "Florian Hoedt"  wrote:
>
> Hello Django users,
> I would like to execute some python code by JS. For example if somebody
clicks on a openlayers map it should execute a python based query and get
the result as JSON to render it on the map.
> How would I achieve something like this?
Google Django Ajax. There's a number of good references there.
>
> I am trying to understand the forms section of the official django
tutorial without success.
This sounds like a separate issue. What's your objective and where are you
stuck?

-- 
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/CAP1rxO6pLs13%3DZ3jRBAOkO0YUoCM2cQJ81mmsWGRDgu5U1pJmw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Python on the web

2016-03-07 Thread Bob Gailer
On Mar 7, 2016 10:51 AM, "Gregg Turner"  wrote:
>
> Hey,
>
> Need a simple python script put into a website. It uses the requests
module.
>
> $20? Any takers?

Strictly speaking this isn't the place to buy services. Also we would need
a lot more information. Can you guess what that information would be?
>
> --
> 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/d178af7a-2b90-496e-9a0d-7605cfdaa013%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/CAP1rxO4chd1wGNbJQy4HEJ1pXopXbvmXuxg_9%3DhtNZDsH1xv5g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Single Page Application in Django

2016-03-07 Thread Bob Gailer
On Mar 7, 2016 7:04 AM, "Avraham Serour"  wrote:
>
>  DRF
I'll bite - what is DRF? Google does not help with that.

-- 
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/CAP1rxO7AxoUPEpw85at7dRmAuRWL8FTZAok9-dkO24%3Dh2M7KdA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django OVH

2016-03-04 Thread Bob Gailer
On Mar 4, 2016 5:09 PM, "Cedric Vallee"  wrote:
>
> To whom it may concern,
>
> I followed my friends' advice and coded a website in Django, but now it
seems virtually impossible to find documentation about how to host a Django
website on 'classic' hosting servers like OVH.
According to the OVH website you can host anything you want including
python so I would presume one would start out installing Python then
installing Django and going from there .
> Could you please tell me what I have to do so that my website appears
when I type the URL, and not just a page with the folders I uploaded via
Filezilla?
> sounds like you've already installed Django?
Have you considered Python Anywhere? I have I've run django there with no
problem.
> I thank you for your help.
>
> Best regards
>
> --
> 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/41bba2fa-f0fd-4480-9fb3-2774d988579f%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/CAP1rxO4VoaeeZnZxePtEkO2yZ038N0L5GESUTvMVui-LhAAnxw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Integrate appliction into Django

2016-02-28 Thread Bob Gailer
On Feb 28, 2016 7:50 AM, "Alain Muls"  wrote:
>
> Hi All,
>
> I made a program that creates 4 plots and text files about the location
of GNSS (Global Navigation Satellite Systems) based on TLEs downloaded from
NORAD.
> You can find it at https://github.com/alainmuls/GNSSTracking
>
> I would like  to use this program in django (I started with edge-django
as my template). But I don't know how to start with it. How would I define
a model/view for displaying the plots and text files and how can I allow
users to download these results?
Start with the Django tutorial?

>
> Thanks for your help
> Alain
>
> --
> 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/ed296d1a-1fcb-4d1f-9592-0e7bec2a4d3a%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/CAP1rxO4Dh6hdk4R2vowa9KP3BO6oFohNZeoz89TY1LwwVT%2BnCQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Home Page

2016-02-23 Thread Bob Gailer
On Feb 23, 2016 7:59 AM, "Malik Rumi"  wrote:
>
> Why is there so little information in the docs

Documentation evolves. User input helps that process. Perhaps you can make
a contribution as you learn.

about how to build a home page

I'm not sure what you're looking for here. Designing a home page is not a
django topic. Using django to deliver a homepage is the same as delivering
any other page

where to put the url

I don't understand  what you mean by that. please explain

whether or not to build a separate app around it, or why not to put it in
the folder with settings in it,

If your home page is a portal to several apps then it seems to me you would
have an app for the home page

And how to handle a complex home page with a lot of changing content - like
on a newspaper, where Django was created?

Seems to me that's not a django issue.
>
> And second, where (other than trial and error) do I find that kind of
documentation / support?

Google CMS?

-- 
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/CAP1rxO4_xrKa%2BtdZ4VoHVbwxuvj628D%3DgURg%3DqFP-8R8c9umTQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


no module named ...

2016-02-21 Thread bob gailer
Following the tutorial I created projectmysite  and the polls app. 
Everything is fine.


I then started another app, tma, ran server and everything is fine.
Then I added url(r'^ tma/', include(' tma.urls')),to mysite/urls.py
 Now when I runserver I get:
Unhandled exception in thread started by check_errors..wrapper at 0x022B1D8EA840>

Traceback (most recent call last):
  File 
"C:\Users\bgailer\Envs\myproject\lib\site-packages\django\utils\autoreload.py", 
line 226, in wrapper

fn(*args, **kwargs)
  File 
"C:\Users\bgailer\Envs\myproject\lib\site-packages\django\core\management\commands\runserver.py", 
line 116, in inner_run

self.check(display_num_errors=True)
  File 
"C:\Users\bgailer\Envs\myproject\lib\site-packages\django\core\management\base.py", 
line 426, in check

include_deployment_checks=include_deployment_checks,
  File 
"C:\Users\bgailer\Envs\myproject\lib\site-packages\django\core\checks\registry.py", 
line 75, in run_checks

new_errors = check(app_configs=app_configs)
  File 
"C:\Users\bgailer\Envs\myproject\lib\site-packages\django\core\checks\urls.py", 
line 10, in check_url_config

return check_resolver(resolver)
  File 
"C:\Users\bgailer\Envs\myproject\lib\site-packages\django\core\checks\urls.py", 
line 19, in check_resolver

for pattern in resolver.url_patterns:
  File 
"C:\Users\bgailer\Envs\myproject\lib\site-packages\django\utils\functional.py", 
line 33, in __get__

res = instance.__dict__[self.name] = self.func(instance)
  File 
"C:\Users\bgailer\Envs\myproject\lib\site-packages\django\core\urlresolvers.py", 
line 417, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", 
self.urlconf_module)
  File 
"C:\Users\bgailer\Envs\myproject\lib\site-packages\django\utils\functional.py", 
line 33, in __get__

res = instance.__dict__[self.name] = self.func(instance)
  File 
"C:\Users\bgailer\Envs\myproject\lib\site-packages\django\core\urlresolvers.py", 
line 410, in urlconf_module

return import_module(self.urlconf_name)
  File "C:\Users\bgailer\Envs\myproject\lib\importlib\__init__.py", 
line 126, in import_module

return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 986, in _gcd_import
  File "", line 969, in _find_and_load
  File "", line 958, in 
_find_and_load_unlocked

  File "", line 673, in _load_unlocked
  File "", line 662, in exec_module
  File "", line 222, in 
_call_with_frames_removed

  File "C:\Users\bgailer\mysite\mysite\urls.py", line 22, in 
url(r'^ tma/', include(' tma.urls')),
  File 
"C:\Users\bgailer\Envs\myproject\lib\site-packages\django\conf\urls\__init__.py", 
line 52, in include

urlconf_module = import_module(urlconf_module)
  File "C:\Users\bgailer\Envs\myproject\lib\importlib\__init__.py", 
line 126, in import_module

return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 986, in _gcd_import
  File "", line 969, in _find_and_load
  File "", line 944, in 
_find_and_load_unlocked
  File "", line 222, in 
_call_with_frames_removed

  File "", line 986, in _gcd_import
  File "", line 969, in _find_and_load
  File "", line 956, in 
_find_and_load_unlocked

ImportError: No module named ' tma'
You will note
File "C:\Users\bgailer\mysite\mysite\urls.py", line 22, in 
url(r'^ tma/', include(' tma.urls')),
in the traceback.

How do I fix this?

--
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/56CA599C.7000905%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: problem with DJANGO_SETTINGS_MODULE

2016-02-20 Thread bob gailer

On 2/19/2016 1:25 PM, bob gailer wrote:
After several days of running my server with no problem I am suddenly 
confronted with:


"django.core.exceptions.ImproperlyConfigured: Requested setting 
DEFAULT_INDEX_TABLESPACE, but settings are not configured. You must 
either define the environment variable DJANGO_SETTINGS_MODULE or call 
settings.configure() before accessing settings."

Red faced embarrassment - I had inadvertently switched from
python manage.py to django-admin runserver

Bob Gailer

--
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/56C8CE37.8040305%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


problem with DJANGO_SETTINGS_MODULE

2016-02-19 Thread bob gailer
After several days of running my server with no problem I am suddenly 
confronted with:


"django.core.exceptions.ImproperlyConfigured: Requested setting 
DEFAULT_INDEX_TABLESPACE, but settings are not configured. You must 
either define the environment variable DJANGO_SETTINGS_MODULE or call 
settings.configure() before accessing settings."


Researching the django docs did not help.

 settings.py is in  .../mysite/mysite as per the tutorial. I am using a 
virtualenv


Question:s why the change? It was working!

There is no DJANGO_SETTINGS_MODULE environment variable

I've tried (following the documentation)
set DJANGO_SETTINGS_MODULE=mysite.setting

which results in (very long traceback) ending in
ImportError: No module named 'mysite

I am running version 1.9, python 3,5. windows 10.

Please guide me.

--
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/56C75DFF.5060300%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to install on windows?

2016-02-16 Thread bob gailer

On 2/14/2016 8:08 PM, Mike Dewhirst wrote:

1. Uninstall all versions of Python on your machine

2. Start again and install Python 3.5 (pip was first part of the 
Python install with 3.4)
That seemed a bit radical and time consuming. I examined the PATH 
environment variable, replaced  python33 with python35 and now I am 
making good progress. Thanks for the nudge.


3. Continue with https://docs.djangoproject.com/en/1.9/howto/windows/

Good luck and welcome!

On 15/02/2016 11:48 AM, bob gailer wrote:

I tried following the instructions at
https://docs.djangoproject.com/en/1.9/howto/windows/.

I installed Python in C:\python35. After that most things didn't seems
to work as promised.

Python 3.5 does not appear in the PATH. (Python 3.3 is there.) Yes I
checked |Add Python 3.5 to PATH.

C:\>python --version
Python 3.3.3

I typed (at the C: prompt) pip install virtualenvwrapper-win

'pip' is not recognized as an internal or external command,
operable program or batch file.

After searching I found pip in C:\python35/scripts

So I changed to that directory and typed
||C:\python35/scripts>||pip install virtualenvwrapper-win

That worked.|

|Then I tried |mkvirtualenv myproject and got
'virtualenv.exe' is not recognized as an internal or external command,
operable program or batch file.

A few years ago I tried to install Django. I recall running into similar
issues.

I must be missing something. Any guidance would be appreciated.






--
Image and video hosting by TinyPic

--
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/56C3476A.8090205%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


How to install on windows?

2016-02-14 Thread bob gailer
I tried following the instructions at 
https://docs.djangoproject.com/en/1.9/howto/windows/.


I installed Python in C:\python35. After that most things didn't seems 
to work as promised.


Python 3.5 does not appear in the PATH. (Python 3.3 is there.) Yes I 
checked |Add Python 3.5 to PATH.


C:\>python --version
Python 3.3.3

I typed (at the C: prompt) pip install virtualenvwrapper-win

'pip' is not recognized as an internal or external command,
operable program or batch file.

After searching I found pip in C:\python35/scripts

So I changed to that directory and typed
||C:\python35/scripts>||pip install virtualenvwrapper-win

That worked.|

|Then I tried |mkvirtualenv myproject and got
'virtualenv.exe' is not recognized as an internal or external command,
operable program or batch file.

A few years ago I tried to install Django. I recall running into similar 
issues.


I must be missing something. Any guidance would be appreciated.

--
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/56C12079.50203%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting NoReverseMatch and can't find the mistake

2015-11-20 Thread Bob Aalsma
How big can a smile be?

Works! 
Thanks!

Bob

-- 
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/33464546-fd1d-4b5f-8b66-2e65d8844fff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting NoReverseMatch and can't find the mistake

2015-11-20 Thread Bob Aalsma
Cheers Daniel, I'll review, modify and try again!

-- 
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/191e8384-4c40-401f-8e3b-385bb2d42bb3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting NoReverseMatch and can't find the mistake

2015-11-19 Thread Bob Aalsma
Umm, one of the things I've found difficult is to determine the logic in 
the translation of the class names in models.py to other variables.

And I'm sorry to have not included the models.py. This is the part of 
ZoekVraag:

class ZoekVraag(models.Model):
vrager = models.ForeignKey(KlantContactPersoon)
vraag_naam = models.CharField("naam vraag", max_length=200)
vraag_omschrijving = models.TextField("omschrijving vraag", blank = 
True)
vraag_taktiek = models.TextField("taktiek oplossing vraag", blank = 
True)

def __unicode__(self):
return self.vraag_naam

class Meta:
verbose_name = 'zoekvraag'
verbose_name_plural = 'zoekvragen'

-- 
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/7990e791-d7fa-404f-a776-5bde2522a7a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting NoReverseMatch and can't find the mistake

2015-11-19 Thread Bob Aalsma
Really sorry Tom, I've been looking at your text and thinking about it for 
most of today, but no penny dropping. 
I'm rather unsure which bits go where, I'm trying to understand this by 
rebuilding the tutorial.

I can't seem to get my head around this 'reverse()' part: the reverse() as 
such is used in the HttpResponseRedirect statement whereas the error seems 
to be caused by the form statement in vraag.html - how do these things 
connect?

-- 
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/59230d07-badd-4c1c-b664-f0b26db9a68b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Getting NoReverseMatch and can't find the mistake

2015-11-17 Thread Bob Aalsma
Sorry, can't seem to find what's wrong here, please help: what am I 
missing???

I'm seeing
NoReverseMatch at /zoekopdrachten/4/resultaat/

Reverse for 'resultaat' with arguments '('',)' and keyword arguments '{}' not 
found. 1 pattern(s) tried: 
[u'zoekopdrachten/(?P[0-9]+)/resultaat/$']

Request Method:GETRequest URL:
http://127.0.0.1:8000/zoekopdrachten/4/resultaat/Django Version:1.8.5Exception 
Type:NoReverseMatchException Value:

Reverse for 'resultaat' with arguments '('',)' and keyword arguments '{}' not 
found. 1 pattern(s) tried: 
[u'zoekopdrachten/(?P[0-9]+)/resultaat/$']

Exception 
Location:/Library/Python/2.7/site-packages/django/core/urlresolvers.py 
in _reverse_with_prefix, line 495Python Executable:/usr/bin/pythonPython 
Version:2.7.10


with *views.py*:
"""
zoekopdrachten: views.py

"""

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

from .models import KlantOrganisatie, ZoekVraag, ZoekVraagLocatie

#
#   Index - overzicht van opdrachtgever, contactpersonen en zoekvragen
def index(request):
organisatie_lijst = 
KlantOrganisatie.objects.order_by('klant_organisatie_naam')
context = {'organisatie_lijst': organisatie_lijst}
return render(request, 'zoekopdrachten/index.html', context)


#
#   Klantverwerking - contactpersoon noteert oordeel en motivatie bij 
aangeboden zoekresultaten
def klantverwerking(request, zoekvraag_id):
vraag = get_object_or_404(ZoekVraag, pk=zoekvraag_id)
return render(request, 'zoekopdrachten/klantverwerking.html', {'vraag': 
vraag})


#
#   Resultaat - inlezen zoekresultaten en opnemen in database bij 
ZoekVraagResultaat
def resultaat(request, zoekvraag_id):
vraag = get_object_or_404(ZoekVraag, pk=zoekvraag_id)
try:
keuze = 
vraag.zoekvraaglocatie_set.get(pk=request.POST['zoekvraaglocatie'])
except (KeyError, ZoekVraagLocatie.DoesNotExist):
return render(request, 'zoekopdrachten/vraag.html', {
'vraag': vraag,
'error_message': 'Ongeldige keuze of zoiets',
})
else:
keuze.zoek_vraag_locatie = 'kippenfarm'
keuze.save()
return 
HttpResponseRedirect(reverse('zoekopdrachten:zelfverwerking.html', 
args=(vraag.id,)))


#
#   Vraag - details van de zoekvraag
def vraag(request, zoekvraag_id):
vraag = get_object_or_404(ZoekVraag, pk=zoekvraag_id)
return render(request, 'zoekopdrachten/vraag.html', {'vraag': vraag})


#
#   Zelfverwerking - opnemen zoekresultaten in databsae plus eigen 
beoordeling
def zelfverwerking(request, zoekvraag_id):
vraag = get_object_or_404(ZoekVraag, pk=zoekvraag_id)
return render(request, 'zoekopdrachten/zelfverwerking.html', {'vraag': 
vraag})

and *urls.py*:
""" 
zoekopdrachten: urls.py

"""

from django.conf.urls import url

from . import views

urlpatterns = [
# ex: /zoekopdrachten/
url(r'^$', views.index, name='index'),
# ex: /zoekopdrachten/5/
url(r'^(?P[0-9]+)/$', views.vraag, name='vraag'),
# ex: /zoekopdrachten/5/zelfverwerking/
url(r'^(?P[0-9]+)/zelfverwerking/$', 
views.zelfverwerking, name='zelfverwerking'),
# ex: /zoekopdrachten/5/klantverwerking/
url(r'^(?P[0-9]+)/klantverwerking/$', 
views.klantverwerking, name='klantverwerking'),
# ex: /zoekopdrachten/5/resultaat/
url(r'^(?P[0-9]+)/resultaat/$', views.resultaat, 
name='resultaat'),
]


and *vraag.html*:
Zoekvraag "{{ vraag.zoekvraag_id }}"

{% if error_message %}
{{ error_message }}

{% endif %}

Verzamelen resultaten

{% csrf_token %}
{% for term in vraag.zoekvraagterm_set.all %}

1
{% endfor %}












-- 
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/d6e5eb3f-c7bc-4890-8c31-c5622f6a9bb2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: I want to make todo List

2015-09-26 Thread Bob Gailer
That's a noble objective. To help us help you please be more specific and
detailed. I assume since you are communicating with the Django list that
you want a web app that will give the user a place where he can enter
edit/delete etc search for to do activities and a place on the cloud to
store the data. Please tell us why you want to do this as opposed to using
something that someone else has already built. Also realize that we prefer
to work with those who have made an effort to create something and who tell
us what you've done so far where you're stuck. Please take this as
encouragement to go ahead, be specific and detailed when you ask us
questions. Good luck.
On Sep 26, 2015 6:46 AM, "Ram Lakhan Agarwal" 
wrote:

> I want step by step procedure to make todolist
>
> --
> 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/95b6d182-44c6-45a0-91bb-99cfd92e7b1d%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAP1rxO4zJJRZGH45%3D3EsN6fkZpeHttoyZeTdcPAGLkv%3DwyTOoQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: cms web buyilding

2014-08-16 Thread Bob Gailer
Go to the joomla site and see what you think.

Bob gailer
On Aug 16, 2014 6:05 AM, "ngangsia akumbo" <ngang...@gmail.com> wrote:

> I was having an augment about learning how to code from scratch and using
> content management systems like joomla, dupal to build websites.
>
> This guy was telling they can make any web application using Joomla the
> the other cms out there.
> He does not need to learn coding.
> so if that was possible why do people still learn how to code from scratch?
>
> So i need to get your opinion about this?
>
>
>
>  --
> 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/5383030b-f2bb-4a8a-b3ed-5064e462d966%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/5383030b-f2bb-4a8a-b3ed-5064e462d966%40googlegroups.com?utm_medium=email_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/CAP1rxO7Vz_U3PRPHQDceMDfvdnFPc1jqy6MdRiY%2B%3DE4_6sGWhw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django HTML5 & CSS validation - Best Practice?

2014-06-06 Thread Bob Cochran

On 06/05/2014 08:33 PM, 77c...@gmail.com wrote:
what is the best practice to validate HTML5 and CSS? 


I use this: http://validator.w3.org/ & http://jigsaw.w3.org/css-validator/

Is there something better?

Bob

--
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/53929082.4020007%40mindchasers.com.
For more options, visit https://groups.google.com/d/optout.


Re: csrf question

2014-05-15 Thread Bob Gailer
On May 15, 2014 2:36 AM, "G Z"  wrote:
>
> So I read the documentation on passing csrf tokens, however its giving me
an issue i think its because im trying to pass it as a dictonary variable
with my form and customers.
>
> This is from the documentation
>
> from django.views.decorators.csrf import csrf_protect
> from django.shortcuts import render
>
> @csrf_protect
> def my_view(request):
> c = {}
> # ...
> return render(request, "a_template.html", c)
>
>
>
> from django.shortcuts import render
> from django.http import HttpResponse
> from vmware.models import Customer
> from django.shortcuts import render_to_response
> from vmware.models import Vms
> from .forms import SignUpForm
> from vmware.models import Vmspecs
> from django.views.decorators.csrf import csrf_protect
>
> @csrf_protect
> def index(request):
> c = {}
> form = SignUpForm(request.POST or None)
> if form.is_valid():
> save_it = form.save(commit=False)
> save_it.save()
> customers = Customer.objects.all()
> ctx = { 'customers':customers, 'form':form, c}
Line 19 (above) syntax error at /, c/
> return render_to_response('index.html', ctx)
>
>
>
> this is the error i get
>
>
> Environment:
>
>
> Request Method: GET
> Request URL: http://23.239.206.142:8000/
>
> Django Version: 1.6.4
> Python Version: 2.7.3
> Installed Applications:
> ('django.contrib.admin',
>  'django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.sessions',
>  'django.contrib.messages',
>  'django.contrib.staticfiles',
>  'vmware')
> Installed Middleware:
> ('django.contrib.sessions.middleware.SessionMiddleware',
>  'django.middleware.common.CommonMiddleware',
>  'django.middleware.csrf.CsrfViewMiddleware',
>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>  'django.contrib.messages.middleware.MessageMiddleware',
>  'django.middleware.clickjacking.XFrameOptionsMiddleware')
>
>
> Traceback:
> File
"/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in
get_response
>   101. resolver_match =
resolver.resolve(request.path_info)
> File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py"
in resolve
>   337. for pattern in self.url_patterns:
> File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py"
in url_patterns
>   365. patterns = getattr(self.urlconf_module, "urlpatterns",
self.urlconf_module)
> File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py"
in urlconf_module
>   360. self._urlconf_module = import_module(self.urlconf_name)
> File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py"
in import_module
>   40. __import__(name)
> File "/root/djangoprojects/provisioning/provisioning/urls.py" in 
>   7. url(r'^customers/', include('vmware.urls')),
> File
"/usr/local/lib/python2.7/dist-packages/django/conf/urls/__init__.py" in
include
>   26. urlconf_module = import_module(urlconf_module)
> File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py"
in import_module
>   40. __import__(name)
> File "/root/djangoprojects/provisioning/vmware/urls.py" in 
>   5. from vmware import views
>
> Exception Type: SyntaxError at /
> Exception Value: invalid syntax (views.py, line 19)
>
>
> --
> 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/d9c8f4e7-1636-45d4-9877-2b01bdaf357b%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAP1rxO4VNuQwe5XoawwGWToemyx_or4WdiACOZzsZ4wOK-KvqA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie: do I need to upload in order to access data?

2013-08-11 Thread Bob Aalsma
Hi Tom,

OK, thanks.

The file I'd want to read is a parameter file which contains user specific 
information. I just need to know the data to guide the actions, no need to 
store or keep it.
So I'll just accept the upload, extract the data and then delete the upload.
Oh well ;)

Regards,
Bob

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Newbie: do I need to upload in order to access data?

2013-08-11 Thread Bob Aalsma
Thanks Nigel.

OK, at least this has stopped me running around in circles and I can continue 
from here.

I would think you can do stuff client side, but this is probably more Python 
and less Django - to be solved in future releases ;)

Regards,
Bob

Op 11 aug. 2013, om 00:10 heeft Nigel Legg <nigel.l...@gmail.com> het volgende 
geschreven:

> The file is uploaded - ie it is copied onto the server drive.  
> I don't think you can do stuff client side with Django - beyond my knowledge. 
> 
> Regards,
> Nigel Legg
> 07914 740972
> http://www.trevanianlegg.co.uk
> http://twitter.com/nigellegg
> http://uk.linkedin.com/in/nigellegg
> 
> 
> 
> On 10 August 2013 18:04, Bob Aalsma <overhaalsgang_24_...@me.com> wrote:
> Thanks Nigel, this looks very promising ;)
> 
> If I interpret your text correctly, this is based on the upload/save example 
> I mentioned.
> I'm really interested in the meaning of parts your closing paragraph:
> "This saves the file in 'media/documents/2013/08/10/datafile.csv'." - I think 
> this means the contents of the file is copied from the user disk to my disk, 
> right? 
> "pointing them to the correct directory and file." - could I not simply point 
> to the original directory and file (on the user's machine) and read the 
> contents from that location?
> 
> Regards,
> Bob
> 
> Op zaterdag 10 augustus 2013 18:39:38 UTC+2 schreef Nigel Legg:
> I've based my process a minimal file upload - I think based on the answer to 
> the link above.  I use:
> models.py:
> class Document(models.Model):
> docfile = models.FileField(upload_to='documents/%Y/%m/%d')
> 
> views.py:
> def list(request):
> # Handle file uploadf
> if request.method == 'POST':
> form = DocumentForm(request.POST, request.FILES)
> if form.is_valid():
> newdoc = Document(docfile = request.FILES['docfile'])
> newdoc.save()
> 
> # Redirect to the document list after POST
> return HttpResponseRedirect(reverse('myproject.myapp.views.list'))
> else:
> form = DocumentForm() # A empty, unbound form
> 
> # Load documents for the list page
> documents = Document.objects.all()
> 
> # Render list page with the documents and the form
> return render_to_response(
> 'myapp/list.html',
> {'documents': documents, 'form': form},
> context_instance=RequestContext(request)
> )
> 
> forms.py:
> class DocumentForm(forms.Form):
> docfile = forms.FileField(
> label='Select a file',
> help_text='max. 42 megabytes'
> )
> 
> This saves the file in 'media/documents/2013/08/10/datafile.csv'.  You can 
> then access this using the normal open() and read() functions, pointing them 
> to the correct directory and file.  As far as I can see, the data remains in 
> the file you upload, but the location and name are stored in the database - 
> in this case, "documents/2013/10/08/datafile.csv". 
> 
> Hope this helps 
> 
> Regards,
> Nigel Legg
> 07914 740972
> http://www.trevanianlegg.co.uk
> http://twitter.com/nigellegg
> http://uk.linkedin.com/in/nigellegg
> 
> 
> 
> On 10 August 2013 15:52, Bob Aalsma <overhaalsg...@me.com> wrote:
> Hi,
> 
> I'm trying to achieve the following:
> user indicates a file on his/her machine 
> the program opens the file, reads the data and acts on that
> 
> So far, I can find examples of indicating the file on the user's machine, but 
> this is always combined with saving to database (which I don't want); the 
> clearest example I could find is 
> http://stackoverflow.com/questions/5871730/need-a-minimal-django-file-upload-example
> 
> Question 1: is it really necessary to store the data in my database?
> 
> If not, I've not been able to find how to actually open and read the file.
> I've been trying out variations on reading, based on what I could find in the 
> Tutorials and Managing files 
> (https://docs.djangoproject.com/en/1.5/topics/files/ ) but I don't seem to 
> understand how to actually find the path and filename the user would have 
> indicated. I seem to get completely lost in FileField and FieldFile and 
> connected methods 
> 
> Question 2: how do I find the indicated path and filename from the user?
> 
> Regards,
> Bob
> 
> -- 
> 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 http://grou

Re: Newbie: do I need to upload in order to access data?

2013-08-10 Thread Bob Aalsma
Thanks Nigel, this looks very promising ;)

If I interpret your text correctly, this is based on the upload/save 
example I mentioned.
I'm really interested in the meaning of parts your closing paragraph:

   - "This saves the file in 'media/documents/2013/08/10/datafile.csv'." - 
   I think this means the contents of the file is copied from the user disk to 
   my disk, right? 
   - "pointing them to the correct directory and file." - could I not 
   simply point to the *original* directory and file (on the user's 
   machine) and read the contents from that location?


Regards,
Bob

Op zaterdag 10 augustus 2013 18:39:38 UTC+2 schreef Nigel Legg:
>
> I've based my process a minimal file upload - I think based on the answer 
> to the link above.  I use:
> models.py:
> class Document(models.Model):
> docfile = models.FileField(upload_to='documents/%Y/%m/%d')
>
> views.py:
> def list(request):
> # Handle file uploadf
> if request.method == 'POST':
> form = DocumentForm(request.POST, request.FILES)
> if form.is_valid():
> newdoc = Document(docfile = request.FILES['docfile'])
> newdoc.save()
>
> # Redirect to the document list after POST
> return 
> HttpResponseRedirect(reverse('myproject.myapp.views.list'))
> else:
> form = DocumentForm() # A empty, unbound form
>
> # Load documents for the list page
> documents = Document.objects.all()
>
> # Render list page with the documents and the form
> return render_to_response(
> 'myapp/list.html',
> {'documents': documents, 'form': form},
> context_instance=RequestContext(request)
> )
>
> forms.py:
> class DocumentForm(forms.Form):
> docfile = forms.FileField(
> label='Select a file',
> help_text='max. 42 megabytes'
> )
>
> This saves the file in 'media/documents/2013/08/10/datafile.csv'.  You can 
> then access this using the normal open() and read() functions, pointing 
> them to the correct directory and file.  As far as I can see, the data 
> remains in the file you upload, but the location and name are stored in the 
> database - in this case, "documents/2013/10/08/datafile.csv". 
>
> Hope this helps 
>
> Regards,
> Nigel Legg
> 07914 740972
> http://www.trevanianlegg.co.uk
> http://twitter.com/nigellegg
> http://uk.linkedin.com/in/nigellegg
>
>
>
> On 10 August 2013 15:52, Bob Aalsma <overhaalsg...@me.com >wrote:
>
>> Hi,
>>
>> I'm trying to achieve the following:
>>
>>- user indicates a file on his/her machine 
>>- the program opens the file, reads the data and acts on that 
>>
>>
>> So far, I can find examples of indicating the file on the user's machine, 
>> but this is always combined with saving to database (which I don't want); 
>> the clearest example I could find is 
>> http://stackoverflow.com/questions/5871730/need-a-minimal-django-file-upload-example
>>
>> Question 1: is it really necessary to store the data in my database?
>>
>> If not, I've not been able to find how to actually open and read the file.
>> I've been trying out variations on reading, based on what I could find in 
>> the Tutorials and Managing files (
>> https://docs.djangoproject.com/en/1.5/topics/files/ ) but I don't seem 
>> to understand how to actually find the path and filename the user would 
>> have indicated. I seem to get completely lost in FileField and FieldFile 
>> and connected methods 
>>
>> Question 2: how do I find the indicated path and filename from the user?
>>
>> Regards,
>> Bob
>>
>> -- 
>> 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 http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>
 

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Newbie: do I need to upload in order to access data?

2013-08-10 Thread Bob Aalsma
Hi,

I'm trying to achieve the following:

   - user indicates a file on his/her machine 
   - the program opens the file, reads the data and acts on that


So far, I can find examples of indicating the file on the user's machine, 
but this is always combined with saving to database (which I don't want); 
the clearest example I could find 
is 
http://stackoverflow.com/questions/5871730/need-a-minimal-django-file-upload-example

Question 1: is it really necessary to store the data in my database?

If not, I've not been able to find how to actually open and read the file.
I've been trying out variations on reading, based on what I could find in 
the Tutorials and Managing files 
(https://docs.djangoproject.com/en/1.5/topics/files/ ) but I don't seem to 
understand how to actually find the path and filename the user would have 
indicated. I seem to get completely lost in FileField and FieldFile and 
connected methods 

Question 2: how do I find the indicated path and filename from the user?

Regards,
Bob

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django Translation: Why is there no pgettext_noop or npgettext_noop?

2013-07-10 Thread Bob Barcklay
HI Ramiro,

Perhaps I am confused.  I just want to mark these strings for extraction by 
makemessages(xgettext) in one component of my system and store them in a 
database.  Another component will do the actual translation by calling 
pgettext.I can probably use the _lazy methods to achieve the same thing 
but I'll need to serialize these lazy proxy objects to my database and that 
just seems more complicated. Why not just use the original string and 
invoke pgettext at the right time?  Does the _lazy version do something 
else for me?  

-Bob


On Tuesday, July 9, 2013 4:10:42 PM UTC-7, Ramiro Morales wrote:
>
> On Tue, Jul 9, 2013 at 7:02 PM, Bob Barcklay <bbar...@thuuz.com> 
> wrote: 
> > I want to use contextual markers and plural forms in strings with 
> deferred 
> > translation.  I'm curious why _noop versions of pggettext and npgettext 
> > don't appear anywhere. 
>
> What do _noop-suffixed version(s) of gettext function(s) have to do with 
> contextual markers, plural forms and deferred translation? 
>
> Are you confusing _noop with _lazy? 
>
> > My plan is to modify the xgettext invocation found 
> > in django/core/management/commands/makemessages.py to include new 
> --keywords 
> > for pgettext_noop and npgettext_noop.  Is this the correct approach? 
>
> -- 
> Ramiro Morales 
> @ramiromorales 
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Django Translation: Why is there no pgettext_noop or npgettext_noop?

2013-07-09 Thread Bob Barcklay
I want to use contextual markers and plural forms in strings with deferred 
translation.  I'm curious why _noop versions of pggettext and npgettext 
don't appear anywhere.  My plan is to modify the xgettext invocation found 
in django/core/management/commands/makemessages.py to include new 
--keywords for pgettext_noop and npgettext_noop.  Is this the correct 
approach?

-Bob



-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-15 Thread Bob Haugen
Ok, got a friend to try this using python2.7 and did not get the naive
datetime warnings.

So I conclude it is something about either python2.6 or something else
in my local environment, and not a proper django-users concern.

P.S. Chris, thanks again for all the help.  You're really active
responding on django-users lately.

On Sat, Dec 15, 2012 at 4:13 AM, Bob Haugen <bob.hau...@gmail.com> wrote:
> On Sat, Dec 15, 2012 at 1:16 AM, Chris Cogdon <ch...@cogdon.org> wrote:
>> I never got the warnings you got, but I got three errors along the lines of:
>> IntegrityError: valueaccounting_economicagent.created_date may not be NULL
>
>> Want me to grab a different revision from git ?
>
> Fixed that one.  You could do a git pull if you really want.  And huge
> thanks for all the work.
>
> But I wonder why I never got that error (which was clearly an error,
> which I have been oblivious about), and you did not get the naive
> datetime warnings...?
>
> Some diff between python2.7 and python2.6?  I'll have a local friend
> try it later today.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-15 Thread Bob Haugen
On Sat, Dec 15, 2012 at 1:16 AM, Chris Cogdon  wrote:
> I never got the warnings you got, but I got three errors along the lines of:
> IntegrityError: valueaccounting_economicagent.created_date may not be NULL

> Want me to grab a different revision from git ?

Fixed that one.  You could do a git pull if you really want.  And huge
thanks for all the work.

But I wonder why I never got that error (which was clearly an error,
which I have been oblivious about), and you did not get the naive
datetime warnings...?

Some diff between python2.7 and python2.6?  I'll have a local friend
try it later today.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-14 Thread Bob Haugen
Also, I recognize this is way beyond the call of duty, but if you
really want to reproduce the problem, you might need to follow:
https://github.com/valnet/valuenetwork/blob/master/docs/install.txt

On Fri, Dec 14, 2012 at 7:06 PM, Chris Cogdon  wrote:
> Checked out the code and attempted to run "manage.py test", but clearly I
> don't have all the required modules installed. Sure is a lot of them!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-14 Thread Bob Haugen
I'm running ./manage.py test valueaccounting

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-14 Thread Bob Haugen
On Fri, Dec 14, 2012 at 6:07 PM, Chris Cogdon  wrote:
> Throw the code up somewhere I can see the results for myself?

https://github.com/valnet/valuenetwork/blob/master/valuenetwork/valueaccounting/tests.py

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-14 Thread Bob Haugen
But sincerely, Chris, thanks for hanging in there on this.  I baffled.

On Fri, Dec 14, 2012 at 5:51 PM, Bob Haugen <bob.hau...@gmail.com> wrote:
> On Fri, Dec 14, 2012 at 5:42 PM, Chris Cogdon <ch...@cogdon.org> wrote:
>> Okay, so when you create your datetimes, are you defining them with a
>> timezone ?
>
> I tried that; did not make any difference.  The error messages came up
> before any of the test setup code ran.  (I put a pdb trace in at the
> start; the error messages had already happened.)
>
> I did not create any datetimes.  I did create dates, but they did not
> cause any errors. The errors had already arisen way before then.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-14 Thread Bob Haugen
On Fri, Dec 14, 2012 at 5:42 PM, Chris Cogdon  wrote:
> Okay, so when you create your datetimes, are you defining them with a
> timezone ?

I tried that; did not make any difference.  The error messages came up
before any of the test setup code ran.  (I put a pdb trace in at the
start; the error messages had already happened.)

I did not create any datetimes.  I did create dates, but they did not
cause any errors. The errors had already arisen way before then.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-14 Thread Bob Haugen
On Fri, Dec 14, 2012 at 3:02 PM, Chris Cogdon  wrote:
> Nothing definitive, but from checking the location of the code that is
> raising the warning, I suspect one of the following:
>
> 1. USE_TZ is not set in your production code, but _is_ set in your settings
> file for your tests. Of course, your code should work either way for the
> most flexibility.

USE_TZ is set in settings.py (in production code)
>
> 2. The test database you are using (ie, from fixtures or otherwise) has
> non-timezone dates and times, and USE_TZ is set in your testing settings
> files. In these cases your test data and the USE_TZ setting should be
> matching.

No fixtures. Creating test objects in the test setup code.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: newbie: patch required? procedure? [closed ticket 16017 / createsuperuser]

2012-09-14 Thread Bob Aalsma
Well, I have tried your suggestion in all places I could think of and none 
of those helped: the createsuperuser kept returning the same error message. 
I posted this as a reply some 24 hours ago.

 


Op donderdag 13 september 2012 16:58:11 UTC+2 schreef Bob Aalsma het 
volgende:
>
> I'm a newbie following the tutorial. In this, creating a superuser is 
> described, using 
>
> manage.py createsuperuser --username=joe --email=j...@example.com
>
>
> Using this leads to an error, which I could match to the closed ticket 
> #16017.
>
> But I couldn't find how to proceed from there. It seems some software was 
> changed about 4 weeks ago:
> "Made createsuperuser more robust when getting current OS username."
>
> So where can I find it?
> [I'm assuming there is a procedure for this, but I'm sorry to say I 
> couldn't find that either]
>
> Regards,
> Bob
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/WnCSyDEH9WYJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: newbie: patch required? procedure? [closed ticket 16017 / createsuperuser]

2012-09-14 Thread Bob Aalsma
SOLVED by Tom Evans:
insert 
unset LC_CTYPE ; export LANG="nl_NL.UTF-8"
into .bash_profile



Op donderdag 13 september 2012 16:58:11 UTC+2 schreef Bob Aalsma het 
volgende:
>
> I'm a newbie following the tutorial. In this, creating a superuser is 
> described, using 
>
> manage.py createsuperuser --username=joe --email=j...@example.com
>
>
> Using this leads to an error, which I could match to the closed ticket 
> #16017.
>
> But I couldn't find how to proceed from there. It seems some software was 
> changed about 4 weeks ago:
> "Made createsuperuser more robust when getting current OS username."
>
> So where can I find it?
> [I'm assuming there is a procedure for this, but I'm sorry to say I 
> couldn't find that either]
>
> Regards,
> Bob
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/Lb8favCcs-YJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



  1   2   3   >