Re: ORM for structured Logs

2017-04-07 Thread guettli


Am Donnerstag, 6. April 2017 10:42:17 UTC+2 schrieb Christian Ledermann:
>
> On 6 April 2017 at 09:15, guettli > 
> wrote: 
> > Hello Brick Wall, how are you doing? 
>
> Hello Stonemason. 
>
> What is your question? 
>
>

It was more an idea than a question.

The question could be: What do you think about this idea?

I am lazy and like postgresql. Up to now we store are logs in files and we 
search for an alternative.

I am unfamiliar with ElasticSearch (DB of ELK-Stack).

ELK-Stack is very popular, but maybe is overrated. I don't know. Why not 
use PostgreSQL?



 

> I do not have a strong opinion on your approach - i don't even know 
> the problem you are trying to solve. 
> or how big your logs are. a couple of KB per day or some GB per hour? 
>
>
Traffic does not play any role here. This question is only about the 
structure (tables and columns), not about the rows.

 

> [the brickwall shrugs its shoulders] 
>
>

Thank you for your reply.


 

-- 
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/cc315693-bd7b-47a0-bb54-c83a822bf4a9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ORM for structured Logs

2017-04-07 Thread guettli
Hi Marten,

Am Donnerstag, 6. April 2017 14:10:58 UTC+2 schrieb knbk:
>
> Hi Thomas,
>
> The primary purpose of logging is to catch and examine errors. If 
> something went wrong, you want to know *when *and *why*. Logging to a 
> database increases the complexity and greatly increases the number of 
> things that can go wrong. The last thing you want to find out when 
> retracing an error is that you don't have any logs because the logging 
> system failed. You may also need to log errors that happened during 
> startup, before a database connection can be established. Logging to file 
> is the simplest method, and has the least chance of failure. That's why you 
> should always log to file. 
>
> The two options are not mutually exclusive. Like you said, times have 
> changed, and the overhead to store logs both in a file and in a database 
> are nowadays acceptable. If you have a good reason to store the logs in a 
> database, then go ahead. Just remember that it should be *in addition to 
> *file-based 
> logging. 
>
>
Yes, you are right. During the initialization of processes no db 
connections exists yet. I don't like redundancy but here its needed for a 
higher availability. 

Thank you for your reply.

-- 
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/a9a0fe4e-4b65-4ceb-8336-cc4ceeb82f2c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Channels Redis/channelfull spam without any ws connections.

2017-04-07 Thread dave . mcallister . dev

>
> 1491540549.292837 [0 lua] "LPOP" "asgi:daphne.response.tJbmVMXFGX!"
> 1491540549.343335 [0 unix:/var/run/redis/redis.sock] "EVALSHA" 
> "3640886a0c8901ca9188f5f7a5f7a346145b9c5f" "1" 
> "asgi:daphne.response.tJbmVMXFGX!"
> 1491540549.343373 [0 lua] "LPOP" "asgi:daphne.response.tJbmVMXFGX!"
> 1491540549.393917 [0 unix:/var/run/redis/redis.sock] "EVALSHA" 
> "3640886a0c8901ca9188f5f7a5f7a346145b9c5f" "1" 
> "asgi:daphne.response.tJbmVMXFGX!"
> 1491540549.393954 [0 lua] "LPOP" "asgi:daphne.response.tJbmVMXFGX!"
> 1491540549.25 [0 unix:/var/run/redis/redis.sock] "EVALSHA" 
> "3640886a0c8901ca9188f5f7a5f7a346145b9c5f" "1" 
> "asgi:daphne.response.tJbmVMXFGX!"
> 1491540549.63 [0 lua] "LPOP" "asgi:daphne.response.tJbmVMXFGX!"
> 1491540549.494980 [0 unix:/var/run/redis/redis.sock] "EVALSHA" 
> "3640886a0c8901ca9188f5f7a5f7a346145b9c5f" "1" 
> "asgi:daphne.response.tJbmVMXFGX!"
> 1491540549.495016 [0 lua] "LPOP" "asgi:daphne.response.tJbmVMXFGX!"
> 1491540549.545484 [0 unix:/var/run/redis/redis.sock] "EVALSHA" 
> "3640886a0c8901ca9188f5f7a5f7a346145b9c5f" "1" 
> "asgi:daphne.response.tJbmVMXFGX!"
> 1491540549.545521 [0 lua] "LPOP" "asgi:daphne.response.tJbmVMXFGX!"
> 1491540549.595958 [0 unix:/var/run/redis/redis.sock] "EVALSHA" 
> "3640886a0c8901ca9188f5f7a5f7a346145b9c5f" "1" 
> "asgi:daphne.response.tJbmVMXFGX!"
> 1491540549.595993 [0 lua] "LPOP" "asgi:daphne.response.tJbmVMXFGX!"
> 1491540549.646517 [0 unix:/var/run/redis/redis.sock] "EVALSHA" 
> "3640886a0c8901ca9188f5f7a5f7a346145b9c5f" "1" 
> "asgi:daphne.response.tJbmVMXFGX!"
> 1491540549.646554 [0 lua] "LPOP" "asgi:daphne.response.tJbmVMXFGX!"
>
> My redis gets spammed by this while running 2 daphne workers, without 
anything connected over websocket.

This leads to asgiref.base_layer.ChannelFull and 
redis.exceptions.ResponseError: full spam:

