Re: Need help with deployment

2017-05-09 Thread Antonis Christofides
Django + Apache does make a good combination, but actually you are talking about
Django + Apache + mod_wsgi + Windows (which is pretty much the only combination
for Windows, excluding IIS about which I know absolutely zero). But you should
also consider another operating system; see
https://djangodeployment.com/2016/12/27/which-operating-system-should-i-choose-for-deployment/
for more.

Antonis Christofides
http://djangodeployment.com


On 2017-05-08 13:01, sarfaraz ahmed wrote:
> This is first time I am trying to deploy my django project. Doing online
> research I found Django+Apache makes good combination.
>
> Regards,
> Sarfaraz Ahmed
>
> On 6 May 2017 at 01:41, Luiz Guilherme Silva  > wrote:
>
> Hello Ahmed.
>
> Why are you using apache instead of IIS? I know it's not the question, but
> I've worked in a project running on IIS for a long time without big
> problems, and you don't need Apache for this.
>
> 2017-05-04 16:00 GMT-03:00 sarfaraz ahmed  >:
>
> Hello Friends,
>
> I have an Windows 2016 Server edition on EC2.
> I install Apache 2.4 VC10 on my server and installed 2.7.13
>
> I am not able to find MOD_WSGI.SO for this combination.
>
> Can someone provide me steps to compile or link to download
>
> -- 
> Thanks with regards,
> Sarfaraz Ahmed
>
>
> -- 
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> 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/CAEPJdixOMiS%3DBsPusybJaoKhJfaa1Pfqy6D3ND%3DEOQ8EkbsnDA%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/CAPgKrJ2V6OWuJ6ZTQVASYa1aUtMpgm-TeQ0EJxODqZ3i78tt%3DA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout
> .
>
>
>
>
> -- 
> Thanks with regards,
> Sarfaraz Ahmed
>
>
> -- 
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/CAEPJdix%2B12M-uKG0keYukG7GSppAywJYvkKQzyb%3DoxfxQoxvJQ%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/b359d02c-5592-c747-2bb5-75aa42fa2d5d%40djangodeployment.com.
For more options, visit https://groups.google.com/d/optout.


Re: Admin css question for 1.10.7

2017-05-09 Thread Mike Dewhirst

On 9/05/2017 11:45 AM, Mike Dewhirst wrote:

On 8/05/2017 11:02 PM, Melvyn Sopacua wrote:


On Monday 08 May 2017 03:57:01 Tim Graham wrote:

> You need to clone the Django repository and run the bisect command

> from there:




snip


running /home/melvyn/hg/django-project/invert.sh

Bisecting: 0 revisions left to test after this (roughly 0 steps)



Now I get it!


[e23e7b2ffe8e282adfd5c597df25c181413c5b3b] Fixed #11544 -- Removed
!important rules in contrib.admin styles.

running /home/melvyn/hg/django-project/invert.sh

e23e7b2ffe8e282adfd5c597df25c181413c5b3b is the first bad commit

commit e23e7b2ffe8e282adfd5c597df25c181413c5b3b

Author: elky 

Date: Mon Sep 7 00:28:14 2015 +0500

Fixed #11544 -- Removed !important rules in contrib.admin styles.



Should I now contact elky and start a conversation?


I went back to the docs and saw I should add a comment to ticket #11544. 
The ticket has been closed and I couldn't see how to add a new comment. 
I suspect closing the ticket cuts off new comments. I'll cc elky and see 
what happens.


As a workaround, I've added my own bit of css in {% block extrastyles %} 
to adjust margin-left like so ...


form .wide p, form .wide input + p.help {
margin-left: 160px !important;
}

... which seems to work. I'd be happy to see forms.css changed but I 
don't know about unintended consequences.


For elky, the symptom is indented help-text in the Admin for 
DecimalFields versus help-text for other fields. It seems to be 
controlled from forms.css like so ...


form .wide p, form .wide input + p.help {
margin-left: 200px;
}

... and making it 160px seems to repair it. Happy to help in any way 
which doesn't involve learning git ;)


Thanks everyone for all your help.

