Re: Django Produces Python?

2017-03-25 Thread James Bennett
Python is a programming language. You can use it to write many types of
programs. For example, you can use it to write web applications (which run
on a web server, respond to HTTP requests, store their data in a database,
render HTML templates for output, etc.). But doing this from scratch would
require you to write many modules of Python code yourself, in order to
handle all the common and necessary parts of a typical web application.

Django provides those things for you, already written, so that you do not
need to write them yourself. Instead, you can write only the things which
are truly unique to your specific application, and let already-written
modules from Django handle the rest.

-- 
You received this message because you are subscribed to the Google 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/CAL13Cg9n4Mk6W2QEG51yoY5cXn1tQ_N9ORhvv3k7GGCdW2Ob3A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Produces Python?

2017-03-25 Thread François Schiettecatte
The purpose of a framework is so that you don’t have to write it yourself.

François

> On Mar 25, 2017, at 9:46 PM, Ed Sutherland  wrote:
> 
> Wow. I had thought Django as an assistant to build python projects. If I need 
> the framework along with whatever language, it seems like immense code-bloat. 
> What, then, is the purpose of using frameworks?
> 
> 
> 
>  On Sat, 25 Mar 2017 23:30:45 -0400 Lachlan Musicman  
> wrote 
> 
> It will needs the Django as well. Think of them as layers - at the bottom is 
> the OS, then there is python. Django sits on Python. Your project sits on 
> Django. Can't remove a layer.
> cheers
> L.
> 
> --
> The most dangerous phrase in the language is, "We've always done it this way."
> 
> - Grace Hopper
> 
> On 26 March 2017 at 14:19, Ed Sutherland  wrote:
> 
> 
> 
> 
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAGBeqiMJo1ER7TFH2%3DGTLtvO%3Ds8ETKEGpYsUFCpVFOD_k_h4dA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
> 
> Forgive me if this question is too basic, but I'm a relative newbie to 
> programming frameworks. As I understand it, a framework is built to abstract 
> common tasks within the native language (Python, PHP, Ruby, etc.) When 
> development using a framework is complete, will the production version of the 
> app still require the framework? For instance, would an app developed with 
> Django need only Python, or the entire programming framework? (I haven't seen 
> a suitable answer after searching.)
> 
> 
> 
> 
> 
> --
> You received this message because you are subscribed to the Google 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/15b089fd407.b63a65c5111765.2626315058617697641%40tburgnews.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/15b08efd9bb.fb7e1aec112788.7061965930651567288%40tburgnews.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/43440416-1154-45FE-BBA5-DD8228EE557B%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Produces Python?

2017-03-25 Thread Ed Sutherland
Wow. I had thought Django as an assistant to build python projects. If I need 
the framework along with whatever language, it seems like immense code-bloat. 
What, then, is the purpose of using frameworks?







 On Sat, 25 Mar 2017 23:30:45 -0400 Lachlan Musicman 
 wrote 




It will needs the Django as well. Think of them as layers - at the bottom is 
the OS, then there is python. Django sits on Python. Your project sits on 
Django. Can't remove a layer.


cheers


L.




--

The most dangerous phrase in the language is, "We've always done it this way."



- Grace Hopper







On 26 March 2017 at 14:19, Ed Sutherland  wrote:









--

 You received this message because you are subscribed to the Google Groups 
"Django users" group.

 To unsubscribe from this group and stop receiving emails from it, send an 
email to django-users+unsubscr...@googlegroups.com.

 To post to this group, send email to django-users@googlegroups.com.

 Visit this group at https://groups.google.com/group/django-users.

 To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGBeqiMJo1ER7TFH2%3DGTLtvO%3Ds8ETKEGpYsUFCpVFOD_k_h4dA%40mail.gmail.com.

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




Forgive me if this question is too basic, but I'm a relative newbie to 
programming frameworks. As I understand it, a framework is built to abstract 
common tasks within the native language (Python, PHP, Ruby, etc.) When 
development using a framework is complete, will the production version of the 
app still require the framework? For instance, would an app developed with 
Django need only Python, or the entire programming framework? (I haven't seen a 
suitable answer after searching.)