Traceback (most recent call last):
>
>   File "/venv/lib/python3.5/site-packages/channels/sessions.py", line 143, 
>> in inner
>
> message.channel_layer.send(wait_channel, message.content)
>
>   File "/venv/lib/python3.5/site-packages/asgi_redis/core.py", line 177, 
>> in send
>
> raise self.ChannelFull
>
> asgiref.base_layer.ChannelFull
>
>
>> During handling of the above exception, another exception occurred:
>
>
>> Traceback (most recent call last):
>
>   File "/venv/lib/python3.5/site-packages/channels/worker.py", line 119, 
>> in run
>
> consumer(message, **kwargs)
>
>   File "/venv/lib/python3.5/site-packages/channels/sessions.py", line 78, 
>> in inner
>
> return func(*args, **kwargs)
>
>   File "/venv/lib/python3.5/site-packages/channels/sessions.py", line 147, 
>> in inner
>
> "full __wait__ channel for socket %s" % message.reply_channel.name
>
> asgiref.base_layer.ChannelFull: Cannot add unordered message to already 
>> full __wait__ channel for socket daphne.response.GFPKnFFpIJ!bEgDPXUyqb
>
> 2017-04-07 03:57:26,015 - ERROR - worker - Error processing message with 
>> consumer stats.consumers.ws_receive:
>
> Traceback (most recent call last):
>
>   File "/venv/lib/python3.5/site-packages/asgi_redis/core.py", line 162, 
>> in send
>
> client=connection,
>
>   File "/venv/lib/python3.5/site-packages/redis/client.py", line 2694, in 
>> __call__
>
> return client.evalsha(self.sha, len(keys), *args)
>
>   File "/venv/lib/python3.5/site-packages/redis/client.py", line 1944, in 
>> evalsha
>
> return self.execute_command('EVALSHA', sha, numkeys, *keys_and_args)
>
>   File "/venv/lib/python3.5/site-packages/redis/client.py", line 573, in 
>> execute_command
>
> return self.parse_response(connection, command_name, **options)
>
>   File "/venv/lib/python3.5/site-packages/redis/client.py", line 585, in 
>> parse_response
>
> response = connection.read_response()
>
>   File "/venv/lib/python3.5/site-packages/redis/connection.py", line 582, 
>> in read_response
>
> raise response
>
> redis.exceptions.ResponseError: full
>
>
>> During handling of the above exception, another exception occurred:
>
>
>> Traceback (most recent call last):
>
>   File "/venv/lib/python3.5/site-packages/channels/sessions.py", line 143, 
>> in inner
>
> message.channel_layer.send(wait_channel, message.content)
>
>   File "/venv/lib/python3.5/site-packages/asgi_redis/core.py", line 177, 
>> in send
>
> raise self.ChannelFull
>
> asgiref.base_layer.ChannelFull
>
>
>> During handling of the above exception, another exception occurred:
>
>
>> Traceback (most recent call last):
>
>   File "/venv/lib/python3.5/site-packages/channels/worker.py", line 119, 
>> in run
>
> consumer(message, **kwargs)
>
>   File "/venv/lib/python3.5/site-packages/channels/sessions.py", line 78, 
>> in inner
>
> return func(*args, **kwargs)
>
>   File "/venv/lib/python3.5/site-packages/channels/sessions.py", line 147, 
>> in inner
>
> "full __wait__ channel for socket %s" % message.reply_channel.name
>
> asgiref.base_layer.ChannelFull: Cannot add unordered message to already 
>> full __wait__ ch

Re: Channels Redis/channelfull spam without any ws connections.

2017-04-07 Thread Andrew Godwin
The first part is normal Redis traffic for Daphne. It polls Redis in a
pretty tight loop in synchronous mode (and this is, annoyingly, faster than
the slow poll in Twisted-native mode).

The second part is an unrelated error that appears to be from handling a
WebSocket that was incoming - is it reproduceable? If so, could you file an
issue on the Channels GitHub with versions and steps to reproduce?

Andrew

On Fri, Apr 7, 2017 at 7:00 AM,  wrote:

> 1491540549.292837 [0 lua] "LPOP" "asgi:daphne.response.tJbmVMXFGX!"
>> 1491540549.343335 [0 unix:/var/run/redis/redis.sock] "EVALSHA" "
>> 3640886a0c8901ca9188f5f7a5f7a346145b9c5f" "1" "asgi:daphne.response.
>> tJbmVMXFGX!"
>> 1491540549.343373 [0 lua] "LPOP" "asgi:daphne.response.tJbmVMXFGX!"
>> 1491540549.393917 [0 unix:/var/run/redis/redis.sock] "EVALSHA" "
>> 3640886a0c8901ca9188f5f7a5f7a346145b9c5f" "1" "asgi:daphne.response.
>> tJbmVMXFGX!"
>> 1491540549.393954 [0 lua] "LPOP" "asgi:daphne.response.tJbmVMXFGX!"
>> 1491540549.25 [0 unix:/var/run/redis/redis.sock] "EVALSHA" "
>> 3640886a0c8901ca9188f5f7a5f7a346145b9c5f" "1" "asgi:daphne.response.
>> tJbmVMXFGX!"
>> 1491540549.63 [0 lua] "LPOP" "asgi:daphne.response.tJbmVMXFGX!"
>> 1491540549.494980 [0 unix:/var/run/redis/redis.sock] "EVALSHA" "
>> 3640886a0c8901ca9188f5f7a5f7a346145b9c5f" "1" "asgi:daphne.response.
>> tJbmVMXFGX!"
>> 1491540549.495016 [0 lua] "LPOP" "asgi:daphne.response.tJbmVMXFGX!"
>> 1491540549.545484 [0 unix:/var/run/redis/redis.sock] "EVALSHA" "
>> 3640886a0c8901ca9188f5f7a5f7a346145b9c5f" "1" "asgi:daphne.response.
>> tJbmVMXFGX!"
>> 1491540549.545521 [0 lua] "LPOP" "asgi:daphne.response.tJbmVMXFGX!"
>> 1491540549.595958 [0 unix:/var/run/redis/redis.sock] "EVALSHA" "
>> 3640886a0c8901ca9188f5f7a5f7a346145b9c5f" "1" "asgi:daphne.response.
>> tJbmVMXFGX!"
>> 1491540549.595993 [0 lua] "LPOP" "asgi:daphne.response.tJbmVMXFGX!"
>> 1491540549.646517 [0 unix:/var/run/redis/redis.sock] "EVALSHA" "
>> 3640886a0c8901ca9188f5f7a5f7a346145b9c5f" "1" "asgi:daphne.response.
>> tJbmVMXFGX!"
>> 1491540549.646554 [0 lua] "LPOP" "asgi:daphne.response.tJbmVMXFGX!"
>>
>> My redis gets spammed by this while running 2 daphne workers, without
> anything connected over websocket.
>
> This leads to asgiref.base_layer.ChannelFull and 
> redis.exceptions.ResponseError:
> full spam:
>
> Traceback (most recent call last):
>>
>>   File "/venv/lib/python3.5/site-packages/channels/sessions.py", line
>>> 143, in inner
>>
>> message.channel_layer.send(wait_channel, message.content)
>>
>>   File "/venv/lib/python3.5/site-packages/asgi_redis/core.py", line 177,
>>> in send
>>
>> raise self.ChannelFull
>>
>> asgiref.base_layer.ChannelFull
>>
>>
>>> During handling of the above exception, another exception occurred:
>>
>>
>>> Traceback (most recent call last):
>>
>>   File "/venv/lib/python3.5/site-packages/channels/worker.py", line 119,
>>> in run
>>
>> consumer(message, **kwargs)
>>
>>   File "/venv/lib/python3.5/site-packages/channels/sessions.py", line
>>> 78, in inner
>>
>> return func(*args, **kwargs)
>>
>>   File "/venv/lib/python3.5/site-packages/channels/sessions.py", line
>>> 147, in inner
>>
>> "full __wait__ channel for socket %s" % message.reply_channel.name
>>
>> asgiref.base_layer.ChannelFull: Cannot add unordered message to already
>>> full __wait__ channel for socket daphne.response.GFPKnFFpIJ!bEgDPXUyqb
>>
>> 2017-04-07 03:57:26,015 - ERROR - worker - Error processing message with
>>> consumer stats.consumers.ws_receive:
>>
>> Traceback (most recent call last):
>>
>>   File "/venv/lib/python3.5/site-packages/asgi_redis/core.py", line 162,
>>> in send
>>
>> client=connection,
>>
>>   File "/venv/lib/python3.5/site-packages/redis/client.py", line 2694,
>>> in __call__
>>
>> return client.evalsha(self.sha, len(keys), *args)
>>
>>   File "/venv/lib/python3.5/site-packages/redis/client.py", line 1944,
>>> in evalsha
>>
>> return self.execute_command('EVALSHA', sha, numkeys, *keys_and_args)
>>
>>   File "/venv/lib/python3.5/site-packages/redis/client.py", line 573, in
>>> execute_command
>>
>> return self.parse_response(connection, command_name, **options)
>>
>>   File "/venv/lib/python3.5/site-packages/redis/client.py", line 585, in
>>> parse_response
>>
>> response = connection.read_response()
>>
>>   File "/venv/lib/python3.5/site-packages/redis/connection.py", line
>>> 582, in read_response
>>
>> raise response
>>
>> redis.exceptions.ResponseError: full
>>
>>
>>> During handling of the above exception, another exception occurred:
>>
>>
>>> Traceback (most recent call last):
>>
>>   File "/venv/lib/python3.5/site-packages/channels/sessions.py", line
>>> 143, in inner
>>
>> message.channel_layer.send(wait_channel, message.content)
>>
>>   File "/venv/lib/python3.5/site-packages/asgi_redis/core.py", line 177,
>>> in send
>>
>> raise self.ChannelFull
>>
>> asgiref.base_layer.ChannelFull
>>
>>
>>> During handling of the above exception, another excepti

[BUG] Django 1.11 backward compatibility bug when several authentication backends are in use

2017-04-07 Thread Raffi Enficiaud
Hi Django list!

I am using a django-crowd authentication backend and the deployment today 
was not working with our setup. I nailed it down to the fact that the 
backward compatibility is not working as expected for 1.11 for the 
authenticate method:

https://docs.djangoproject.com/en/1.11/topics/auth/default/#django.contrib.auth.authenticate

Step to reproduce:
- add an authentication backend using Django < 1.11 API at the end of the 
authentication backend list supplied by AUTHENTICATION_BACKENDS. At the 
end, or at least not in the first position, is important here
- try to log in with a user in this backend

Expected result:
- the authenticate method is called for this authentication backend

What happens:
- the authentication backend is discarded as it does not (supposedly) have 
the right API. It works as expected if the authentication backend is first 
in the list.

Bug explanation:
* the credential dictionary is polluted by the "request" argument after the 
first iteration in django/contrib/auth/__init__.py line 92
* after the first loop, all calls to 
"inspect.getcallargs(backend.authenticate, **credentials)" (line 81, same 
file) with the Django <= 1.10 API can only fail because they raise the 
exception TypeError indicating that they do not support this API

The fix needs to move to the new API, I think it should at least be 
advertised as a breaking change in the release notes, or this bug should be 
fixed by not adding the "request" to the "credentials" dict. 

Thanks for the wonderful work on Django, I am so much in love with this!

Best regards,
Raffi Enficiaud

-- 
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/18df46d6-aeab-4cd0-8c2a-7cdaa4d78469%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Integrating the Werkzeug web based debugger with Django - A lightweight management command

2017-04-07 Thread Juan Saavedra
Hello,

We created a small management command to run a tweaked version of the 
Werkzeug dev server and debugger in Django.

A small intro and description is available at 
https://www.octobot.io/blog/django-rundbg-release/

It is particularly useful for debugging REST APIs, but not exclusively.

PRs and Issue reports are welcome 
at https://github.com/octobot-dev/django-rundbg

We hope you find it as useful as we do,
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/8f4491dc-96cf-455e-8f5c-4d97ac3ee321%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


add a secretballot middleware to MIDDLEWARE_CLASSES

2017-04-07 Thread shahab emami
hello 
i have a simple question
please help me if you can


i want to install this package on my project:

https://pypi.python.org/pypi/django-secretballot/

I am doing the installation step by step but after adding 'secretballot', 
to my installed_apps It says:

* add a secretballot middleware to MIDDLEWARE_CLASSES (see middleware 
section for details)


I now where MIDDLEWARE_CLASSES is. it's in setteings.py right after 
installed_apps but i don't
what I have to add to it. 
can you tell me what's the point when it says "add a secretballot 
middleware" ?
i mean how many secretballot middleware we have that i have to add one of 
them to my installed_apps?