Cheers

Mike



Thanks Tim and Melvyn

Mike


:04 04 8ba07a707a8493e0eed28fd23cb0e0d1b29e4e69
756ac7c45cced7bb403573eb4d31a70c250fddf8 M django

bisect run success

Happy hunting.

--

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/3834087.V7UGXNyRTa%40devstation
.

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/0afd2f59-c21f-e1fb-11dc-12333096c936%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: sqlite3 database encrytion for Django.

2017-05-09 Thread Melvyn Sopacua
On Tuesday 09 May 2017 09:24:08 Antonis Christofides wrote:
> > and root seems (unsurprisingly) able to do anything desired with the
> > database.
> 
> He meant that root wouldn't be able to read the database if the
> database was encrypted. But, again, the question is whether root
> would have access to the encryption keys. If the django user has
> access to the encryption keys, root also does.

Defending against a targetted attack is extremely hard. It's also a minute 
percentage of the 
attacks out there. A site may never see one as it's simply not worth the effort.

By putting the encryption keys on a networked resource, you defend against 
exploits that make 
everything they can see world-readable (which will go unnoticed far more then 
it should and 
can have great pay outs). Or for example a compromised ftp daemon that can now 
hand you 
the file it normally wouldn't.
The vast majority of security attacks are wide scans for known failures, which 
try to create as 
much yield as possible with the least ammount of detection. This is because it 
takes time to 
follow-up on the success of the hack.
For example, I've dealt with an exploit that infected all files with a redirect 
- but - only when 
viewed on a mobile device. Not because it wanted to infect mobile devices, but 
simply because 
it would go unnoticed much longer, especially by the people that work with it 
daily.

> What I'm getting at is that the benefits of encrypting the database
> are questionable.

That can be said about any encryption, as everything can be decrypted given 
enough time and 
resources - a fact that not enough people say out loud. The assumption is that 
at the time it is 
decrypted the information is no longer relevant.

> Maybe there is some edge case in which it would be
> useful.

It's useful for the majority of cases. Every hurdle - every deviation from the 
defaults or 
commonly used conventions helps against those wide-targgetted scanners. Just 
look at your 
webserver logs how many of those fail just because you didn't make phpMyAdmin 
available in 
one of the common aliases. And think how many succeed because they run vanilla 
Ubuntu and 
never actually made an effort to think about this stuff.

Now, there's even a totally different use case. Say, I want make answers to 
exams available, 
but only after the exam. Using time-lapse cryptography[1], I can make the 
answers only 
available after a certain time :).

Anyway - there's enough food for thought in here, so I'm out, unless the OP 
explains his use 
case and needs more help.
-- 
Melvyn Sopacua


[1] https://crypto.stackexchange.com/a/3072

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/4099429.zBxrgMXHrk%40devstation.
For more options, visit https://groups.google.com/d/optout.


Re: Admin css question for 1.10.7

2017-05-09 Thread Melvyn Sopacua
On Tuesday 09 May 2017 17:48:43 Mike Dewhirst wrote:
> On 9/05/2017 11:45 AM, Mike Dewhirst wrote:
> > On 8/05/2017 11:02 PM, Melvyn Sopacua wrote:
> >> On Monday 08 May 2017 03:57:01 Tim Graham wrote:
> >> > You need to clone the Django repository and run the bisect
> >> > command
> 
> >> > from there:
> snip
> 
> >> running /home/melvyn/hg/django-project/invert.sh
> >> 
> >> Bisecting: 0 revisions left to test after this (roughly 0 steps)
> > 
> > Now I get it!
> > 
> >> [e23e7b2ffe8e282adfd5c597df25c181413c5b3b] Fixed #11544 -- Removed
> >> !important rules in contrib.admin styles.
> >> 
> >> running /home/melvyn/hg/django-project/invert.sh
> >> 
> >> e23e7b2ffe8e282adfd5c597df25c181413c5b3b is the first bad commit
> >> 
> >> commit e23e7b2ffe8e282adfd5c597df25c181413c5b3b
> >> 
> >> Author: elky 
> >> 
> >> Date: Mon Sep 7 00:28:14 2015 +0500
> >> 
> >> Fixed #11544 -- Removed !important rules in contrib.admin styles.
> > 
> > Should I now contact elky and start a conversation?
> 
> I went back to the docs and saw I should add a comment to ticket
> #11544. The ticket has been closed and I couldn't see how to add a
> new comment.

