Re: Advice: count hits/pageview for high traffic website

2017-03-07 Thread carlos
Daniel, no i say i used django for a website with high traffic maybe 70k
per days, but i need count visit page like
django-hitocunts but the problems like django-hitcount is not for a website
high traffic, the database is very slow ans the website down

my question is exist any method, third party app like django-hitcount but
for site very high traffic Or some idea to do that?

cheers

On Tue, Mar 7, 2017 at 6:04 PM, Daniel Bess  wrote:

> Hi Carlos,
>
> You email is a little unclear.  Are you suggesting I should not use Django
> for a web backend?
>
> Let me know!
>
> Thanks,
>
> Daniel
>
> On Mar 7, 2017, at 3:38 PM, carlos  wrote:
>
> Hi,
> i try used django-hitcount but really not for website high traffic
> any advice for count visits/hits page for 60k or 100k  traffic for day
>
> thank any idea, link or whatever helps
>
> --
> att.
> Carlos Rocha
>
> --
> 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/CAM-7rO1eRU8kNrbq1J9fmO1yTvEnqbhKp
> 3i2YtnFO5U-oGgbLQ%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/C1AB7BB4-BBA6-4156-9826-6C68EE71DF1F%40endocrypt.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
att.
Carlos Rocha

-- 
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/CAM-7rO27%2B8aWAwrAstsvffPBFk%3DTcq29VURG_%2BbX4HdUerOTcQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


SESSION_ENGINE

2017-03-07 Thread mohamed shawky
any one use session and auth
when backend is mongodb 
any 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/9444c0dd-5a6f-44d1-9e8e-cbb151ad41ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Advice: count hits/pageview for high traffic website

2017-03-07 Thread Daniel Bess
Hi Carlos,

You email is a little unclear.  Are you suggesting I should not use Django for 
a web backend?

Let me know!

Thanks,

Daniel

> On Mar 7, 2017, at 3:38 PM, carlos  wrote:
> 
> Hi,
> i try used django-hitcount but really not for website high traffic
> any advice for count visits/hits page for 60k or 100k  traffic for day
> 
> thank any idea, link or whatever helps
> 
> -- 
> att.
> Carlos Rocha
> 
> -- 
> 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/CAM-7rO1eRU8kNrbq1J9fmO1yTvEnqbhKp3i2YtnFO5U-oGgbLQ%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/C1AB7BB4-BBA6-4156-9826-6C68EE71DF1F%40endocrypt.com.
For more options, visit https://groups.google.com/d/optout.


Re: Advice: count hits/pageview for high traffic website

2017-03-07 Thread Shawn Milochik
On Tue, Mar 7, 2017 at 6:38 PM, carlos  wrote:

> Hi,
> i try used django-hitcount but really not for website high traffic
> any advice for count visits/hits page for 60k or 100k  traffic for day
>
> thank any idea, link or whatever helps
>
>
My vote would be for something that uses Redis, or something written in Go.

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


Advice: count hits/pageview for high traffic website

2017-03-07 Thread carlos
Hi,
i try used django-hitcount but really not for website high traffic
any advice for count visits/hits page for 60k or 100k  traffic for day

thank any idea, link or whatever helps

-- 
att.
Carlos Rocha

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


Re: Advice: django deploy vps error 502

2017-03-07 Thread Daniel Hepper
Have a look at the Nginx module ngx_http_limit_req_module 
http://nginx.org/en/docs/http/ngx_http_limit_req_module.html

It allows you to limit the number of requests coming from a single address. 
This will probably be good enough to protect your site against a single 
person running ab, but it won't help against a proper DDoS attack.

Note that if you configure request limiting, that one person running ab 
will see errors, but the site will still work for anyone with a different 
IP address.

Hope that helps,

Daniel Hepper
https://consideratecode.com

On Thursday, March 2, 2017 at 6:56:55 PM UTC+1, sacrac wrote:
>
> Hi, ok i change the uwsgi to gunicorn right now, the problem with error 
> 502 in this moment he disappeared
> but the website in time it gets slow i dont now what is.
> this is the all syslog for today i this moments
>
> Mar  2 17:21:02 prueba gunicorn[1834]: [2017-03-02 17:21:02 +] [21405] 
> [INFO] Booting worker with pid: 21405
> Mar  2 17:25:01 prueba CRON[21454]: (root) CMD (command -v debian-sa1 > 
> /dev/null && debian-sa1 1 1)
> Mar  2 17:25:23 prueba gunicorn[1834]: [2017-03-02 17:25:23 +] [1834] 
> [CRITICAL] WORKER TIMEOUT (pid:1844)
> Mar  2 17:25:24 prueba gunicorn[1834]: [2017-03-02 17:25:24 +] [21459] 
> [INFO] Booting worker with pid: 21459
> Mar  2 17:35:01 prueba CRON[21563]: (root) CMD (command -v debian-sa1 > 
> /dev/null && debian-sa1 1 1)
> Mar  2 17:37:43 prueba gunicorn[1834]: 
> /home/user/virtuales/website/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py:110:
>  
> Warning: Invalid utf8mb4 character string: 'F1613B'
> Mar  2 17:37:43 prueba gunicorn[1834]:   return self.cursor.execute(query, 
> args)
> Mar  2 17:37:43 prueba gunicorn[1834]: 
> /home/user/virtuales/website/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py:110:
>  
> Warning: Incorrect string value: '\xF1a;FBI...' for column 'user_agent' at 
> row 1
> Mar  2 17:37:43 prueba gunicorn[1834]:   return self.cursor.execute(query, 
> args)
> Mar  2 17:45:01 prueba CRON[21679]: (root) CMD (command -v debian-sa1 > 
> /dev/null && debian-sa1 1 1)
>
> any good config for nginx and gunicor for high traffic website??
>
> or stop atack for many people make test like ab or other tools??
>
>
> thank for you help
>
>
>
> On Thu, Mar 2, 2017 at 2:57 AM, Antonis Christofides <
> ant...@djangodeployment.com > wrote:
>
>> Your logs contain this:
>>
>> IOError: write error
>>
>> However, more information is needed in order to understand what is going 
>> on. A simple "write error" on its own is insufficient—is it a hardware 
>> error? Too many open files? Out of disk space? Something else? If your 
>> system writes nothing else in /var/log/syslog at the time the error occurs, 
>> it may be the fault of uwsgi that it doesn't show more information about 
>> the error. Try to increase error message verbosity, if there is an option 
>> to do that.
>>
>> Incidentally, the reason I migrated from uwsgi to gunicorn a few years 
>> ago was that every once in a while I was having a different problem with 
>> uwsgi, which was taking me hours to solve, largely because of insufficient 
>> documentation. After I switched to gunicorn I never looked back.
>>
>> Regards,
>>
>> Antonis
>>
>> Antonis Christofideshttp://djangodeployment.com
>>
>>
>> On 03/01/2017 05:33 PM, carlos wrote:
>>
>> Hello, Antonis i have debug = false, yes 
>> uwsgi dont write anything in the log :/
>> When i see the syslog i see error but not understand!
>> i share this output
>>
>> http://pastebin.com/69yvC8Tz
>>
>> thak for you help
>>
>> On Wed, Mar 1, 2017 at 12:58 AM, Antonis Christofides <
>> ant...@djangodeployment.com > wrote:
>>
>>> Hello,
>>>
>>> 502 usually means the backend isn't running. After you finish the test, 
>>> has the backend stopped running? Does it continue to throw 502s? If that is 
>>> the case, I'm wildly guessing that processes might be growing and growing 
>>> in memory and being eventually killed, but I don't really know. Do you have 
>>> DEBUG = False? Does uwsgi write something in its log? Does the system write 
>>> something in the syslog?
>>>
>>> Regards,
>>>
>>> Antonis
>>>
>>> Antonis Christofideshttp://djangodeployment.com
>>>
>>>
>>> On 02/28/2017 10:49 PM, carlos wrote:
>>>
>>> Hi, all  
>>> i have one vps for one application,
>>>
>>>  vps description
>>>
>>> 16GB RAM
>>> 8 core processor
>>> 160 GB SSD
>>> 6TB Transfer
>>>
>>> ok, i am using, uwsgi(2.0.14), nginx(1.10), mysql(5.6 )and ubuntu 16.04 
>>> LTS
>>> this site working well when is visited or hits 1k even 6k, but when 
>>> visited 10k or 12k
>>> raiser error 502,
>>>
>>> When I do a test of ab like these command line
>>> ab -k -c 350 -n 2 mydomain.com/
>>> again raiser the error 502 in almost pages
>>>
>>> these are configs all, wsgi, nginx
>>>
>>>  uwsgi script in /etc/uwsgi/app-availabre/website.ini -
>>> http://pastebin.com/vQW47WGb
>>>
>>>  nginx conf in /etc/nginx/nginx.conf  --
>>> 