thank you 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f10101b2-0991-4ac0-af23-59ec14870149%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: add a secretballot middleware to MIDDLEWARE_CLASSES

2017-04-07 Thread Daniel Roseman


On Friday, 7 April 2017 15:46:36 UTC+1, shahab emami wrote:
>
> hello 
> i have a simple question
> please help me if you can
>
>
> i want to install this package on my project:
>
> https://pypi.python.org/pypi/django-secretballot/
>
> I am doing the installation step by step but after adding 'secretballot', 
> to my installed_apps It says:
>
> * add a secretballot middleware to MIDDLEWARE_CLASSES (see middleware 
> section for details)
>
>
> I now where MIDDLEWARE_CLASSES is. it's in setteings.py right after 
> installed_apps but i don't
> what I have to add to it. 
> can you tell me what's the point when it says "add a secretballot 
> middleware" ?
> i mean how many secretballot middleware we have that i have to add one of 
> them to my installed_apps?
>
> thank you again
>


Well, as you quoted, the instruction goes on to say "see middleware section 
for details". That section does indeed show you what to put in the setting.
--
DR.

-- 
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/48339fee-6e5a-4f42-b0ba-d1d3771403dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to make a dynamic table/form

2017-04-07 Thread rosettas
Hi All

I want to make a dynamic table which display data and editable.

The rows and columns could be inserted to table from table viewing, not 
necessary to go to other form for data submitting.

same as the cells which could be also edited.

is there something ready in Django? or is any package suggested for 
starting to do it?

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/e53f2fed-e662-4494-b8fa-b4edb376dc10%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [BUG] Django 1.11 backward compatibility bug when several authentication backends are in use

2017-04-07 Thread René Fleschenberg
Hi Raffi,

Thanks for taking the time to report this. Can you please file an issue
at https://code.djangoproject.com/? The people who deal with triaging
and fixing bugs may not be following the django-users list.

Thanks!
René


On 04/07/2017 03:43 PM, Raffi Enficiaud wrote:
> Hi Django list!
> 
> I am using a django-crowd authentication backend and the deployment
> today was not working with our setup. I nailed it down to the fact that
> the backward compatibility is not working as expected for 1.11 for the
> authenticate method:
> 
> https://docs.djangoproject.com/en/1.11/topics/auth/default/#django.contrib.auth.authenticate
> 
> Step to reproduce:
> - add an authentication backend using Django < 1.11 API at the end of
> the authentication backend list supplied by AUTHENTICATION_BACKENDS. At
> the end, or at least not in the first position, is important here
> - try to log in with a user in this backend
> 
> Expected result:
> - the authenticate method is called for this authentication backend
> 
> What happens:
> - the authentication backend is discarded as it does not (supposedly)
> have the right API. It works as expected if the authentication backend
> is first in the list.
> 
> Bug explanation:
> * the credential dictionary is polluted by the "request" argument after
> the first iteration in django/contrib/auth/__init__.py line 92
> * after the first loop, all calls to
> "inspect.getcallargs(backend.authenticate, **credentials)" (line 81,
> same file) with the Django <= 1.10 API can only fail because they raise
> the exception TypeError indicating that they do not support this API
> 
> The fix needs to move to the new API, I think it should at least be
> advertised as a breaking change in the release notes, or this bug should
> be fixed by not adding the "request" to the "credentials" dict.
> 
> Thanks for the wonderful work on Django, I am so much in love with this!
> 
> Best regards,
> Raffi Enficiaud
> 
> -- 
> 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/18df46d6-aeab-4cd0-8c2a-7cdaa4d78469%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.

-- 
René Fleschenberg

Am Stadtgarten 28, 45276 Essen, Germany
Phone: +49 1577 170 7363
E-Mail: r...@fleschenberg.net

-- 
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/1024611c-9806-a683-890b-f8c547db8740%40fleschenberg.net.
For more options, visit https://groups.google.com/d/optout.


Re: 'migrate' triggers lazy reference error when changing custom user model name

2017-04-07 Thread Олег Ямников
Hello!

I'm having the same problem right now. Have you found any solution? That 
would be very helpful to me.

Thank you.

On Wednesday, December 7, 2016 at 5:18:55 PM UTC+5, Johan Cockx wrote:
>
> I am running  Django 1.10.4 with Python 3.4.3, learning about Django.
>
> I created a custom user model 'MyUser' copied from the Django docs at 
> https://docs.djangoproject.com/en/1.10/topics/auth/customizing/#substituting-a-custom-user-model;
>  
>  this works fine.
>
> Then I renamed the model from 'MyUser' to 'TheUser', updating models.py, 
> admin.py and settings.py and succesfully ran 'makemigrations'.  Then,  when 
> I run 'migrate',  I get the traceback below.
>
> If I temporarily comment the AUTH_USER_MODEL setting, makemigrations works 
> fine, but as soon as I uncomment the AUTH_USER_MODEL setting again,  both 
> 'makemigrations' and 'migrate' fail with the same error and a similar 
> traceback.
> I did not do any additional changes to the model, so makemigrations and 
> migrate should actually not do anything at this point.
>
> Is this a bug?
>
> I have attached a complete project that can be used to reproduce the 
> problem.
>
>
> $ python manage.py makemigrations
> Did you rename the auth_by_email.MyUser model to TheUser? [y/N] y
> Migrations for 'admin':
>   
> /home/johan/Seafile/main/sikando/Projects/doclr/env/lib/python3.4/site-packages/django/contrib/admin/migrations/0003_auto_20161207_1018.py:
> - Alter field user on logentry
> Migrations for 'auth_by_email':
>   auth_by_email/migrations/0003_auto_20161207_1018.py:
> - Rename model MyUser to TheUser
>
> $ python manage.py migrate
> Operations to perform:
>   Apply all migrations: admin, auth, auth_by_email, contenttypes, sessions
> Traceback (most recent call last):
>   File "/home/johan/work/backend/manage.py", line 22, in 
> execute_from_command_line(sys.argv)
>   File 
> "/home/johan/Seafile/main/sikando/Projects/doclr/env/lib/python3.4/site-packages/django/core/management/__init__.py",
>  
> line 367, in execute_from_command_line
> utility.execute()
>   File 
> "/home/johan/Seafile/main/sikando/Projects/doclr/env/lib/python3.4/site-packages/django/core/management/__init__.py",
>  
> line 359, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "/home/johan/Seafile/main/sikando/Projects/doclr/env/lib/python3.4/site-packages/django/core/management/base.py",
>  
> line 294, in run_from_argv
> self.execute(*args, **cmd_options)
>   File 
> "/home/johan/Seafile/main/sikando/Projects/doclr/env/lib/python3.4/site-packages/django/core/management/base.py",
>  
> line 345, in execute
> output = self.handle(*args, **options)
>   File 
> "/home/johan/Seafile/main/sikando/Projects/doclr/env/lib/python3.4/site-packages/django/core/management/commands/migrate.py",
>  
> line 164, in handle
> pre_migrate_apps = pre_migrate_state.apps
>   File 
> "/home/johan/Seafile/main/sikando/Projects/doclr/env/lib/python3.4/site-packages/django/utils/functional.py",
>  
> line 35, in __get__
> res = instance.__dict__[self.name] = self.func(instance)
>   File 
> "/home/johan/Seafile/main/sikando/Projects/doclr/env/lib/python3.4/site-packages/django/db/migrations/state.py",
>  
> line 176, in apps
> return StateApps(self.real_apps, self.models)
>   File 
> "/home/johan/Seafile/main/sikando/Projects/doclr/env/lib/python3.4/site-packages/django/db/migrations/state.py",
>  
> line 249, in __init__
> raise ValueError("\n".join(error.msg for error in errors))
> ValueError: The field admin.LogEntry.user was declared with a lazy 
> reference to 'auth_by_email.theuser', but app 'auth_by_email' doesn't 
> provide model 'theuser'.
>