The ticket is also too old to be necro'd. You can open a new one and reference 
it. What I'm really 
surprised about is that this unwanted side-effect went unnoticed for so long. 
Makes you 
question how many people use the wide form view. 

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


Re: Unicode error in __unicode__(self) function

2017-05-09 Thread Melvyn Sopacua
On Monday 08 May 2017 09:10:15 rmschne wrote:
> I have a Django setup that has worked for a very long time. Yesterday
> I upgraded from Django 1.10 to 1.11.1 and am getting the error:
> 
> raise DjangoUnicodeDecodeError(s, *e.args)
> django.utils.encoding.DjangoUnicodeDecodeErrorJón
> 
> : 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in
> 
> range(128).

I'm sorry - but this isn't your real error.
You will see it in your WSGI daemon logs once you set DEBUG to false. 

This error is caused by Django trying to print the error using ascii codec for 
the 
debug output (I haven't chased it down any further and I should really report 
it).

As said, your real error is somewhere else and that will probably make more 
sense.

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


Re: Problem with CircularDependency Model

2017-05-09 Thread Melvyn Sopacua
On Friday 05 May 2017 05:41:52 Tobias Dacoir wrote:
> I am trying to build a model (in two separate apps) which has the
> following constraints:
> 
> - There can be many institutes
> - there can many users
> - each user is a member of exactly one institute
> - each institute has exactly one master user
> 
> However I am running into CircularDependency errors when trying to
> create this model and database. Of course this model is a bit
> problematic because you can't have an institute without master user,
> but also you can't create a user without some default institute. How
> do I fix this? Should I be more lean on the model side and allow for
> a lot of blanks and null values and make all the exception handling
> somewhere else?
> 
> Please tell me how to improve my model.
> 
> >> class User(AbstractBaseUser, PermissionsMixin):
> > # account-related information
> > institute = models.ForeignKey(Institute, blank=True, null=True,

institute = models.ForeignKey('mycoolapp.Institute', )

This uses a promise and resolves the model at init stage (rather then class 
declaration). Make 
sure you remove the import of Institute or it won't help.

If you're interested in the topic of resolving models at runtime, take a loot 
at django.apps.Apps, 
specifically get_model. But all the work for foreign keys is already done for 
you.

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


Re: field cannot be specified for model form as it is a non-editable field

2017-05-09 Thread marcin . j . nowak
Thank you for all replies.


@James

Your proposal about design change is generally OK, but while doing the 
upgrade I definitely DO NOT want to change the implementation. It is just 
too risky. 


@Tim

Sorry for hostile sounding, but I'm just tired of such drastic changes. For 
a x-years long project it is a quite big issue. 
The most important thing is not to destroy the data and to have a security 
patches applied. The rest should remain untouched. 
The big problem with Django lies somewhere in between - to get recent 
patches you must accept whole set of changes, incl. breaking compat ones. 

I'm considering upgrade just because 1.8 is not supported AND it has some 
serious drawbacks (here -- automatic removal of contenttypes).
Where I am doing one step forward, the upgrade takes me "two" steps back.

I was quite happy when more freedom was left to the developer. It was from 
v0.96 up to v1.4. 
The things started getting "worse" when builtin migrations and system 
checks framework were introduced. 
And the "worse" word is very subjective here.  

Anyway, thank you for a quick response and hint about changing auto_now_add 
to the `default` attr.

Marcin

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/90a293a8-bcf6-4d51-bd1e-5f87ffa83f95%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to fix i18n fallback , from variant xx-YY to xx and from xx to en the translatino is not available.

2017-05-09 Thread Melvyn Sopacua
On Monday 08 May 2017 09:27:52 Abdullah Sh. wrote:
> Well as far I can test, Django i18n does supports fall-back 'xx-YY' to
> 'xx' then to default ('en' in my case) but only for 'Accept-Language'
> user agent header. It does not do same for URL language switch.

Could you please report this as a bug (maybe feature request)? I've 
dealt with this too but didn't chase it down, so thanks a bunch for that.

>From end-user perspective, there are not that many that are aware of 
the language setting of their browser. If one wants to switch language 
and you have one of those language switchers in your site it should 
always be prefered over Accept-Language header in my opinion.
-- 
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/8316648.AB8DOu0f3c%40devstation.
For more options, visit https://groups.google.com/d/optout.


Re: Angular 2 + Django + Postgresql

2017-05-09 Thread marcin . j . nowak
>From my personal experience:

   - make frontend (angular) almost 100% separate from backend (django)
   - if you want to build truly restful service, avoid DRF (more precisely 
   -- avoid whole "magical" model views, which implements CRUD antipattern)
   - focus on hypermedia (i.e. use Hydra, or start with something custom -- 
   going restful is a process)
   - avoid django forms if possible (use Colander, for example)

 
DRF will give you big community, rich features, more skilled devs and rapid 
developemnt (especially at the initial stage), but later it may introduce 
limitations. 
Just my 5 cents.

Marcin

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/aeec0b8f-388a-497b-8596-239cfd8d7daf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: vs {{ form }}

2017-05-09 Thread Melvyn Sopacua
On Friday 05 May 2017 06:17:12 guettli wrote:
> Am Donnerstag, 4. Mai 2017 16:03:25 UTC+2 schrieb Todor Velichkov:
> > Take a look at:
> > 1) Form rendering options
> >  > -options> 2) Outputting forms as HTML
> >  > rms-as-html>
> > 
> > {{ form }} and {{ form.as_table }} are basically the same.
> > So in terms of valid markup {{ form }} would be more
> > correct.
> 
> OK,  {{ form }} is what I do now. Somehow I am unsure
> if this is really the best way.