--

 You received this message because you are subscribed to the Google 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/15b089fd407.b63a65c5111765.2626315058617697641%40tburgnews.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/15b08efd9bb.fb7e1aec112788.7061965930651567288%40tburgnews.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Produces Python?

2017-03-25 Thread Lachlan Musicman
It will needs the Django as well. Think of them as layers - at the bottom
is the OS, then there is python. Django sits on Python. Your project sits
on Django. Can't remove a layer.

cheers
L.

--
The most dangerous phrase in the language is, "We've always done it this
way."

- Grace Hopper

On 26 March 2017 at 14:19, Ed Sutherland  wrote:

> Forgive me if this question is too basic, but I'm a relative newbie to
> programming frameworks. As I understand it, a framework is built to
> abstract common tasks within the native language (Python, PHP, Ruby, etc.)
> When development using a framework is complete, will the production version
> of the app still require the framework? For instance, would an app
> developed with Django need only Python, or the entire programming
> framework? (I haven't seen a suitable answer after searching.)
>
>
>
> --
> You received this message because you are subscribed to the Google 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/15b089fd407.b63a65c5111765.2626315058617697641%
> 40tburgnews.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/CAGBeqiMJo1ER7TFH2%3DGTLtvO%3Ds8ETKEGpYsUFCpVFOD_k_h4dA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django Produces Python?

2017-03-25 Thread Ed Sutherland
Forgive me if this question is too basic, but I'm a relative newbie to 
programming frameworks. As I understand it, a framework is built to abstract 
common tasks within the native language (Python, PHP, Ruby, etc.) When 
development using a framework is complete, will the production version of the 
app still require the framework? For instance, would an app developed with 
Django need only Python, or the entire programming framework? (I haven't seen a 
suitable answer after searching.)








-- 
You received this message because you are subscribed to the Google 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/15b089fd407.b63a65c5111765.2626315058617697641%40tburgnews.com.
For more options, visit https://groups.google.com/d/optout.


Re: Channels - get online users

2017-03-25 Thread Andrew Godwin
Well, your problem is that you have to first define "online" and "users".

If you want "the number of open WebSockets connected to the system", then
you can do it using logic tied to the connect and disconnect methods, with
extra logic for expiry in case you miss a disconnect (otherwise the number
will continuously creep up over time). There is no simple, scalable way,
however.

If you're going to have strictly less than 100 websockets connected, and
you're using the Redis backend, then group_channels() would give you an
approximation of that number simply, but the performance drops off
dramatically as you scale up a system. It will also include connections
that are up to a day old (or however long your group_expiry is)

Andrew

On Sat, Mar 25, 2017 at 9:53 AM, Volodymyr Spodaryk <
volodymyr.spoda...@gmail.com> wrote:

> Hi,
> is there any simple way to count online users that connected to Django
> Channels ?
>
> --
> You received this message because you are subscribed to the Google 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/d0acdec7-26e8-4889-bd41-5afe049b035a%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/CAFwN1uq1JQJpd%3DBaN1R9m1T9CtgVVf7j8tFBsLJWaTtov3r32g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: problrm with django contact form

2017-03-25 Thread Bassam Ramadan
im getting "POST /email/ HTTP/1.1" 302 0

On Saturday, March 25, 2017 at 7:28:59 PM UTC+2, Melvyn Sopacua wrote:
>
> Hello,
>
>  
>
> On Saturday 25 March 2017 09:13:19 Bassam Ramadan wrote:
>
>  
>
> > but i do not receive any mail on my email account
>
>  
>
> You didn't setup your EMAIL_ settings 
> .
>
> -- 
>
> 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/8a7dbb04-1feb-470f-aa61-9130c55b3824%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Let's Encrypt installation fails with WSGI on Ubuntu 14 LTS

2017-03-25 Thread Michal Petrucha
On Fri, Mar 24, 2017 at 03:22:40PM -0700, Moreplavec wrote:
> I'm trying to install SSL certificate with Let's encrypt on my VPS running 
> Apache + WSGI. 
> 
> I'm following guide: 
> https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-14-04
> 
> It works fine for all PHP sites, but i get an error when trying to install 
> SSL for Django app. I think the problem is, that SSL cert conf is made as 
> duplicate or currect conf file, so apache configtest fails and whole 
> instalation is reverted:
> 
> command: *certbot-auto --apache -d django.my-domain.cz*

Personally I'd recommend that you move away from the automagic
features of certbot that mess around with your config files, and just
configure your webserver manually to serve ACME challenges, and
otherwise fall back to whatever it is supposed to do (like proxy to
your application server), and use certbot in its webroot mode which
just puts the correct file in a location of your choice without any
config changes of anything.

With nginx, the correct arcane incantation would be to use something
like

root /var/www/acme;
try_files $uri @wsgi_upstream;

I'm pretty sure you can create an equivalent configuration with apache
somehow, maybe using mod_rewrite or something.

The advantage of using a static configuration like this, rather than
letting certbot change the httpd config on each run, is that there are
fewer moving parts, there's no risk that the config automagic won't
work with the config directives used in your particular config,
there's no need to reload the webserver on each run, and in general, I
personally distrust any magic that messes with my configuration.

Good luck,

Michal

-- 
You received this message because you are subscribed to the Google 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/20170325213403.GH23772%40konk.org.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: Digital signature


TransactionManagementError from inside atomic block

2017-03-25 Thread Ketan Bhatt
I have a method that updates a row in the table.
To avoid race condition, I locked the row using `select_for_update` inside
an `atomic` block and doing the update.
This method is called from a celery task.

This works well on my local machine. But when this gets called on my
production server (two tasks being picked up by two workers at the same
time and therefore trying to access the same row at once), I get:
`TransactionManagementError('select_for_update cannot be used outside of a
transaction.',)`

I checked that to use `select_for_update`, autocommit should be False.
Inside the atomic block `get_autocommit` returns False.

Now on production this must be returning `TRUE`.


What could be the reason?

-- 
You received this message because you are subscribed to the Google 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/CACyRkBU8cpRgm8omT5PnkdW0-uxPF9U87TqMzm16kWmdfqkNrw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Channels - get online users

2017-03-25 Thread Volodymyr Spodaryk
Hi,
is there any simple way to count online users that connected to Django 
Channels ?

-- 
You received this message because you are subscribed to the Google 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/d0acdec7-26e8-4889-bd41-5afe049b035a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: problrm with django contact form

2017-03-25 Thread Melvyn Sopacua
Hello,

On Saturday 25 March 2017 09:13:19 Bassam Ramadan wrote:

> but i do not receive any mail on my email account

You didn't setup your EMAIL_ settings[1].
-- 
Melvyn Sopacua


[1] https://docs.djangoproject.com/en/1.10/ref/settings/#email-host

-- 
You received this message because you are subscribed to the Google 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/2648342.YpZlqMgDOI%40devstation.
For more options, visit https://groups.google.com/d/optout.


problrm with django contact form

2017-03-25 Thread Bassam Ramadan
hello everybody,

i created a django project on my local machine ( laptop ) and i setup 
django form for getting email from my website visitors but when i try it it 
working fine and do not give me any errors but i do not receive any mail on 
my email account

-- 
You received this message because you are subscribed to the Google 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/9fe1e8e7-49cc-4a93-ae05-9a70e5e8e318%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


unable to create a new project in django got error. Fatal error in launcher: Unable to create process using '"'

2017-03-25 Thread girish Sharma
hey, 
i am using 
django 1.10.6
python 27
whindows 10

when i try to create a new project is shows error

>> django-admin startproject someproject
>> Fatal error in launcher: Unable to create process using '"'

-- 
You received this message because you are subscribed to the Google 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/769d1fe6-6fb5-4c8b-bc84-8f5e8b1e5811%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: GeoDjango

2017-03-25 Thread Derek
GeoServer allows you to serve multiple formats for a WFS (not just GeoJSON) 
- see 
http://docs.geoserver.org/latest/en/user/services/wfs/outputformats.html

You also can't generalise about a WFS vs a WMS in terms of time - there are 
many instances where its much more efficient to serve vector data.

GeoServer is a really useful and powerful tool/system for serving WMS or 
WFS (or other outputs)  - but, as always, it depends on your specific use 
case as to what technology you should choose.

On Saturday, 25 March 2017 13:51:30 UTC+2, Suresh Nimbalkar wrote:
>
> In this example, the author is simply using GeoServer to serve WFS layer 
> (i.e. GeoJSON layer) to Leaflet. You can serve GeoJSON layers without the 
> need of GeoServer. Any map based on GeoJSON data takes considerable time to 
> load as against map based on WMS (i.e. image). Hence, this example is of 
> not much use.
>
> On Monday, 20 March 2017 13:07:10 UTC+5:30, Derek wrote:
>>
>> One option is to use Geoserver on the backend to manage your spatial data 
>> (in files or databases), and then to serve this via Django.
>>
>> See:
>> https://www.youtube.com/watch?v=rU_Jh6RcY24
>>
>>
>> On Saturday, 18 March 2017 15:21:55 UTC+2, sbrunel62 wrote:
>>>
>>> Hello, 
>>>
>>> I’m new on GeoDjango, I need to known If I can use GeoDjango as  WMS ? 
>>>
>>> Best regards, 
>>>
>>> Samuel 
>>>
>>>

-- 
You received this message because you are subscribed to the Google 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/e8ff43e0-b39f-4189-bd60-6071e1f1fad0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Let's Encrypt installation fails with WSGI on Ubuntu 14 LTS

2017-03-25 Thread Melvyn Sopacua
On Friday 24 March 2017 15:22:40 Moreplavec wrote:
> I'm trying to install SSL certificate with Let's encrypt on my VPS
> running Apache + WSGI.
> 
> I'm following guide:
> https://www.digitalocean.com/community/tutorials/how-to-secure-apache
> -with-let-s-encrypt-on-ubuntu-14-04
> 
> It works fine for all PHP sites, but i get an error when trying to
> install SSL for Django app. I think the problem is, that SSL cert
> conf is made as duplicate or currect conf file

Yes, it is. So from the mod_wsgi docs, or mod_wsgi list, you should inquire how 
to 
"use a previously defined WSGIDaemonProcess in a virtual host". Then keep the 
definition out of the the vhost file and have it included somewhere sooner.

(Or use a different letsencrypt client that doesn't fiddle with webserver 
configs, and 
reference files using a good naming convention).
-- 
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/2639014.iy2V7Hfv8D%40devstation.
For more options, visit https://groups.google.com/d/optout.


Re: GeoDjango

2017-03-25 Thread Suresh Nimbalkar
In this example, the author is simply using GeoServer to serve WFS layer 
(i.e. GeoJSON layer) to Leaflet. You can serve GeoJSON layers without the 
need of GeoServer. Any map based on GeoJSON data takes considerable time to 
load as against map based on WMS (i.e. image). Hence, this example is of 
not much use.

On Monday, 20 March 2017 13:07:10 UTC+5:30, Derek wrote:
>
> One option is to use Geoserver on the backend to manage your spatial data 
> (in files or databases), and then to serve this via Django.
>
> See:
> https://www.youtube.com/watch?v=rU_Jh6RcY24
>
>
> On Saturday, 18 March 2017 15:21:55 UTC+2, sbrunel62 wrote:
>>
>> Hello, 
>>
>> I’m new on GeoDjango, I need to known If I can use GeoDjango as  WMS ? 
>>
>> Best regards, 
>>
>> Samuel 
>>
>>

-- 
You received this message because you are subscribed to the Google 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/9ed8821a-1a35-42bd-bd89-e1a133d95349%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.