-- 
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/5268e09c-5164-4bf1-984a-6e8a243f0698%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Setting up an App and getting an import error

2017-04-07 Thread Nate Granatir
I may be speaking a bit out of my depth here, but I wonder if it's maybe 
because you haven't created __init__.py files in the directories? I believe 
Django (well, Python), requires an empty __init__.py file in directories 
when loading them as modules:
https://docs.python.org/3/tutorial/modules.html#packages

If it's not that, then I have no idea!

Nate

On Wednesday, April 5, 2017 at 11:28:23 AM UTC-5, jjander...@gmail.com 
wrote:
>
>
> Hi,
>
> I'm setting up a Django app using Django 1.10.3 and python 3.5.2. When I 
> run the following command in my 3.5.2 virtual environment:
>
>   
>
> *python manage.py runserver*prior to entering the  app in INSTALLED_APPS 
> in settings.py, my webpage comes up fine.
>
>
> When I add the following line to INSTALLED_APPS:
>
>   *  'util.siggy.apps.SiggyConfig',*
>
> I get the following error message:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *Unhandled exception in thread started by  check_errors..wrapper at 0x7f47313e7620>Traceback (most recent call 
> last):  File 
> "/home/jja/testenv3.5/lib/python3.5/site-packages/django/utils/autoreload.py",
>  
> line 226, in wrapperfn(*args, **kwargs)  File 
> "/home/jja/testenv3.5/lib/python3.5/site-packages/django/core/management/commands/runserver.py",
>  
> line 113, in inner_runautoreload.raise_last_exception()  File 
> "/home/jja/testenv3.5/lib/python3.5/site-packages/django/utils/autoreload.py",
>  
> line 249, in raise_last_exceptionsix.reraise(*_exception)  File 
> "/home/jja/testenv3.5/lib/python3.5/site-packages/django/utils/six.py", 
> line 685, in reraiseraise value.with_traceback(tb)  File 
> "/home/jja/testenv3.5/lib/python3.5/site-packages/django/utils/autoreload.py",
>  
> line 226, in wrapperfn(*args, **kwargs)  File 
> "/home/jja/testenv3.5/lib/python3.5/site-packages/django/__init__.py", line 
> 27, in setupapps.populate(settings.INSTALLED_APPS)  File 
> "/home/jja/testenv3.5/lib/python3.5/site-packages/django/apps/registry.py", 
> line 85, in populateapp_config = AppConfig.create(entry)  File 
> "/home/jja/testenv3.5/lib/python3.5/site-packages/django/apps/config.py", 
> line 116, in createmod = import_module(mod_path)  File 
> "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
> return _bootstrap._gcd_import(name[level:], package, level)  File " importlib._bootstrap>", line 986, in _gcd_import  File " importlib._bootstrap>", line 969, in _find_and_load  File " importlib._bootstrap>", line 944, in _find_and_load_unlocked  File " importlib._bootstrap>", line 222, in _call_with_frames_removed  File 
> "", line 986, in _gcd_import  File " importlib._bootstrap>", line 969, in _find_and_load  File " importlib._bootstrap>", line 956, in _find_and_load_unlockedImportError: No 
> module named 'util.siggy'*In my project directory, I have a path 
> .../project_dir/util/siggy/apps.py that has the class SiggyConfig defined 
> in it.
>
> It looks to me that python is not finding my util/siggy directory, but I'm 
> not sure why. I included a print statement
> in manage.py and it prinsts out the sys.path as:
>
>
>
>
>
>
>
>
>
> *['/home/jja/prog/dev/newSiggy', 
> '/home/jja/testenv3.5/lib/python3.5/site-packages/django_classy_tags-0.8.0-py3.5.egg',
>  '/home/jja/testenv3.5/lib', '/usr/lib/python35.zip', '/usr/lib/python3.5', 
> '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/usr/lib/python3.5/lib-dynload', 
> '/home/jja/testenv3.5/lib/python3.5/site-packages']*
>
> where /home/jja/prog/dev/newSiggy is the path to my Django project root.
>
> The full path to my app is /home/jja/prog/dev/newSiggy/util/siggy/apps.py.
>
> It is a mystery to my why python cannot find 'util.siggy'.
>
> I've looked on the web and have not found a case that seems to match mine 
> (some are close). I have tried changing a few
> path related settings, but so far, no success.
>
> Any suggestions on what to try next?
>
> Jim A.
>
>  
>