There is never a best way. Only a best way for the job.
Django's job is to provide sensible, workable defaults. Table, paragraph and 
list view are 
3 common ways to render form elements.

If you however use Bootstrap for css, you're much more helped by using the 
bootstrap3 
package[1]. Example:


{% csrf_token %}
{% bootstrap_form form %}
{% buttons submit='Go!' %}{% endbuttons%}


-- 
Melvyn Sopacua


[1] https://djangopackages.org/packages/p/django-bootstrap3/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/9008764.HJ6FAVUOio%40devstation.
For more options, visit https://groups.google.com/d/optout.


Re: vs {{ form }}

2017-05-09 Thread Jani Tiainen
And, if your really want to, you can do all that manually without using 
django rendering facilities - since nothing forces you to do that. It's 
just few convenience tools to create something to start with.


That way you have full control over your forms and how they look like 
and where are all the fields placed.


And to use bootstrap you don't need any special package, you can do it 
without it just fine.


On 09.05.2017 12:13, Melvyn Sopacua wrote:


On Friday 05 May 2017 06:17:12 guettli wrote:

> Am Donnerstag, 4. Mai 2017 16:03:25 UTC+2 schrieb Todor Velichkov:

> > Take a look at:

> > 1) Form rendering options

> >  > -options> 2) Outputting forms as HTML

> >  > rms-as-html>

> >

> > {{ form }} and {{ form.as_table }} are basically the same.

> > So in terms of valid markup {{ form }} would be more

> > correct.

>

> OK, {{ form }} is what I do now. Somehow I am unsure

> if this is really the best way.

There is never a best way. Only a best way for the job.

Django's job is to provide sensible, workable defaults. Table, 
paragraph and list view are 3 common ways to render form elements.


If you however use Bootstrap for css, you're much more helped by using 
the bootstrap3 package 
. Example:




{% csrf_token %}

{% bootstrap_form form %}

{% buttons submit='Go!' %}{% endbuttons%}



--

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/9008764.HJ6FAVUOio%40devstation 
.

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