Re: Channels + steam(gevent based package)

2017-03-07 Thread Andrew Godwin
I'm afraid I can't really help with something this complex, it seems like
your problems stem a lot from gevent and process management as well, and
that's a very difficult topic. My general advice would be to try splitting
things up into more separate processes (django management commands can be
good for this) if possible.

Andrew

On Tue, Mar 7, 2017 at 10:50 AM, Lada B  wrote:

> Do you have some advice? How should I start it and still be able to send
> all needed parameters there and use channels send()? When I start new
> Thread it still throws errors and when I start new Process then its broken
> and there i some fork error in the end.
>
> Dne úterý 7. března 2017 19:45:36 UTC+1 Andrew Godwin napsal(a):
>>
>> So you are starting a steam client from a consumer inside a worker
>> process then? Inside a consumer, send() calls will not finish until you
>> return control from the consumer, so maybe that's it?
>>
>> On Tue, Mar 7, 2017 at 10:39 AM, Lada B  wrote:
>>
>>> I call it in signal function after enough of user rows is in DB:
>>>
>>> @receiver(post_save, sender=chat_session)
>>> def on_create_users_online(sender, created, **kwargs):
>>> 
>>> some magic conditions
>>> 
>>>
>>> start_bot(kwargs['instance'].match_id, group1, group2,group_name,
>>> rad_reward, dire_reward, team1, team2)
>>>
>>>
>>> I will try to describe entire process...so:
>>> User connects to websocket and after they are added to group. All users
>>> in group are saved to DB chat_session table.
>>> Once enough users is connected to same group then steam client is
>>> started in signal function above.
>>> Then mess I explained above starts to happen.
>>> Even tho steam client is working properly, channels are not and daphne
>>> crashes because of block forever errors and backpressure.
>>>
>>>
>>>
>>>
>>> Dne úterý 7. března 2017 19:08:39 UTC+1 Andrew Godwin napsal(a):

 Where are you running this steam client from? Presumably not a
 webserver process, as that doesn't have a main thread. Could you explain a
 bit more about the architecture and what channel layers you have 
 configured?

 Andrew

 On Tue, Mar 7, 2017 at 4:06 AM, Lada B  wrote:

> I'm using
>
> https://github.com/ValvePython/steam
> https://github.com/django/channels
>
> and I'm trying to make them work together. Problem is that when
> SteamClient starts I cannot send any message with channels.
>
> Group(group_name).send({
>'text': json.dumps({
>  'match_status': "balancing teams",
> }),
> })
>
> This won't ever send message until SteamClient is running unless I put
> it to new thread. But when i do that I end up with:
>
>
>> gevent.hub.LoopExit: ('This operation would block forever', > 0x7fc465aabd58 epoll pending=0 ref=0 fileno=27>)
>
>
>
> Example of my code:
>
> @client.on('logged_on')
> def start_dota():
> Group(group_name).send({
> 'text': json.dumps({
> 'bot': getSteamProfile(str(client.steam_id)),
>  }),
>  })
>
> dota.launch()
> dota.wait_event('lobby_removed')
>
> I'm trying to solve this for month already and I still cannot find out
> how. I just want to run gevent based SteamClient after i call it from main
> thread. I tried a lot, run it as new process, thread, for example:
>
> p = Thread(target=start_bot, args=(kwargs['instance'].match_id,
> group1, group2,group_name, rad_reward, dire_reward, team1, team2, ))
> p.start()
>
> When I start it as new thread I also get end up with
> gevent.hub.LoopExit: ('This operation would block forever', 
>
> or
>
> start_bot(kwargs['instance'].match_id, group1, group2,group_name,
> rad_reward, dire_reward, team1, team2)
>
> this doesn't send channels messages at all.
>
> Could anyone help me to solve this puzzle? I'm desperate.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f6c574c4-3449
> -4d95-be78-2db3451fcc3a%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

 --
>>> You received this message because you are subscribed to the Google
>>> 

Re: Channels + steam(gevent based package)

2017-03-07 Thread Lada B
Do you have some advice? How should I start it and still be able to send 
all needed parameters there and use channels send()? When I start new 
Thread it still throws errors and when I start new Process then its broken 
and there i some fork error in the end.

Dne úterý 7. března 2017 19:45:36 UTC+1 Andrew Godwin napsal(a):
>
> So you are starting a steam client from a consumer inside a worker process 
> then? Inside a consumer, send() calls will not finish until you return 
> control from the consumer, so maybe that's it?
>
> On Tue, Mar 7, 2017 at 10:39 AM, Lada B  
> wrote:
>
>> I call it in signal function after enough of user rows is in DB:
>>
>> @receiver(post_save, sender=chat_session)
>> def on_create_users_online(sender, created, **kwargs):
>> 
>> some magic conditions
>> 
>>
>> start_bot(kwargs['instance'].match_id, group1, group2,group_name, 
>> rad_reward, dire_reward, team1, team2)
>> 
>>
>> I will try to describe entire process...so:
>> User connects to websocket and after they are added to group. All users 
>> in group are saved to DB chat_session table.
>> Once enough users is connected to same group then steam client is started 
>> in signal function above.
>> Then mess I explained above starts to happen.
>> Even tho steam client is working properly, channels are not and daphne 
>> crashes because of block forever errors and backpressure.
>>
>>
>>
>>
>> Dne úterý 7. března 2017 19:08:39 UTC+1 Andrew Godwin napsal(a):
>>>
>>> Where are you running this steam client from? Presumably not a webserver 
>>> process, as that doesn't have a main thread. Could you explain a bit more 
>>> about the architecture and what channel layers you have configured?
>>>
>>> Andrew
>>>
>>> On Tue, Mar 7, 2017 at 4:06 AM, Lada B  wrote:
>>>
 I'm using 

 https://github.com/ValvePython/steam
 https://github.com/django/channels

 and I'm trying to make them work together. Problem is that when 
 SteamClient starts I cannot send any message with channels.

 Group(group_name).send({
'text': json.dumps({
  'match_status': "balancing teams",
 }),
 })

 This won't ever send message until SteamClient is running unless I put 
 it to new thread. But when i do that I end up with: 


> gevent.hub.LoopExit: ('This operation would block forever',  0x7fc465aabd58 epoll pending=0 ref=0 fileno=27>)



 Example of my code:

 @client.on('logged_on')
 def start_dota():
 Group(group_name).send({
 'text': json.dumps({
 'bot': getSteamProfile(str(client.steam_id)),
  }),
  })

 dota.launch()
 dota.wait_event('lobby_removed')

 I'm trying to solve this for month already and I still cannot find out 
 how. I just want to run gevent based SteamClient after i call it from main 
 thread. I tried a lot, run it as new process, thread, for example:

 p = Thread(target=start_bot, args=(kwargs['instance'].match_id, group1, 
 group2,group_name, rad_reward, dire_reward, team1, team2, ))
 p.start()

 When I start it as new thread I also get end up with 
 gevent.hub.LoopExit: ('This operation would block forever', 

 or

 start_bot(kwargs['instance'].match_id, group1, group2,group_name, 
 rad_reward, dire_reward, team1, team2)

 this doesn't send channels messages at all.

 Could anyone help me to solve this puzzle? I'm desperate.


 -- 
 You received this message because you are subscribed to the Google 
 Groups "Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to django-users...@googlegroups.com.
 To post to this group, send email to django...@googlegroups.com.
 Visit this group at https://groups.google.com/group/django-users.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/django-users/f6c574c4-3449-4d95-be78-2db3451fcc3a%40googlegroups.com
  
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/fac65b2c-f7ad-4431-81c2-d86f8dc890f3%40googlegroups.com
>>  
>> 

Simple Join with no matching primary keys

2017-03-07 Thread ayshalab
Greetings,

I am trying to do a join on the following 2 models (tables)

class Rio1(models.Model):
datestr = models.DateTimeField()
source = models.TextField()
dFlag = models.TextField()
url = models.TextField()

class Meta:
managed = False
db_table = 'rio1'

class Rio2(models.Model):
datestr = models.DateTimeField()
source = models.TextField()
dFlag = models.TextField()
url = models.TextField()

class Meta:
managed = False
db_table = 'rio2'


In each table there is a primary ID column, but it does not have the same 
values in both tables, only datestr and source are the identical, now the 
trick is that both datestr and source are appearing 4 times per every 
single day, hence I can't set datestr or source to be unique primary keys. 

When I did a simple dummy join, the Django query yields no results because 
it is joing on the ID column which is of course won't bring back any 
matched records from the two tables. What would be the correct way to join 
such tables?

Many 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/1792f5ee-7858-4987-b2fc-246eb74e16e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Channels + steam(gevent based package)

2017-03-07 Thread Lada B
I call it in signal function after enough of user rows is in DB:

@receiver(post_save, sender=chat_session)
def on_create_users_online(sender, created, **kwargs):

some magic conditions


start_bot(kwargs['instance'].match_id, group1, group2,group_name, 
rad_reward, dire_reward, team1, team2)


I will try to describe entire process...so:
User connects to websocket and after they are added to group. All users in 
group are saved to DB chat_session table.
Once enough users is connected to same group then steam client is started 
in signal function above.
Then mess I explained above starts to happen.
Even tho steam client is working properly, channels are not and daphne 
crashes because of block forever errors and backpressure.




Dne úterý 7. března 2017 19:08:39 UTC+1 Andrew Godwin napsal(a):
>
> Where are you running this steam client from? Presumably not a webserver 
> process, as that doesn't have a main thread. Could you explain a bit more 
> about the architecture and what channel layers you have configured?
>
> Andrew
>
> On Tue, Mar 7, 2017 at 4:06 AM, Lada B  
> wrote:
>
>> I'm using 
>>
>> https://github.com/ValvePython/steam
>> https://github.com/django/channels
>>
>> and I'm trying to make them work together. Problem is that when 
>> SteamClient starts I cannot send any message with channels.
>>
>> Group(group_name).send({
>>'text': json.dumps({
>>  'match_status': "balancing teams",
>> }),
>> })
>>
>> This won't ever send message until SteamClient is running unless I put it 
>> to new thread. But when i do that I end up with: 
>>
>>
>>> gevent.hub.LoopExit: ('This operation would block forever', >> 0x7fc465aabd58 epoll pending=0 ref=0 fileno=27>)
>>
>>
>>
>> Example of my code:
>>
>> @client.on('logged_on')
>> def start_dota():
>> Group(group_name).send({
>> 'text': json.dumps({
>> 'bot': getSteamProfile(str(client.steam_id)),
>>  }),
>>  })
>>
>> dota.launch()
>> dota.wait_event('lobby_removed')
>>
>> I'm trying to solve this for month already and I still cannot find out 
>> how. I just want to run gevent based SteamClient after i call it from main 
>> thread. I tried a lot, run it as new process, thread, for example:
>>
>> p = Thread(target=start_bot, args=(kwargs['instance'].match_id, group1, 
>> group2,group_name, rad_reward, dire_reward, team1, team2, ))
>> p.start()
>>
>> When I start it as new thread I also get end up with gevent.hub.LoopExit: 
>> ('This operation would block forever', 
>>
>> or
>>
>> start_bot(kwargs['instance'].match_id, group1, group2,group_name, 
>> rad_reward, dire_reward, team1, team2)
>>
>> this doesn't send channels messages at all.
>>
>> Could anyone help me to solve this puzzle? I'm desperate.
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/f6c574c4-3449-4d95-be78-2db3451fcc3a%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/fac65b2c-f7ad-4431-81c2-d86f8dc890f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Channels + steam(gevent based package)

2017-03-07 Thread Andrew Godwin
So you are starting a steam client from a consumer inside a worker process
then? Inside a consumer, send() calls will not finish until you return
control from the consumer, so maybe that's it?

On Tue, Mar 7, 2017 at 10:39 AM, Lada B  wrote:

> I call it in signal function after enough of user rows is in DB:
>
> @receiver(post_save, sender=chat_session)
> def on_create_users_online(sender, created, **kwargs):
> 
> some magic conditions
> 
>
> start_bot(kwargs['instance'].match_id, group1, group2,group_name,
> rad_reward, dire_reward, team1, team2)
>
>
> I will try to describe entire process...so:
> User connects to websocket and after they are added to group. All users in
> group are saved to DB chat_session table.
> Once enough users is connected to same group then steam client is started
> in signal function above.
> Then mess I explained above starts to happen.
> Even tho steam client is working properly, channels are not and daphne
> crashes because of block forever errors and backpressure.
>
>
>
>
> Dne úterý 7. března 2017 19:08:39 UTC+1 Andrew Godwin napsal(a):
>>
>> Where are you running this steam client from? Presumably not a webserver
>> process, as that doesn't have a main thread. Could you explain a bit more
>> about the architecture and what channel layers you have configured?
>>
>> Andrew
>>
>> On Tue, Mar 7, 2017 at 4:06 AM, Lada B  wrote:
>>
>>> I'm using
>>>
>>> https://github.com/ValvePython/steam
>>> https://github.com/django/channels
>>>
>>> and I'm trying to make them work together. Problem is that when
>>> SteamClient starts I cannot send any message with channels.
>>>
>>> Group(group_name).send({
>>>'text': json.dumps({
>>>  'match_status': "balancing teams",
>>> }),
>>> })
>>>
>>> This won't ever send message until SteamClient is running unless I put
>>> it to new thread. But when i do that I end up with:
>>>
>>>
 gevent.hub.LoopExit: ('This operation would block forever', >>> 0x7fc465aabd58 epoll pending=0 ref=0 fileno=27>)
>>>
>>>
>>>
>>> Example of my code:
>>>
>>> @client.on('logged_on')
>>> def start_dota():
>>> Group(group_name).send({
>>> 'text': json.dumps({
>>> 'bot': getSteamProfile(str(client.steam_id)),
>>>  }),
>>>  })
>>>
>>> dota.launch()
>>> dota.wait_event('lobby_removed')
>>>
>>> I'm trying to solve this for month already and I still cannot find out
>>> how. I just want to run gevent based SteamClient after i call it from main
>>> thread. I tried a lot, run it as new process, thread, for example:
>>>
>>> p = Thread(target=start_bot, args=(kwargs['instance'].match_id, group1,
>>> group2,group_name, rad_reward, dire_reward, team1, team2, ))
>>> p.start()
>>>
>>> When I start it as new thread I also get end up with
>>> gevent.hub.LoopExit: ('This operation would block forever', 
>>>
>>> or
>>>
>>> start_bot(kwargs['instance'].match_id, group1, group2,group_name,
>>> rad_reward, dire_reward, team1, team2)
>>>
>>> this doesn't send channels messages at all.
>>>
>>> Could anyone help me to solve this puzzle? I'm desperate.
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/django-users/f6c574c4-3449-4d95-be78-2db3451fcc3a%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/fac65b2c-f7ad-4431-81c2-d86f8dc890f3%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 

Re: Channels + steam(gevent based package)

2017-03-07 Thread Lada B
I call it in signal function after enough of user rows is in DB:

@receiver(post_save, sender=chat_session)
def on_create_users_online(sender, created, **kwargs):

some magic and conditions

start_bot(kwargs['instance'].match_id, group1, group2,group_name, 
rad_reward, dire_reward, team1, team2)

and in steam.py file:

def start_bot(match, group1, group2, group_name, rad_reward, dire_reward, 
team1, team2):

client = SteamClient()
client.set_credential_location("steam_credentials")
dota = Dota2Client(client)


some code


@client.on('logged_on')
def start_dota():
Group(group_name).send({
'text': json.dumps({
'bot': getSteamProfile(str(client.steam_id)),
}),
  })

   dota.launch()
   dota.wait_event('lobby_removed')
.
a lot of events and code
.


client.connect()
client.run_forever()


I will try to describe entire process...so:
User connects to websocket and after they are added to group. All users in 
group are saved to DB chat_session table.
Once enough users is connected to same group then steam client is started 
in signal function above.
Then mess I explained above starts to happen.
Even tho steam client is working properly, channels are not and daphne 
crashes because of block forever errors and backpressure.

Dne úterý 7. března 2017 19:08:39 UTC+1 Andrew Godwin napsal(a):
>
> Where are you running this steam client from? Presumably not a webserver 
> process, as that doesn't have a main thread. Could you explain a bit more 
> about the architecture and what channel layers you have configured?
>
> Andrew
>
> On Tue, Mar 7, 2017 at 4:06 AM, Lada B  
> wrote:
>
>> I'm using 
>>
>> https://github.com/ValvePython/steam
>> https://github.com/django/channels
>>
>> and I'm trying to make them work together. Problem is that when 
>> SteamClient starts I cannot send any message with channels.
>>
>> Group(group_name).send({
>>'text': json.dumps({
>>  'match_status': "balancing teams",
>> }),
>> })
>>
>> This won't ever send message until SteamClient is running unless I put it 
>> to new thread. But when i do that I end up with: 
>>
>>
>>> gevent.hub.LoopExit: ('This operation would block forever', >> 0x7fc465aabd58 epoll pending=0 ref=0 fileno=27>)
>>
>>
>>
>> Example of my code:
>>
>> @client.on('logged_on')
>> def start_dota():
>> Group(group_name).send({
>> 'text': json.dumps({
>> 'bot': getSteamProfile(str(client.steam_id)),
>>  }),
>>  })
>>
>> dota.launch()
>> dota.wait_event('lobby_removed')
>>
>> I'm trying to solve this for month already and I still cannot find out 
>> how. I just want to run gevent based SteamClient after i call it from main 
>> thread. I tried a lot, run it as new process, thread, for example:
>>
>> p = Thread(target=start_bot, args=(kwargs['instance'].match_id, group1, 
>> group2,group_name, rad_reward, dire_reward, team1, team2, ))
>> p.start()
>>
>> When I start it as new thread I also get end up with gevent.hub.LoopExit: 
>> ('This operation would block forever', 
>>
>> or
>>
>> start_bot(kwargs['instance'].match_id, group1, group2,group_name, 
>> rad_reward, dire_reward, team1, team2)
>>
>> this doesn't send channels messages at all.
>>
>> Could anyone help me to solve this puzzle? I'm desperate.
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/f6c574c4-3449-4d95-be78-2db3451fcc3a%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/2f631cd1-db67-48c2-b7ee-eb94d71d1f5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Channels + steam(gevent based package)

2017-03-07 Thread Andrew Godwin
Where are you running this steam client from? Presumably not a webserver
process, as that doesn't have a main thread. Could you explain a bit more
about the architecture and what channel layers you have configured?

Andrew

On Tue, Mar 7, 2017 at 4:06 AM, Lada B  wrote:

> I'm using
>
> https://github.com/ValvePython/steam
> https://github.com/django/channels
>
> and I'm trying to make them work together. Problem is that when
> SteamClient starts I cannot send any message with channels.
>
> Group(group_name).send({
>'text': json.dumps({
>  'match_status': "balancing teams",
> }),
> })
>
> This won't ever send message until SteamClient is running unless I put it
> to new thread. But when i do that I end up with:
>
>
>> gevent.hub.LoopExit: ('This operation would block forever', > 0x7fc465aabd58 epoll pending=0 ref=0 fileno=27>)
>
>
>
> Example of my code:
>
> @client.on('logged_on')
> def start_dota():
> Group(group_name).send({
> 'text': json.dumps({
> 'bot': getSteamProfile(str(client.steam_id)),
>  }),
>  })
>
> dota.launch()
> dota.wait_event('lobby_removed')
>
> I'm trying to solve this for month already and I still cannot find out
> how. I just want to run gevent based SteamClient after i call it from main
> thread. I tried a lot, run it as new process, thread, for example:
>
> p = Thread(target=start_bot, args=(kwargs['instance'].match_id, group1,
> group2,group_name, rad_reward, dire_reward, team1, team2, ))
> p.start()
>
> When I start it as new thread I also get end up with gevent.hub.LoopExit:
> ('This operation would block forever', 
>
> or
>
> start_bot(kwargs['instance'].match_id, group1, group2,group_name,
> rad_reward, dire_reward, team1, team2)
>
> this doesn't send channels messages at all.
>
> Could anyone help me to solve this puzzle? I'm desperate.
>
>
> --
> 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/f6c574c4-3449-4d95-be78-2db3451fcc3a%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/CAFwN1uoCKJb0YyABbOCP86Cw3PLDmQbxmZVEoZHJ53PSnBhowA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Djangoproject tutorial part 1 - keep on getting 404 error on polls

2017-03-07 Thread Vanja Falck
Sorry for my last message! I only checked the main page which don´t have 
any page. Forgot to check the /polls/ 

You are perfectly right - not completing the ^ with return before the next 
character makes the difference! 
Thanks!


tirsdag 7. mars 2017 18.02.48 UTC+1 skrev Vanja Falck følgende:
>
> Checked the ^ sign, but it was only missing a return - no syntax-error or 
> change in the current 404 error, so I assume it is interpreted right.
>
> The error message is only this (deliberately exchanged my actual site with 
> xxx) - with the 404 header:
>
> Using the URLconf defined in xxx.urls, Django tried these URL patterns, 
> in this order:
>
>1. ^polls/
>2. ^admin/
>
> The current URL, , didn't match any of these.
>
>
>
> tirsdag 7. mars 2017 14.11.13 UTC+1 skrev ludovic coues følgende:
>>
>> Is there any information on the 404 page ? 
>> I remember django being quite chatty as long it's in debug mode 
>>
>> 2017-03-07 10:56 GMT+01:00 Vanja Falck : 
>> > Hi, 
>> > I have startet the first part of the djangoproject tutorial and get 
>> stuck in 
>> > part 1 - getting 404 errors on /polls/ - the admin page is ok. 
>> > Any one have an idea about what is wrong? 
>> > 
>> > Followed the instructions carefully (django 1.10 - version). Running in 
>> > virtualenv with python 3.5.2 and django 1.10.6 on Ubuntu 16.04. 
>> > Did follow an advice in this group and added the polls app in 
>> settings.py, 
>> > but it did not help. Nothing else is changed in the autosettings from a 
>> > fresh install of django 10.1.6. 
>> > 
>> > Is this a python problem or an OS problem? 
>> > 
>> > Here is my code: 
>> > 
>> > # Your first view: opprettet polls/urls.py 
>> > 
>> > from django.conf.urls import url 
>> > 
>> > from . import views 
>> > 
>> > urlpatterns = [ 
>> > url(r'ˆ$', views.index, name='index'), 
>> > ] 
>> > 
>> > # Your first view polls/views.py 
>> > 
>> > from django.http import HttpResponse 
>> > 
>> > def index(request): 
>> > return HttpResponse("Hoppla, polls index her..") 
>> > 
>> > # Site/urls.py 
>> > 
>> > from django.conf.urls import include, url 
>> > from django.contrib import admin 
>> > 
>> > urlpatterns = [ 
>> > url(r'ˆpolls/', include('polls.urls')), 
>> > url(r'^admin/', admin.site.urls), 
>> > ] 
>> > # Site/settings.py 
>> > # Application definition 
>> > 
>> > INSTALLED_APPS = [ 
>> > 'django.contrib.admin', 
>> > 'django.contrib.auth', 
>> > 'django.contrib.contenttypes', 
>> > 'django.contrib.sessions', 
>> > 'django.contrib.messages', 
>> > 'django.contrib.staticfiles', 
>> > 'polls.apps.PollsConfig', 
>> > 
>> > 
>> > 
>> > -- 
>> > You received this message because you are subscribed to the Google 
>> Groups 
>> > "Django users" group. 
>> > To unsubscribe from this group and stop receiving emails from it, send 
>> an 
>> > email to django-users...@googlegroups.com. 
>> > To post to this group, send email to django...@googlegroups.com. 
>> > Visit this group at https://groups.google.com/group/django-users. 
>> > To view this discussion on the web visit 
>> > 
>> https://groups.google.com/d/msgid/django-users/76f99629-e329-4e7a-9221-eb15244f2685%40googlegroups.com.
>>  
>>
>> > For more options, visit https://groups.google.com/d/optout. 
>>
>>
>>
>> -- 
>>
>> Cordialement, Coues Ludovic 
>> +336 148 743 42 
>>
>

-- 
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/ccecd63c-6f9c-4158-a9dc-d84682154197%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Djangoproject tutorial part 1 - keep on getting 404 error on polls

2017-03-07 Thread Vanja Falck
Checked the ^ sign, but it was only missing a return - no syntax-error or 
change in the current 404 error, so I assume it is interpreted right.

The error message is only this (deliberately exchanged my actual site with 
xxx) - with the 404 header:

Using the URLconf defined in xxx.urls, Django tried these URL patterns, in 
this order:

   1. ^polls/
   2. ^admin/

The current URL, , didn't match any of these.



tirsdag 7. mars 2017 14.11.13 UTC+1 skrev ludovic coues følgende:
>
> Is there any information on the 404 page ? 
> I remember django being quite chatty as long it's in debug mode 
>
> 2017-03-07 10:56 GMT+01:00 Vanja Falck : 
>
> > Hi, 
> > I have startet the first part of the djangoproject tutorial and get 
> stuck in 
> > part 1 - getting 404 errors on /polls/ - the admin page is ok. 
> > Any one have an idea about what is wrong? 
> > 
> > Followed the instructions carefully (django 1.10 - version). Running in 
> > virtualenv with python 3.5.2 and django 1.10.6 on Ubuntu 16.04. 
> > Did follow an advice in this group and added the polls app in 
> settings.py, 
> > but it did not help. Nothing else is changed in the autosettings from a 
> > fresh install of django 10.1.6. 
> > 
> > Is this a python problem or an OS problem? 
> > 
> > Here is my code: 
> > 
> > # Your first view: opprettet polls/urls.py 
> > 
> > from django.conf.urls import url 
> > 
> > from . import views 
> > 
> > urlpatterns = [ 
> > url(r'ˆ$', views.index, name='index'), 
> > ] 
> > 
> > # Your first view polls/views.py 
> > 
> > from django.http import HttpResponse 
> > 
> > def index(request): 
> > return HttpResponse("Hoppla, polls index her..") 
> > 
> > # Site/urls.py 
> > 
> > from django.conf.urls import include, url 
> > from django.contrib import admin 
> > 
> > urlpatterns = [ 
> > url(r'ˆpolls/', include('polls.urls')), 
> > url(r'^admin/', admin.site.urls), 
> > ] 
> > # Site/settings.py 
> > # Application definition 
> > 
> > INSTALLED_APPS = [ 
> > 'django.contrib.admin', 
> > 'django.contrib.auth', 
> > 'django.contrib.contenttypes', 
> > 'django.contrib.sessions', 
> > 'django.contrib.messages', 
> > 'django.contrib.staticfiles', 
> > 'polls.apps.PollsConfig', 
> > 
> > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Django users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to django-users...@googlegroups.com . 
> > To post to this group, send email to django...@googlegroups.com 
> . 
> > Visit this group at https://groups.google.com/group/django-users. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/django-users/76f99629-e329-4e7a-9221-eb15244f2685%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>
>
>
> -- 
>
> Cordialement, Coues Ludovic 
> +336 148 743 42 
>

-- 
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/2db41c0f-284d-42e5-9f54-6b58452827b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django: how to send email when the publish date is reached for a blog item

2017-03-07 Thread Shawn Milochik
There are multiple ways to do it. For example:

Write a Django management command and call it from cron.

Use a scheduled Celery task.

-- 
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/CAOzwKwFCgHoF421%2B-qP%3DEjeiqxosv45YSYfw%3Dis00fH4BTxnYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django: how to send email when the publish date is reached for a blog item

2017-03-07 Thread Simha Rupa Das
I have created a blog using Django

My blog model contains:

Title
Description
Image
Publish_date
Date_created

Now whenever i reach the publish_date, i want to send email or send some 
notification to an android app.

How to do 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/daeb7d61-c9ab-458f-bc37-63a1c3ebed5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Request for advice on refactoring a big Django project

2017-03-07 Thread bobhaugen
> But don't be dismayed if no one responds. 

I'm not at all dismayed, and knew it was a shot in the dark, but might as 
well try for somebody who likes to discuss Django refactoring, or might be 
interested in the stuff we are building. And thanks again for the responses 
to my question about why no responses. 

On Monday, March 6, 2017 at 10:10:53 AM UTC-6, mark wrote:
>
> I echo Vijay's comment. Lists like this are really great for very specific 
> questions and short code segments or error message that a more experienced 
> person can answer off the top of their head. Your question is very broad 
> and requires a large time commitment from the reader to respond. With that 
> said, there is nothing wrong with posting your question as you may get 
> someone who has some free time to dive in and try to help. Or someone who 
> has done a lot of refactoring and can give you some pointers. But don't be 
> dismayed if no one responds. 
>
> You could also rephrase your question to be more like "I am in the process 
> of refactoring a large project. What recommendations would you make as far 
> as how to tackle this project? We built the project using Django x.x.x, so 
> where would you recommend we start with this project." More along the lines 
> of best practices for refactoring django projects, or what has the reader 
> learned after refactoring django projects. This question does not require 
> the reader to dive into your code, but to relate what they know about the 
> topic. Easier and much less time consuming for the reader.
>
> You could also offer to pay someone to help kick start your project, and 
> then if someone responds, take the discussion offline.
>
> As you refactor the project and run into issues, be sure to post those 
> very specific questions and short code segments/error message to the list. 
> The folks here are very friendly, extremely knowledgeable, and very willing 
> to help as long as you make it super easy for them to help you figure out 
> the answer to a specific question.
>
> God luck!
>
> Mark. 
>
> On Mon, Mar 6, 2017 at 5:13 AM, Vijay Khemlani  > wrote:
>
>> Also, this type mailing lists are usually for specific questions about
>> the framework
>>
>> "How do I make this particular query with the ORM"
>> "Why isn't this variable getting rendered in the template"
>>
>> etc
>>
>> Your question is kinda broad
>>
>> On 3/6/17, Bob Haugen  wrote:
>> > 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, 

Re: Need help in posting Multi select option from HTML to MongoDB using Mongoengine

2017-03-07 Thread Carlos Andre
Vinay to this do the simple.
The form interprets normally the models.
Example:
models.py
from mongoengine import *

class person(Document):
  name = StringField(max_length = 150)
  club = EmbeddedModelField(club)

class club(Document):
 name = StringFiend(max_length = 150)

form.py
class FormPerson(forms.ModelForm):
 class Meta:
model = person
fields = "__all__"


2017-03-07 0:58 GMT-03:00 vinay.marpina :

> Hi All,
>
> I am trying to implement a Multi select input box in my Html page. Once
> user select multiple check boxes all the data for that specific field need
> to store in MongoDB as a part of json. I am not able to understand how i
> can Multi Select input box created in Html can be connected to Back end
> model. I ma trying to use List field and Embedded document field but i am
> not able to connect all the dots. Can some one please help me in connecting
> all the dots from HTML to FORM to Model to View to MongoDB. Examples are
> very limited for Mongoengine and most of them are not taking input from
> HTML page. If some one let me know how to provide multiple input from HTML
> page to model list field it will be very help full.
>
> Note: If my explanation is vague please ping me i will try to explain
> little better.
>
> Thanks,
> Vinay
>
> --
> 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/c0a4cef0-d2ec-4bd0-b28d-517dc912e5cb%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/CAA8yBMxFGjgqUNXZdTg3R%3DdbbYnqQhU0cAFOMS1VLGM7SEm4Rw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrade from django 1.4 to django 1.11

2017-03-07 Thread ludovic coues
By upgrading directly from 1.4 to 1.11, deprecation warning might be
missed, resulting in a non-working project with few indication of what
is wrong.

2017-03-07 13:07 GMT+01:00 Antonis Christofides :
> There is no inherent reason for doing it a step at a time; you can go
> directly to 1.11 (which, btw, hasn't been released yet, it's in alpha I
> think, so it may or may not be ok for you).
>
> Doing it in steps might be better if you intend to read the release notes.
> So you read the release notes for 1.5, you go to 1.5, then you read the
> release notes for 1.6, you go to 1.6, etc. But I don't think it's worth it
> (and it's huge work to read the release notes for all these versions, and it
> will take ages to sink in anyway).
>
> However, you should at least read about the major changes in all the release
> notes.
>
> What I'd do would be to install Django 1.11 and test. You'll get an error
> message. Read the relevant part of the release notes. Fix it. Next error
> message. And so on. It's easier if you have good unit testing. If you don't,
> it's a great opportunity to start.
>
> Regards,
>
> Antonis
>
> Antonis Christofides
> http://djangodeployment.com
>
>
> On 03/07/2017 11:38 AM, BIJAL MANIAR wrote:
>
>
> Hi,
>
> Currently we have an application built using django 1.4.
> As the latest LTS release is 1.11, we are planning to upgrade it to 1.11.
>
> Which of the below 3 alternatives is a better option for django version
> upgrade.
> 1. Should we take it one release at a time? ie, Make the jump from 1.4 to
> 1.5 first, then proceed to 1.6, and so on.
> 2. Upgrade directly to 1.11
> 3. Upgrade only to LTS release ie, 1.4 to 1.8 to 1.11
>
> What other things we should consider before upgrading eg, having testcases
> in place.
> Any links/suggestions will be helpful.
>
> 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/8a24c1d5-6dc5-4963-84de-4e67ffbf15fb%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/fa9fa0f6-407e-cb96-2e22-795867a58b29%40djangodeployment.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Coues Ludovic
+336 148 743 42

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


Re: Djangoproject tutorial part 1 - keep on getting 404 error on polls

2017-03-07 Thread ludovic coues
I think I see your problem.
Look like you can type a character looking a lot like ^ but being different.
^ is ascii character 94, which represent the start of a line in a
regular expression.

2017-03-07 14:10 GMT+01:00 ludovic coues :
> Is there any information on the 404 page ?
> I remember django being quite chatty as long it's in debug mode
>
> 2017-03-07 10:56 GMT+01:00 Vanja Falck :
>> Hi,
>> I have startet the first part of the djangoproject tutorial and get stuck in
>> part 1 - getting 404 errors on /polls/ - the admin page is ok.
>> Any one have an idea about what is wrong?
>>
>> Followed the instructions carefully (django 1.10 - version). Running in
>> virtualenv with python 3.5.2 and django 1.10.6 on Ubuntu 16.04.
>> Did follow an advice in this group and added the polls app in settings.py,
>> but it did not help. Nothing else is changed in the autosettings from a
>> fresh install of django 10.1.6.
>>
>> Is this a python problem or an OS problem?
>>
>> Here is my code:
>>
>> # Your first view: opprettet polls/urls.py
>>
>> from django.conf.urls import url
>>
>> from . import views
>>
>> urlpatterns = [
>> url(r'ˆ$', views.index, name='index'),
>> ]
>>
>> # Your first view polls/views.py
>>
>> from django.http import HttpResponse
>>
>> def index(request):
>> return HttpResponse("Hoppla, polls index her..")
>>
>> # Site/urls.py
>>
>> from django.conf.urls import include, url
>> from django.contrib import admin
>>
>> urlpatterns = [
>> url(r'ˆpolls/', include('polls.urls')),
>> url(r'^admin/', admin.site.urls),
>> ]
>> # Site/settings.py
>> # Application definition
>>
>> INSTALLED_APPS = [
>> 'django.contrib.admin',
>> 'django.contrib.auth',
>> 'django.contrib.contenttypes',
>> 'django.contrib.sessions',
>> 'django.contrib.messages',
>> 'django.contrib.staticfiles',
>> 'polls.apps.PollsConfig',
>>
>>
>>
>> --
>> 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/76f99629-e329-4e7a-9221-eb15244f2685%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
>
> Cordialement, Coues Ludovic
> +336 148 743 42



-- 

Cordialement, Coues Ludovic
+336 148 743 42

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


Re: Djangoproject tutorial part 1 - keep on getting 404 error on polls

2017-03-07 Thread ludovic coues
Is there any information on the 404 page ?
I remember django being quite chatty as long it's in debug mode

2017-03-07 10:56 GMT+01:00 Vanja Falck :
> Hi,
> I have startet the first part of the djangoproject tutorial and get stuck in
> part 1 - getting 404 errors on /polls/ - the admin page is ok.
> Any one have an idea about what is wrong?
>
> Followed the instructions carefully (django 1.10 - version). Running in
> virtualenv with python 3.5.2 and django 1.10.6 on Ubuntu 16.04.
> Did follow an advice in this group and added the polls app in settings.py,
> but it did not help. Nothing else is changed in the autosettings from a
> fresh install of django 10.1.6.
>
> Is this a python problem or an OS problem?
>
> Here is my code:
>
> # Your first view: opprettet polls/urls.py
>
> from django.conf.urls import url
>
> from . import views
>
> urlpatterns = [
> url(r'ˆ$', views.index, name='index'),
> ]
>
> # Your first view polls/views.py
>
> from django.http import HttpResponse
>
> def index(request):
> return HttpResponse("Hoppla, polls index her..")
>
> # Site/urls.py
>
> from django.conf.urls import include, url
> from django.contrib import admin
>
> urlpatterns = [
> url(r'ˆpolls/', include('polls.urls')),
> url(r'^admin/', admin.site.urls),
> ]
> # Site/settings.py
> # Application definition
>
> INSTALLED_APPS = [
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> 'polls.apps.PollsConfig',
>
>
>
> --
> 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/76f99629-e329-4e7a-9221-eb15244f2685%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Coues Ludovic
+336 148 743 42

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


Re: Upgrade from django 1.4 to django 1.11

2017-03-07 Thread Tim Graham
Here's the "official advice": 
https://docs.djangoproject.com/en/dev/howto/upgrade-version/

On Tuesday, March 7, 2017 at 6:55:22 AM UTC-5, BIJAL MANIAR wrote:
>
>
> Hi,
>
> Currently we have an application built using django 1.4. 
> As the latest LTS release is 1.11, we are planning to upgrade it to 1.11.
>
> Which of the below 3 alternatives is a better option for django version 
> upgrade.
> 1. Should we take it one release at a time? ie, Make the jump from 1.4 to 
> 1.5 first, then proceed to 1.6, and so on.
> 2. Upgrade directly to 1.11 
> 3. Upgrade only to LTS release ie, 1.4 to 1.8 to 1.11
>
> What other things we should consider before upgrading eg, having testcases 
> in place.
> Any links/suggestions will be helpful. 
>
> 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/3dd7154e-4181-4a26-9424-bdba2a3a9beb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrade from django 1.4 to django 1.11

2017-03-07 Thread Antonis Christofides
There is no inherent reason for doing it a step at a time; you can go directly
to 1.11 (which, btw, hasn't been released yet, it's in alpha I think, so it may
or may not be ok for you).

Doing it in steps might be better if you intend to read the release notes. So
you read the release notes for 1.5, you go to 1.5, then you read the release
notes for 1.6, you go to 1.6, etc. But I don't think it's worth it (and it's
huge work to read the release notes for all these versions, and it will take
ages to sink in anyway).

However, you should at least read about the major changes in all the release 
notes.

What I'd do would be to install Django 1.11 and test. You'll get an error
message. Read the relevant part of the release notes. Fix it. Next error
message. And so on. It's easier if you have good unit testing. If you don't,
it's a great opportunity to start.

Regards,

Antonis

Antonis Christofides
http://djangodeployment.com


On 03/07/2017 11:38 AM, BIJAL MANIAR wrote:
>
> Hi,
>
> Currently we have an application built using django 1.4. 
> As the latest LTS release is 1.11, we are planning to upgrade it to 1.11.
>
> Which of the below 3 alternatives is a better option for django version 
> upgrade.
> 1. Should we take it one release at a time? ie, Make the jump from 1.4 to 1.5
> first, then proceed to 1.6, and so on.
> 2. Upgrade directly to 1.11 
> 3. Upgrade only to LTS release ie, 1.4 to 1.8 to 1.11
>
> What other things we should consider before upgrading eg, having testcases in
> place.
> Any links/suggestions will be helpful. 
>
> 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/8a24c1d5-6dc5-4963-84de-4e67ffbf15fb%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/fa9fa0f6-407e-cb96-2e22-795867a58b29%40djangodeployment.com.
For more options, visit https://groups.google.com/d/optout.


Channels + steam(gevent based package)

2017-03-07 Thread Lada B
I'm using 

https://github.com/ValvePython/steam
https://github.com/django/channels

and I'm trying to make them work together. Problem is that when SteamClient 
starts I cannot send any message with channels.

Group(group_name).send({
   'text': json.dumps({
 'match_status': "balancing teams",
}),
})

This won't ever send message until SteamClient is running unless I put it 
to new thread. But when i do that I end up with: 


> gevent.hub.LoopExit: ('This operation would block forever',  0x7fc465aabd58 epoll pending=0 ref=0 fileno=27>)



Example of my code:

@client.on('logged_on')
def start_dota():
Group(group_name).send({
'text': json.dumps({
'bot': getSteamProfile(str(client.steam_id)),
 }),
 })

dota.launch()
dota.wait_event('lobby_removed')

I'm trying to solve this for month already and I still cannot find out how. 
I just want to run gevent based SteamClient after i call it from main 
thread. I tried a lot, run it as new process, thread, for example:

p = Thread(target=start_bot, args=(kwargs['instance'].match_id, group1, 
group2,group_name, rad_reward, dire_reward, team1, team2, ))
p.start()

When I start it as new thread I also get end up with gevent.hub.LoopExit: 
('This operation would block forever', 

or

start_bot(kwargs['instance'].match_id, group1, group2,group_name, 
rad_reward, dire_reward, team1, team2)

this doesn't send channels messages at all.

Could anyone help me to solve this puzzle? I'm desperate.


-- 
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/f6c574c4-3449-4d95-be78-2db3451fcc3a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Need help in posting Multi select option from HTML to MongoDB using Mongoengine

2017-03-07 Thread vinay.marpina
Hi All,

I am trying to implement a Multi select input box in my Html page. Once 
user select multiple check boxes all the data for that specific field need 
to store in MongoDB as a part of json. I am not able to understand how i 
can Multi Select input box created in Html can be connected to Back end 
model. I ma trying to use List field and Embedded document field but i am 
not able to connect all the dots. Can some one please help me in connecting 
all the dots from HTML to FORM to Model to View to MongoDB. Examples are 
very limited for Mongoengine and most of them are not taking input from 
HTML page. If some one let me know how to provide multiple input from HTML 
page to model list field it will be very help full.

Note: If my explanation is vague please ping me i will try to explain 
little better.

Thanks,
Vinay

-- 
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/c0a4cef0-d2ec-4bd0-b28d-517dc912e5cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error running Django tutorial

2017-03-07 Thread Vanja Falck
Hi,
I am also facing the same problems with the djangoproject tutorial - I have 
changed the settings.py file to add the polls app, but it did not solve the 
issue:
When runserver: I get the admin page, but not the polls page. Get a similar 
404 error page as Kipling, but with the ˆpolls/ url in the list.

Running in virtualenv - with python 3.5.2 and django 10.1.6 on Ubuntu 
16.04. Any idea of what is wrong?

Here is my code:

# Your first view: opprettet polls/urls.py

from django.conf.urls import url

from . import views

urlpatterns = [
url(r'ˆ$', views.index, name='index'),
]

# Your first view polls/views.py

from django.http import HttpResponse

def index(request):
return HttpResponse("Hoppla, polls index her..")

# Site/urls.py

from django.conf.urls import include, url
from django.contrib import admin

urlpatterns = [
url(r'ˆpolls/', include('polls.urls')),
url(r'^admin/', admin.site.urls),
]
# Site/settings.py
# Application definition

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




torsdag 17. mars 2016 21.56.04 UTC+1 skrev Bruno Barbosa følgende:
>
> Ruth,
>
> Show me the code!
>
> How is your urls.py? and the views.py?
>
> paste your code in https://gist.github.com/ and reply this email.
>
> --
> Bruno Barbosa
> Web Developer
> *brunobarbosa.com.br *
>
> On Thu, Mar 17, 2016 at 3:50 PM, Ruth  > wrote:
>
>> Hi,
>> I am getting the same problem, despite having include in my 
>> mysite\urls.py file.
>> I am using Python 2.7.6, Django 1.9.4 and Ubuntu 14.04.3 LTS.
>> Could it by a Python 2.7 problem?
>> Thanks,
>> Ruth
>>
>> On Wednesday, March 2, 2016 at 12:19:16 PM UTC-8, jorr...@gmail.com 
>> wrote:
>>>
>>> Glad you got it solved!!
>>>
>>>
>>> On Monday, February 29, 2016 at 10:10:58 PM UTC+1, Mike Kipling wrote:

 I found the problem.

 When the mysite\urls.py file is created, it has this line already in it.

 from django.conf.urls import url

 The tutorial asks you to add the following lines to the file.

 from django.conf.urls import include, url
 from django.contrib import admin

 urlpatterns = [
 url(r'^polls/', include('polls.urls')),
 url(r'^admin/', admin.site.urls),
 ]

 I must did not notice that the 'include' was different, and so I had 
 not placed it into the file.  I changed the file to add the 'include' and 
 everything worked.

 Thank you for the 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/c14e04f8-be34-4569-ae42-48e8d4135a2c%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/d6671326-c2ca-4f9e-98c8-4fe3c9eee9ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Upgrade from django 1.4 to django 1.11

2017-03-07 Thread BIJAL MANIAR

Hi,

Currently we have an application built using django 1.4. 
As the latest LTS release is 1.11, we are planning to upgrade it to 1.11.

Which of the below 3 alternatives is a better option for django version 
upgrade.
1. Should we take it one release at a time? ie, Make the jump from 1.4 to 
1.5 first, then proceed to 1.6, and so on.
2. Upgrade directly to 1.11 
3. Upgrade only to LTS release ie, 1.4 to 1.8 to 1.11

What other things we should consider before upgrading eg, having testcases 
in place.
Any links/suggestions will be helpful. 

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/8a24c1d5-6dc5-4963-84de-4e67ffbf15fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Djangoproject tutorial part 1 - keep on getting 404 error on polls

2017-03-07 Thread Vanja Falck
Hi,
I have startet the first part of the djangoproject tutorial and get stuck 
in part 1 - getting 404 errors on /polls/ - the admin page is ok.
Any one have an idea about what is wrong?

Followed the instructions carefully (django 1.10 - version). Running in 
virtualenv with python 3.5.2 and django 1.10.6 on Ubuntu 16.04.
Did follow an advice in this group and added the polls app in settings.py, 
but it did not help. Nothing else is changed in the autosettings from a 
fresh install of django 10.1.6.

Is this a python problem or an OS problem?

Here is my code:

# Your first view: opprettet polls/urls.py

from django.conf.urls import url

from . import views

urlpatterns = [
url(r'ˆ$', views.index, name='index'),
]

# Your first view polls/views.py

from django.http import HttpResponse

def index(request):
return HttpResponse("Hoppla, polls index her..")

# Site/urls.py

from django.conf.urls import include, url
from django.contrib import admin

urlpatterns = [
url(r'ˆpolls/', include('polls.urls')),
url(r'^admin/', admin.site.urls),
]
# Site/settings.py
# Application definition

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


-- 
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/76f99629-e329-4e7a-9221-eb15244f2685%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Djangoprojects tutorials part 1 - getting 404 errors on /polls/

2017-03-07 Thread Vanja Falck
Hi,

Djangoproject tutorials part 1 - followed carefully (1.10 version) + added 
the polls app to settings.py (not in the tutorial) - still get 404 error on 
/polls/ (the /admin/ is working).

Running with virtualenv python 3.5.2 and django 10.1.6 on Ubuntu 16.04. Any 
one who knows what is wrong?

https://gist.github.com/anonymous/7beb3f71dcc8e33fc96876aa5830650a.js";>


-- 
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/58d9bf7d-7acb-455b-a36a-4765e1f0536d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Postgres (sqlmigrate) FK to M2M without RunPython

2017-03-07 Thread Daniel Roseman
Schema migrations don't run on the database server, they run on the app server 
with the rest of your Django code and communicate with the database in exactly 
the same way. If you can run Django, you can run migrations.
-- 
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/f001110f-ef9f-43b6-9719-fe0765480480%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Postgres (sqlmigrate) FK to M2M without RunPython

2017-03-07 Thread Melvyn Sopacua
On Monday 06 March 2017 15:40:55 Maksym Mospanenko wrote:
> Hello! I want to migrate data with schema migrations but I can't 
run
> any python code on database server - only raw sql (postgres).
> How can I move fk column data to m2m table's fk column?

On the server you can run python code:
python manage.py sqlmigrate app_label migration_name |psql 
dbname

Or save the output, put it on db server and load it there.
I don't see why though. Just run migrate on the server that runs 
django.
-- 
Melvyn Sopacua

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


Re: Django Channels - Delay server for Group messages

2017-03-07 Thread Andrew Godwin
Not at the moment, the delay server is not built with that in mind. It
could be extended to do so if you wanted to look into it.

Andrew

On Mon, Mar 6, 2017 at 2:09 PM, Adrián Cuesta 
wrote:

> Hi
>
> Is there any way to send delayed messages to Group instead of a Channel?
>
> The delay server example here
> 
> gives this example:
>
> from channels import Channel
>
> delayed_message = {
> 'channel': 'example_channel',
> 'content': {'x': 1},
> 'delay': 10 * 1000
> }
> # The message will be delayed 10 seconds by the server and then sent
> Channel('asgi.delay').send(delayed_message, immediately=True)
>
>
> I would like to use the same but with Group, this way:
>
>
> from channels import Group
>
> delayed_message = {
> 'channel': 'example_channel',
> 'content': {'x': 1},
> 'delay': 10 * 1000
> }
> # The message will be delayed 10 seconds by the server and then sent
> Group('asgi.delay').send(delayed_message, immediately=True)
>
>
> Can someone give some feedback about this?
>
> Thanks,
>
> Adrián
>
> --
> 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/ce74c6c7-18b4-4b7e-83fe-e2cc4f6bbd1e%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/CAFwN1uqoCT%2B%3DT3L%2BL3RHvdkxM7sNQX91kXwGeGSbMdjmEzuKkA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.