-- 
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/cd7eca9e-7ea2-4bcd-8c05-97bedc26cd6b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Just learning about auth in django and getting error NoReverseMatch ; Exception Value: Reverse for 'password_reset_done' with arguments

2017-04-07 Thread Thames Khi
My example is simple, I am happy to use the standard views and templates 
provided by Django.


NoReverseMatch at /myapp/password/reset/

Reverse for 'password_reset_done' with arguments '()' and keyword arguments 
'{}' not found. 0 pattern(s) tried: []

Request Method: GET
Request URL: http://192.168.0.2:8000/myapp/password/reset/
Django Version: 1.10.6
Exception Type: NoReverseMatch
Exception Value: 

Reverse for 'password_reset_done' with arguments '()' and keyword arguments 
'{}' not found. 0 pattern(s) tried: []

Exception Location: 
H:\APPS\Python35-32\lib\site-packages\django\urls\resolvers.py 
in _reverse_with_prefix, line 392
Python Executable: H:\APPS\Python35-32\python.exe


My code:

Urls.py

from django.conf.urls import url
from django.core.urlresolvers import reverse_lazy
from . import views
from django.contrib.auth.views import ( login,
logout,
password_reset,
password_reset_done,
password_reset_confirm,
password_reset_complete
)

app_name = 'myapp'

urlpatterns = [
# /prices/

  url(r'^$', views.home, name='home'),
  url(r'^myapp/',views.home, name='home'),
  url(r'^login/$', login, {'template_name':'myapp/login.html'}),
  url(r'^logout/$', logout, {'template_name': 'myapp/logged_out.html'}),
  url(r'^register/', views.register, name='register'),
  url(r'^profile/$', views.profile, name='profile'),
  url(r'^edit/$', views.edit_profile, name='edit_profile'),
  url(r'^change-pass', views.change_password, name='change_password'),
  url(r'^password/reset/done/$', password_reset_done, 
name='password_reset_done'),
  url(r'^password/reset/$', password_reset, name='password_reset'),
  url(r'^password/reset/confirm/$', password_reset_confirm, 
name='password_reset_confirm'),
  url(r'^password/reset/complete/$', password_reset_complete, 
name='password_reset_complete')

]



-- 
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/1a9a9f0e-21d8-4038-a681-1736c1cc0073%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: How to make a dynamic table/form

2017-04-07 Thread Matthew Pava
Datatables has an Editor.
https://datatables.net/

There’s also a package that let’s Django and Datatables talk with each other 
quite well.
https://pypi.python.org/pypi/django-datatables-view


From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of roset...@gmail.com
Sent: Friday, April 7, 2017 10:45 AM
To: Django users
Subject: How to make a dynamic table/form

Hi All

I want to make a dynamic table which display data and editable.

The rows and columns could be inserted to table from table viewing, not 
necessary to go to other form for data submitting.

same as the cells which could be also edited.

is there something ready in Django? or is any package suggested for starting to 
do it?

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/e53f2fed-e662-4494-b8fa-b4edb376dc10%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/b4fec000aad240b5b7017c0ae91629f2%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.


Re: Best way to use Django with Knockout.js

2017-04-07 Thread Karthic Raghupathi
I'm looking for something similar and stumbled on this: 
http://stackoverflow.com/questions/10403094/using-knockout-js-with-django-forms.
 
Hope that helps.

On Saturday, May 3, 2014 at 12:04:45 AM UTC-4, Paul Rule wrote:
>
> Hi, I was wondering if there are any good resources for demonstrating how 
> best to use django with knockoutjs. I've come across a couple of projects 
> which might help:
>
> http://www.django-rest-framework.org/
> https://github.com/Miserlou/django-knockout-modeler
>
> I can see how I'd easily interact with knockout by just returning json 
> responses, but when it comes to filling in forms, submitting them, and 
> displaying validation errors, I'm not sure.
>
> Any hints?
>

-- 
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/88be3755-c3ba-44b1-8511-f94619b96edb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: add a secretballot middleware to MIDDLEWARE_CLASSES

2017-04-07 Thread shahab emami
tanks
but my problem is:
I don't know where middleware section  is.
i looked for middleware section  in the app but i couldn't find anything.
that's why i asked that question here

On Friday, April 7, 2017 at 9:10:05 PM UTC+4:30, Daniel Roseman wrote:
>
>
>
> On Friday, 7 April 2017 15:46:36 UTC+1, shahab emami wrote:
>>
>> hello 
>> i have a simple question
>> please help me if you can
>>
>>
>> i want to install this package on my project:
>>
>> https://pypi.python.org/pypi/django-secretballot/
>>
>> I am doing the installation step by step but after adding 'secretballot', 
>> to my installed_apps It says:
>>
>> * add a secretballot middleware to MIDDLEWARE_CLASSES (see middleware 
>> section for details)
>>
>>
>> I now where MIDDLEWARE_CLASSES is. it's in setteings.py right after 
>> installed_apps but i don't
>> what I have to add to it. 
>> can you tell me what's the point when it says "add a secretballot 
>> middleware" ?
>> i mean how many secretballot middleware we have that i have to add one of 
>> them to my installed_apps?
>>
>> thank you again
>>
>
>
> Well, as you quoted, the instruction goes on to say "see middleware 
> section for details". That section does indeed show you what to put in the 
> setting.
> --
> DR.
>

-- 
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/a51dbbf7-c195-4563-a1e2-0f2526447ce7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Was Form choice.choice_value silently removed in 1.11?

2017-04-07 Thread Rodney Folz
Ah, you're right. I must have missed that. Thanks very much!