--
Jani Tiainen

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/9717aea0-49df-ec2d-0986-5fd184cc0aa5%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Passing template_context vars to the starproject command

2017-05-09 Thread manikos
Did you find a solution to that?

On Saturday, May 5, 2012 at 2:48:28 PM UTC+3, Dom Guardiola wrote:
>
> I have a working project template that I can use with the new "--template" 
> option of the startproject management command
>
> Now Iwanted to pass more variables in the template_context, and the doc 
> [1] says  :
>
> The template context 
> 
>  
> used is: 
>
>- Any option passed to the startproject command
>- project_name -- the project name as passed to the command
>- project_directory -- the full path of the newly created project
>- secret_key -- a random key for the SECRET_KEY 
>
>  
>setting
>
>
> My question is : what is the command line syntax to pass these options ?
>
> when I type for example  :
>
> django-admin.py startproject --template=/home/admin/tmpl/ --myvar="hey" 
> a-new-project
>
> I get : django-admin.py: error: no such option: --myvar
>
> Dominique Guardiola
> http://www.quinode.fr/
>
>
> [1] 
> https://docs.djangoproject.com/en/1.4/ref/django-admin/#django-admin-startproject
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/aec83857-47fc-4131-9623-458fd39b8b06%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Need help with deployment

2017-05-09 Thread Luiz Guilherme Silva
Here is a tutorial about Django and IIS (old, but...)
https://www.toptal.com/django/installing-django-on-iis-a-step-by-step-tutorial

2017-05-09 3:59 GMT-03:00 Antonis Christofides :

> Django + Apache does make a good combination, but actually you are talking
> about Django + Apache + mod_wsgi + Windows (which is pretty much the only
> combination for Windows, excluding IIS about which I know absolutely zero).
> But you should also consider another operating system; see
> https://djangodeployment.com/2016/12/27/which-operating-
> system-should-i-choose-for-deployment/ for more.
>
> Antonis Christofideshttp://djangodeployment.com
>
>
> On 2017-05-08 13:01, sarfaraz ahmed wrote:
>
> This is first time I am trying to deploy my django project. Doing online
> research I found Django+Apache makes good combination.
>
> Regards,
> Sarfaraz Ahmed
>
> On 6 May 2017 at 01:41, Luiz Guilherme Silva 
> wrote:
>
>> Hello Ahmed.
>>
>> Why are you using apache instead of IIS? I know it's not the question,
>> but I've worked in a project running on IIS for a long time without big
>> problems, and you don't need Apache for this.
>>
>> 2017-05-04 16:00 GMT-03:00 sarfaraz ahmed :
>>
>>> Hello Friends,
>>>
>>> I have an Windows 2016 Server edition on EC2.
>>> I install Apache 2.4 VC10 on my server and installed 2.7.13
>>>
>>> I am not able to find MOD_WSGI.SO for this combination.
>>>
>>> Can someone provide me steps to compile or link to download
>>>
>>> --
>>> Thanks with regards,
>>> Sarfaraz Ahmed
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> 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/ms
>>> gid/django-users/CAEPJdixOMiS%3DBsPusybJaoKhJfaa1Pfqy6D3ND%3
>>> DEOQ8EkbsnDA%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/ms
>> gid/django-users/CAPgKrJ2V6OWuJ6ZTQVASYa1aUtMpgm-
>> TeQ0EJxODqZ3i78tt%3DA%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Thanks with regards,
> Sarfaraz Ahmed
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/CAEPJdix%2B12M-uKG0keYukG7GSppAywJYvkKQzyb%
> 3DoxfxQoxvJQ%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/b359d02c-5592-c747-2bb5-75aa42fa2d5d%
> 40djangodeployment.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.goo

Model (beginner user) : Sum of the model entries

2017-05-09 Thread Rúben Rodrigues
Hi people,

I'm new in django, so i have simple questions. Sorry for that.

I want to develop a simple app to make entries in stock. To start i install 
the jet dashboard and start an app called polls: 
https://ibin.co/3LmUv6rGJRXt.png

I want to add a entrie and inside i need to have a table where i will 
insert the news produts to the entrie. I have this now, but i need that 
which new product have a column with the liquid weight (pesoliquido) that 
is an equation:

class InputDetail(models.Model):
input = models.ForeignKey(Entrada,on_delete=models.CASCADE)
produto = models.CharField(max_length=200);
weight = models.PositiveSmallIntegerField();
caixas = models.PositiveSmallIntegerField();
pesocaixas = models.PositiveSmallIntegerField();
pesopaletes = models.PositiveSmallIntegerField();   
def _get_liquid(self):
return self.weight - (self.caixas * self.pesocaixas) - 
self.pesopaletes
pesoliquido = property(_get_liquid)
white = 'white'
green = 'green'
tipopalete = (
(white,'Jaulas Brancas'),
(green,'Jaulas Verdes'),
)
palete = models.CharField(
max_length=20,
choices=tipopalete,
default=white,
)

the liquid weight should be the equation and if the user want an entrie to 
insert the value. The table of the products inserted should have the sum of 
all liquid weight. How can i do this? I want too a popup window to insert 
the products..

Thanks guys

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/f320e0e2-1c51-47e4-8675-43d1653daa6b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Hiring | Simons Foundation | Full Stack Software Engineer | Onsite/Full time | New York City, NY

2017-05-09 Thread 'Steven Ford' via Django users
 Simons Foundation is looking for a passionate Full Stack Software 
Engineer! 

Simons Foundation exists to support basic - or discovery-driven - 
scientific research. We do this through direct grants in four areas: 
Mathematics and Physical Sciences, Life Sciences, Autism Research (SFARI), 
and Education & Outreach. This is only a quick blurb of what we do! If you 
want to find out more, please visit www.simonsfoundation.org. I'm certain 
you'll be interested! 

This role specifically is for my team. We're a small (9) team of passionate 
engineers. You'll be joining a yet young project creating Software critical 
to Simons Foundation's mission. 

What we're looking for: Passion (aka desire/enthusiasm, not any sort of JS 
library), Design Patterns, Python, Django, React, Single Page App 
experience, webpack, APIs. 

If you're interested, please either reach out to me @ 
sf...@simonsfoundation.org, or apply directly 
.
 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/b6662475-0883-4202-9943-8151745d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django admin ajax file upload

2017-05-09 Thread Olivier Dalang
Hi !

Here we use Django admin as main input interface for our staff in the field.
Our models have image fields, where the staff directly loads images from
the camera.

There are two main problems :
- the form is very slow to submit, as everything is uploaded at once, at
the very end, even if taking the pictures is done first;
- if the form is invalid for any reason, the picture is lost, and must be
taken again.

So I'm looking for an app to do ajax file upload. I had a look at those :
https://djangopackages.org/grids/g/ajax-file-uploading/
But I didn't find one that :
- is maintained (django 1.9+)
- integrates into the admin
- doesn't rely on an external service provider (fineupload, uploadcare...)

Does such an app exist ?

Thanks !

Olivier

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAExk7p1DA0uYrcuEySRPpHBXoCLGqMNXatRNSd0KeAvfdkTsvA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unicode error in __unicode__(self) function

2017-05-09 Thread rmschne
 

> I'm sorry - but this isn't your real error.
>
> You will see it in your WSGI daemon logs once you set DEBUG to false. 
>
>  
>
> This error is caused by Django trying to print the error using ascii codec 
> for the debug output (I haven't chased it down any further and I should 
> really report it).
>
>  
>
> As said, your real error is somewhere else and that will probably make 
> more sense.
>
>  
>
> -- 
>
> Melvyn Sopacua
>

Melvyn,

Thanks. I understand what you are saying. Obvious, but I didn't notice 
that. However, I do think it's a Django bug. This app is not running on a 
web server so there is no WSGI daemon.  Do you have a suggestion on what I 
can do to get a better detection of the error to enable reporting it? 

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


Re: Unicode error in __unicode__(self) function

2017-05-09 Thread Vijay Khemlani
Paste the whole stack traceof the error