On Tuesday, April 4, 2017 at 7:45:43 PM UTC-7, Tim Graham wrote:
>
> It looks like that's covered here:
>
>
> https://docs.djangoproject.com/en/1.11/releases/1.11/#changes-due-to-the-introduction-of-template-based-widget-rendering
>
> choice_value is an attribute of ChoiceInput which was undocumented and 
> removed.
>
> On Tuesday, April 4, 2017 at 7:33:18 PM UTC-4, Rodney Folz wrote:
>>
>> Hi all, congrats on the 1.11 release!
>>
>> Prior to Django 1.11's form template rendering, I had a form template 
>> that rendered choices like so:
>>
>> ```
>> {% for choice in form.field_with_choices %} # forms.ChoiceField()
>> {% if choice.choice_value is Value %}
>> ```
>>
>> Not the prettiest, but it's worked for now. When upgrading from 1.10 to 
>> 1.11, our tests around these templates broke. I couldn't find anything in 
>> the 1.11 release/upgrade notes about this, so I did a bit of digging.
>>
>> The reason seems to be that the new form rendering uses the 
>> django.forms.boundfield.BoundWidget class, which doesn't have a 
>> choice_value attribute/method. It does have choice_label() and other 
>> related methods, just not choice_value(). Previous widget rendering exposed 
>> choice.choice_value to the template, not choice._choice_value, so this 
>> seems to be a regression.
>>
>> Was the removal of choice.choice_value() on purpose? If so, would you be 
>> open to a PR for the release notes indicating that it was removed in favor 
>> of using `choice.data.value`?
>>
>> Best,
>> Rodney
>>
>>

-- 
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/12162cb7-c4b0-43b7-ad05-13757b93984f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to structure this django application

2017-04-07 Thread Rich Shepard

  Caveat: I'm not a professional coder or web developer, but have written
many applications over the years. Because I'm also new to django I need
insights into how to structure an application application supporting
multiple users, each in its own private section.

  This application will allow my clients to upload data to the web site,
each in his own space. Data will be stored in a postgres-9.6+ backend.
Generated reports will be available for download.

  I understand that a django application has many 'apps' in it and is not a
single-file framework. If there is an example of how to set up and structure
such an application please point me to it so I can learn from success.

  Pointers, references to docs or web sites will be appreciated and used.

TIA,

Rich


Re: How to structure this django application

2017-04-07 Thread Sithembewena Lloyd Dube
Hey Rich,

My best recommendation for structuring Django projects (and for
optimization and a myriad other goodies) would be the book Two Scoops of
Django by Daniel and Audrey Roy Greenfeld. I could say a lot but the bottom
line is, check the book out. It's at https://www.twoscoopspress.com/

There are various factors to consider and this book (to me, at least) best
encapsulates all those. I believe that it also applies for newer versions
of Django than v1.8.

Best regards,
Sithembewena

On Apr 8, 2017 00:53, "Rich Shepard"  wrote:

>   Caveat: I'm not a professional coder or web developer, but have written
> many applications over the years. Because I'm also new to django I need
> insights into how to structure an application application supporting
> multiple users, each in its own private section.
>
>   This application will allow my clients to upload data to the web site,
> each in his own space. Data will be stored in a postgres-9.6+ backend.
> Generated reports will be available for download.
>
>   I understand that a django application has many 'apps' in it and is not a
> single-file framework. If there is an example of how to set up and
> structure
> such an application please point me to it so I can learn from success.
>
>   Pointers, references to docs or web sites will be appreciated and used.
>
> TIA,
>
> Rich
>

-- 
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/CAH-SnCBJniLDgeieJNskxoNpBrCE-b_rAuQh2zpj63PSUznM-g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Theming

2017-04-07 Thread Clinton Blackburn
Has anyone solved site-aware theming? I have a multi-tenant site (using 
sites framework) and I want to render custom templates for each site. My 
current design calls for a default design, and overrides of the base 
template (or child templates) for each site. Obviously, I can achieve the 
overrides by prepending the site/theme name when I include a 
template/static file. However, this does not allow for easy support of a 
default fall-back.

How have others solved this problem? Are you using thread.local/global 
variables, as I've seen in some locations?

Are there any plans to support a request/site-aware template loader?

Thanks,

Clinton

-- 
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/8aaf04dc-2de7-4972-8ae5-aaaefa2bf17f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to structure this django application

2017-04-07 Thread Rich Shepard

On Sat, 8 Apr 2017, Sithembewena Lloyd Dube wrote:


My best recommendation for structuring Django projects (and for
optimization and a myriad other goodies) would be the book Two Scoops of
Django by Daniel and Audrey Roy Greenfeld. I could say a lot but the bottom
line is, check the book out. It's at https://www.twoscoopspress.com/


Sithembewena,

  I have that book (the 1.8 version); pulled it off the shelf earlier today
to read again.


There are various factors to consider and this book (to me, at least) best
encapsulates all those. I believe that it also applies for newer versions
of Django than v1.8.


  What I need to build is different from a blog, newspaper, e-commerce, and
similar sites ... I think. In those, every visitor/user sees the same views
and has the same options.

  My proposed application needs to be slightly different for each category
of user and keep each in his/her own private section. How to do this may be
in 2 scoops, or may not. If I don't see how to do this I'll be back with
more questions.

Thanks,

Rich


Re: add a secretballot middleware to MIDDLEWARE_CLASSES

2017-04-07 Thread shahab emami
nobody can help me in this?
what i have to add to middleware class?

On Friday, April 7, 2017 at 7:16:36 PM UTC+4:30, shahab emami wrote:
>
> hello 
> i have a simple question
> please help me if you can
>
>
> i want to install this package on my project:
>
> https://pypi.python.org/pypi/django-secretballot/
>
> I am doing the installation step by step but after adding 'secretballot', 
> to my installed_apps It says:
>
> * add a secretballot middleware to MIDDLEWARE_CLASSES (see middleware 
> section for details)
>
>
> I now where MIDDLEWARE_CLASSES is. it's in setteings.py right after 
> installed_apps but i don't
> what I have to add to it. 
> can you tell me what's the point when it says "add a secretballot 
> middleware" ?
> i mean how many secretballot middleware we have that i have to add one of 
> them to my installed_apps?
>
> thank you 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/afa668e0-7464-4045-bd9c-7ec95d429975%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: add a secretballot middleware to MIDDLEWARE_CLASSES

2017-04-07 Thread shahab emami


On Saturday, April 8, 2017 at 1:59:20 AM UTC+4:30, shahab emami wrote:
>
> tanks
> but my problem is:
> I don't know where middleware section  is.
> i looked for middleware section  in the app but i couldn't find anything.
> that's why i asked that question here
>
> On Friday, April 7, 2017 at 9:10:05 PM UTC+4:30, Daniel Roseman wrote:
>>
>>
>>
>> On Friday, 7 April 2017 15:46:36 UTC+1, shahab emami wrote:
>>>
>>> hello 
>>> i have a simple question
>>> please help me if you can
>>>
>>>
>>> i want to install this package on my project:
>>>
>>> https://pypi.python.org/pypi/django-secretballot/
>>>
>>> I am doing the installation step by step but after adding 
>>> 'secretballot', to my installed_apps It says:
>>>
>>> * add a secretballot middleware to MIDDLEWARE_CLASSES (see middleware 
>>> section for details)
>>>
>>>
>>> I now where MIDDLEWARE_CLASSES is. it's in setteings.py right after 
>>> installed_apps but i don't
>>> what I have to add to it. 
>>> can you tell me what's the point when it says "add a secretballot 
>>> middleware" ?
>>> i mean how many secretballot middleware we have that i have to add one 
>>> of them to my installed_apps?
>>>
>>> thank you again
>>>
>>
>>
>> Well, as you quoted, the instruction goes on to say "see middleware 
>> section for details". That section does indeed show you what to put in the 
>> setting.
>> --
>> DR.
>>
>

-- 
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/38dde28b-4e86-4e33-a88c-0a302ceca3c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to structure this django application

2017-04-07 Thread Sithembewena Lloyd Dube
Hey Rich,

Do take the time to peruse the book. It would be time well spent. Also, do
keep in mind that the recommendations therein do not apply to a Django blog
or CRM sustem etc, per se. They would apply just as well if you were
building a RESTful mobile app backend.

The problem you describe of managing users etc is just a requirements
specification. The advice in the book is general enough across
implementations of solutions in broad problem domains. It's not a recipe
book, but more a collection of chefs' knives.

Best regards,
Sithembewena

On Apr 8, 2017 01:34, "Rich Shepard"  wrote:

> On Sat, 8 Apr 2017, Sithembewena Lloyd Dube wrote:
>
> My best recommendation for structuring Django projects (and for
>> optimization and a myriad other goodies) would be the book Two Scoops of
>> Django by Daniel and Audrey Roy Greenfeld. I could say a lot but the
>> bottom
>> line is, check the book out. It's at https://www.twoscoopspress.com/
>>
>
> Sithembewena,
>
>   I have that book (the 1.8 version); pulled it off the shelf earlier today
> to read again.
>
> There are various factors to consider and this book (to me, at least) best
>> encapsulates all those. I believe that it also applies for newer versions
>> of Django than v1.8.
>>
>
>   What I need to build is different from a blog, newspaper, e-commerce, and
> similar sites ... I think. In those, every visitor/user sees the same views
> and has the same options.
>
>   My proposed application needs to be slightly different for each category
> of user and keep each in his/her own private section. How to do this may be
> in 2 scoops, or may not. If I don't see how to do this I'll be back with
> more questions.
>
> Thanks,
>
> Rich
>

-- 
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/CAH-SnCBMuQE%2BPMr4qW5fR6tY1FTdG%2BLJ7-yMYz3eQJL5JkDsUw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: add a secretballot middleware to MIDDLEWARE_CLASSES

2017-04-07 Thread Samuel Brunel
Hi,
MIDDLEWARE is in settings.py of your project.

Sam

Le ven. 7 avr. 2017 23:29, shahab emami  a écrit :

> tanks
> but my problem is:
> I don't know where middleware section  is.
> i looked for middleware section  in the app but i couldn't find anything.
> that's why i asked that question here
>
> On Friday, April 7, 2017 at 9:10:05 PM UTC+4:30, Daniel Roseman wrote:
>
>
>
> On Friday, 7 April 2017 15:46:36 UTC+1, shahab emami wrote:
>
> hello
> i have a simple question
> please help me if you can
>
>
> i want to install this package on my project:
>
> https://pypi.python.org/pypi/django-secretballot/
>
> I am doing the installation step by step but after adding 'secretballot',
> to my installed_apps It says:
>
> * add a secretballot middleware to MIDDLEWARE_CLASSES (see middleware
> section for details)
>
>
> I now where MIDDLEWARE_CLASSES is. it's in setteings.py right after
> installed_apps but i don't
> what I have to add to it.
> can you tell me what's the point when it says "add a secretballot
> middleware" ?
> i mean how many secretballot middleware we have that i have to add one of
> them to my installed_apps?
>
> thank you again
>
>
>
> Well, as you quoted, the instruction goes on to say "see middleware
> section for details". That section does indeed show you what to put in the
> setting.
> --
> DR.
>
> --
> 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/a51dbbf7-c195-4563-a1e2-0f2526447ce7%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/CAJVNoBdpdh8%2ButSTs-JtKXrAYxoCVM2CS2b6CVaqkXaT4%3DEuYw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: add a secretballot middleware to MIDDLEWARE_CLASSES

2017-04-07 Thread shahab emami
I knew where middleware is myself.
if you read my first post you will see that .
my question is:
what i have to add to middleware?

On Friday, April 7, 2017 at 7:16:36 PM UTC+4:30, shahab emami wrote:
>
> hello 
> i have a simple question
> please help me if you can
>
>
> i want to install this package on my project:
>
> https://pypi.python.org/pypi/django-secretballot/
>
> I am doing the installation step by step but after adding 'secretballot', 
> to my installed_apps It says:
>
> * add a secretballot middleware to MIDDLEWARE_CLASSES (see middleware 
> section for details)
>
>
> I now where MIDDLEWARE_CLASSES is. it's in setteings.py right after 
> installed_apps but i don't
> what I have to add to it. 
> can you tell me what's the point when it says "add a secretballot 
> middleware" ?
> i mean how many secretballot middleware we have that i have to add one of 
> them to my installed_apps?
>
> thank you 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/63d353bb-8ef6-4c15-ba79-eb6ce9b80023%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.