On 5/9/17, rmschne  wrote:
>
>
>> I'm sorry - but this isn't your real error.
>>
>> You will see it in your WSGI daemon logs once you set DEBUG to false.
>>
>>
>>
>> This error is caused by Django trying to print the error using ascii codec
>>
>> for the debug output (I haven't chased it down any further and I should
>> really report it).
>>
>>
>>
>> As said, your real error is somewhere else and that will probably make
>> more sense.
>>
>>
>>
>> --
>>
>> Melvyn Sopacua
>>
>
> Melvyn,
>
> Thanks. I understand what you are saying. Obvious, but I didn't notice
> that. However, I do think it's a Django bug. This app is not running on a
> web server so there is no WSGI daemon.  Do you have a suggestion on what I
> can do to get a better detection of the error to enable reporting it?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b3ed676d-811a-4c53-b176-bd460f5dd54a%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/CALn3ei13o3uH%2BVZK%3D6BE7tvf82KW6ccRPrP%3DfcHwZVyY9PydFA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


i dont know from where to start my first project on django

2017-05-09 Thread vitalysweb
Hi everyone,
My project consists of a web site which allows to manage the reservations 
of vehicles by customers.
These customers are required to work with these vehicles as drivers 35 
hours a week

*front office*
__During registration on the site the user will have to load documents 
(pdf, jpeg etc)
__ after confirmation by the admin, the user can electronically sign a 
contract
 On are:
__ it can save a work schedule for one week (modifiable)
__ there are three reservation ranges per day (8 hours each)
__The availability of reservations will depend on the availability of the 
vehicles (without possibility of choice)
__ once a vehicle is recovered the driver must make a service in his 
account indicating the mileage

*Back office*
__ the admin must view the transmitted documents before validating the 
registration and then send him a contract to sign electronically
__ Manage Vehicles (Add / Remove)
__ manage availability of vehicles (repairs in garage)
__ Once a vehicle is returned to the park the person who manages the park 
must do a "vehicle return" indicating the mileage

*As I do not have experience in web development I do not know where to 
start my project, *
*Thank you for helping me*

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5f28d4e3-dd24-46a4-b7d3-e509e1059eca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unicode error in __unicode__(self) function

2017-05-09 Thread m712 - Developer
On May 9, 2017 11:42 AM, Melvyn Sopacua  wrote:
> I'm sorry - but this isn't your real error.
Your error is in another castle?




-- 
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/5911f4a1.d2d61c0a.786e9.2a60SMTPIN_ADDED_MISSING%40gmr-mx.google.com.
For more options, visit https://groups.google.com/d/optout.


django-cruds-adminlte 0.0.4 is out

2017-05-09 Thread Óscar M . Lage
Hey guys!

I would like to say that django-cruds-adminlte 0.0.4 is out 
(https://github.com/oscarmlage/django-cruds-adminlte). We're requesting for 
collaboration but if not (dunno what happens, maybe the goal of the project 
is not too attractive for the community) I would be so pleased to receive 
any kind of opinion, comment or feedback from your side.

Would like to say sorry in advance if this is not the most appropriate 
place to announce this kind of projects.

Regards!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/132dfbda-3f1b-4986-9e06-9df72e9a5a14%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Please help me to solve. I am a biginner. I am following Django tutorial on its Documentation from thier website.

2017-05-09 Thread Ngazetungue Muheue


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/29b118e6-89e6-4834-89c6-8c6cd27fee64%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: i dont know from where to start my first project on django

2017-05-09 Thread Mark Phillips
Start with the model layer. Use the admin interface to add some dummy data
and think about how you want the front facing pages/forms to look and
operate. Repeat as needed.

Mark

On Tue, May 9, 2017 at 9:03 AM,  wrote:

> Hi everyone,
> My project consists of a web site which allows to manage the reservations
> of vehicles by customers.
> These customers are required to work with these vehicles as drivers 35
> hours a week
>
> *front office*
> __During registration on the site the user will have to load documents
> (pdf, jpeg etc)
> __ after confirmation by the admin, the user can electronically sign a
> contract
>  On are:
> __ it can save a work schedule for one week (modifiable)
> __ there are three reservation ranges per day (8 hours each)
> __The availability of reservations will depend on the availability of the
> vehicles (without possibility of choice)
> __ once a vehicle is recovered the driver must make a service in his
> account indicating the mileage
>
> *Back office*
> __ the admin must view the transmitted documents before validating the
> registration and then send him a contract to sign electronically
> __ Manage Vehicles (Add / Remove)
> __ manage availability of vehicles (repairs in garage)
> __ Once a vehicle is returned to the park the person who manages the park
> must do a "vehicle return" indicating the mileage
>
> *As I do not have experience in web development I do not know where to
> start my project, *
> *Thank you for helping me*
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/5f28d4e3-dd24-46a4-b7d3-e509e1059eca%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/CAEqej2PNBO55YyNgfPtGfv%3DCUiz1_-%3D%3DrHOSsHiUD7Hx%3DgRJVQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Please help me to solve. I am a biginner. I am following Django tutorial on its Documentation from thier website.

2017-05-09 Thread Lachlan Musicman
A quick google search shows that this error message means that port is in
use by another program.

Try:

python manage.py runserver 8080

or

python manage.py runserver 8081

instead?

cheers
L.

--
"Mission Statement: To provide hope and inspiration for collective action,
to build collective power, to achieve collective transformation, rooted in
grief and rage but pointed towards vision and dreams."

 - Patrice Cullors, *Black Lives Matter founder*

On 10 May 2017 at 07:18, Ngazetungue Muheue  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/29b118e6-89e6-4834-89c6-8c6cd27fee64%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/CAGBeqiP-Ms3Ur5YjKvmJaWDjKoq1iMm9jMAFrx2UvYmzSpMdEg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: i dont know from where to start my first project on django

2017-05-09 Thread Lachlan Musicman
A further tip. Your models might be (doesn't have to be):

 - Drivers
 - Cars
 - reservations (a Many to Many relationship with extra fields
https://docs.djangoproject.com/en/1.11/topics/db/models/#extra-fields-on-many-to-many-relationships
)

cheers
L.

--
"Mission Statement: To provide hope and inspiration for collective action,
to build collective power, to achieve collective transformation, rooted in
grief and rage but pointed towards vision and dreams."

 - Patrice Cullors, *Black Lives Matter founder*

On 10 May 2017 at 07:32, Mark Phillips  wrote:

> Start with the model layer. Use the admin interface to add some dummy data
> and think about how you want the front facing pages/forms to look and
> operate. Repeat as needed.
>
> Mark
>
> On Tue, May 9, 2017 at 9:03 AM,  wrote:
>
>> Hi everyone,
>> My project consists of a web site which allows to manage the reservations
>> of vehicles by customers.
>> These customers are required to work with these vehicles as drivers 35
>> hours a week
>>
>> *front office*
>> __During registration on the site the user will have to load documents
>> (pdf, jpeg etc)
>> __ after confirmation by the admin, the user can electronically sign a
>> contract
>>  On are:
>> __ it can save a work schedule for one week (modifiable)
>> __ there are three reservation ranges per day (8 hours each)
>> __The availability of reservations will depend on the availability of the
>> vehicles (without possibility of choice)
>> __ once a vehicle is recovered the driver must make a service in his
>> account indicating the mileage
>>
>> *Back office*
>> __ the admin must view the transmitted documents before validating the
>> registration and then send him a contract to sign electronically
>> __ Manage Vehicles (Add / Remove)
>> __ manage availability of vehicles (repairs in garage)
>> __ Once a vehicle is returned to the park the person who manages the park
>> must do a "vehicle return" indicating the mileage
>>
>> *As I do not have experience in web development I do not know where to
>> start my project, *
>> *Thank you for helping me*
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/5f28d4e3-dd24-46a4-b7d3-e509e1059eca%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/CAEqej2PNBO55YyNgfPtGfv%3DCUiz1_-%3D%3DrHOSsHiUD7Hx%
> 3DgRJVQ%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/CAGBeqiO7mHHkxKka77_oiDXi7Np9AbMfczmbQrK7Ts0CaNaJzw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.