M2M: How to order by a field from the `through` table?

2016-02-16 Thread 'Brutus Schraiber' via Django users
Hi all…

I can't come up with a syntax to order by a field of the `trough` table in 
a many to many relationship and how to combine it with `prefetch_related`.


I have two models — _Note_ and _Pinboard_ — with a many to many 
relationship. Those two models are related trough another model — _Pin_ — 
so I can store additional information about the relationship.

I want to show the related _Note_ instances in the `DetailView` for 
_Pinboard_. That's not the problem. But I want to __prefetch__ the notes 
and also __order__ them on the `position` field from the `through` table.

Any hints on how to archive this (prefetch + ordering on `trough` table)?


# Example

This is what I have so far… it works in the sense, that I don't have to 
query for each entry, but I found no way to order the _Note_ instances by 
their `position` without more queries for each instance.


__Models__

from django.db import models


class Note(models.Model):

title = models.CharField(max_lenght=200)

content = models.TextField()


class Pinboard(models.Model):

title = models.CharField(max_lenght=200)

notes = models.ManyToManyField(
Note, blank=True, related_name='pinboards', through='Pin'
)


class Pin(models.Model):

class Meta:
ordering = ['position', ]
get_latest_by = 'position'

pinboard = models.ForeignKey(Pinboard, related_name='note_pins')

note = models.ForeignKey(Note, related_name='pinboard_pins')

position = models.PositiveSmallIntegerField(default=0)


__View__

from django.views.generic import DetailView


class PinboardDetailView(DetailView):

  model = Pinboard

  # THIS is the part, where I want the notes ordered by the position in

  queryset = Pinboard.objects.prefetch_related('notes')


__Template__

{% extends 'base.html' %}
{% block content %}
{{ pinboard.title }}
{% if pinboard.notes.all.exists %}

{% for note in pinboard.notes %}
{{ note.title }}
{% endfor %}

{% else %}
Nothing here yet…
{% endif %}
{% endblock content %}


# What else did I try

Right now I'm using the `Pin` Model for my query (with `select_related`). 
It's a workaround. I'm thinking there must be a better way, using 
`Pinboard` and `prefetch_related` seems more straight forward, but I can't 
figure out how.

BTW: It's on SO here: 
http://stackoverflow.com/questions/35410834/how-to-order-by-a-field-from-the-through-table-for-a-m2m-relationship-in-djang

Regards
-brutus

-- 
You received this message because you are subscribed 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/36d9514c-8415-4589-a221-2169f30acedb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: file upload fails with slow network bandwith in django

2016-02-16 Thread Pablo Conesa
Thanks once more James for your help and time. Answers below..

El martes, 16 de febrero de 2016, 8:33:08 (UTC+1), James Schneider escribió:
>
>
>
> On Mon, Feb 15, 2016 at 10:41 PM, Pablo Conesa  > wrote:
>
>> Thanks James. answers in line:
>>
>> El lunes, 15 de febrero de 2016, 23:04:48 (UTC+1), James Schneider 
>> escribió:
>>>
>>>
>>>
>>> On Mon, Feb 15, 2016 at 10:20 AM, Pablo Conesa  
>>> wrote:
>>>
 Hi, I posted this in stackoverflow. Now I'm trying here: 
 http://stackoverflow.com/questions/35413649/file-upload-fails-with-slow-network-bandwith-in-django

 I've got a code working fine that uploads a file to a DJANGO server.

 It works fine on a fine connection.

 Now if, using fiddler to simulate a slow connectionpage freezes 
 (Chrome pop up offering to kill the page).

 I've tested in different ways and the only factor that causes the error 
 is a slow upload speed. e.g. If I choose a wi-fi network it fails but over 
 the ethernet it works.

 File is 100MB!.

 python: 2.7.6 

 DJANGO: 1.5.5 or 1.9 (I updated to 1.9 and is not working either)

 Fiddler show -1 in the response, and says: "No response body".

 Any ideas?


>>>
>>> How long does the file upload work before receiving the error? 
>>>
>>
>> There is no response from the server (fiddler returns -1, whatever this 
>> means) 
>>
>
> Well, no response from the server doesn't necessarily mean that there were 
> no logs. Can you check the error and access logs of the server? 
>

 

>
> Does Fiddler return an immediate response of -1, or does it seem like 
> there is a timeout period?
>

immediate response, no time out period.

>
> After a quick glance at Fiddler itself, are you using any customizations 
> on the rules 
>

no customization. Default "Simulate Modem speeds". I must say I use fiddle 
to be able to reproduce the error locally. If I hit the server (production) 
using wifi (slower than ethernet) I got the same thing, no fiddler in the 
middle.

>
>
>>> My guess is that Fiddler is attempting to use an HTTP chunked transfer 
>>> to send the file 'slowly' (by rate-limiting the chunks it sends rather than 
>>> traffic shaping the data stream itself), which is how modern JS libraries 
>>> normally handle large file uploads. However, this takes advantage of 
>>> features built into the HTTP 1.1 standard, and I'm not entirely sure 
>>> whether or not the Django dev server fully implements HTTP 1.1. That would 
>>> explain why you are getting a response body error (since the Django dev 
>>> server probably doesn't understand chunked requests and doesn't know to 
>>> expect more data). See https://code.djangoproject.com/ticket/25619 
>>> 
>>>  
>>> That's purely a guess though, as I'm not familiar with how Fiddler works, 
>>> and Django's internal support for HTTP 1.1 is somewhat ambiguous. 
>>>
>>
>> Don't know either details about FIddler..but what you are saying sounds 
>> reasonable and in the right direction...
>>
>>>
>>> This type of testing should be done against the production server (which 
>>> likely fully implements HTTP 1.1), not the Django dev server, since 
>>> performance of the dev server cannot be correlated with a production server 
>>> that implements threading and/or multiple worker processes.
>>>
>>
>> I've done this. Actually the bug was reported in production (apache 
>> forwarding to guinicorn)
>>
>
> Hmm, Apache should handle that fine. It's had 1.1 support forever, and I 
> don't believe it requires any special configuration. Might be related to 
> gunicorn, though, if it is responsible for handling the chunked response. 
> Found this to be similar to your issue: 
> https://github.com/benoitc/gunicorn/issues/1125, although sadly no 
> resolution. Might point you in the right direction, though.
>
>
Looks like the same problem ... 

>  
>
>>  
>>
>>>
>>> On a side note, though. If you plan to have users regularly upload large 
>>> files (>2MB), you should seriously look in to implementing chunked uploads 
>>> via a JS library. With a standard upload via a regular form, the worker 
>>> process in your server handling the upload are dedicated to that upload 
>>> until it finishes. Usually this is fine for small uploads, but for larger 
>>> uploads that can take minutes or hours, it becomes a large problem even on 
>>> a site with a small user base. If 5 users are uploading a large file, and 
>>> you only have 5 worker processes running, then literally nobody can access 
>>> your site until at least one of those uploads finishes. With chunked 
>>> transfers, the file is broken up into pieces and sent as many small 
>>> requests rather than a single large one. This allows a server worker 
>>> process to process the small upload, then step away to serve other users, 
>>> and then process t

Deploy Adagios web application

2016-02-16 Thread Adriaan Wilmink
I setup Nagios Core in a Centos 6.4 VM. 

To create ease of configuration, I am busy setting up a module called 
Adagios .

This module creates a web interface to create, edit and remove Nagios 
objects.

the module has Django as a prerequisite. Because Centos 6.4 automatically 
prefers Python 2.6, even after setting up a virtual environment

and I currently have not been able to get pip to accept python3 as default 
(even when using pip 3.5), I am provisionally using Django 1.6.

I know this has security implications, but for the time being my goal is to 
see a working setup.

The setup is in fact working, but only from localhost.


I startup Adagios by running an executable ./manage.py runserver.

After looking up manage.py I learned that this is normal behaviour that it 
will only recognise 12.0.0.1:8000 to display the website.

If I'm correct, I need to deploy the Django web application in order to 
make it reachable from other hosts on the local network.

I tried following the 1.6 tutorial on the official Django website 
 with 
no luck.

I will add my httpd.conf file.

WSGIScriptAlias / /opt/adagios/adagios/wsgi.py
WSGIPythonPath /opt/adagios/
WSGIDaemonProcess 10.149.21.79 python-path=/opt/adagios/
WSGIProcessGroup 10.149.21.79




Order deny,allow
Allow from all





Also I can see that wsgi_mod is loaded when I run httpd -t -D DUMP_MODULES. 
I saw in another similair post in this forum that might be important.


I did not create the Django project, I just built it from source, as I 
built Adagios and it's other components.

I followed the literal steps, so I'm fairly sure it is configured 
correctly. The Adagios installation tutorial does not mention any specific 
steps how to deploy the web application.


Can anyone give any specific or general hints how to proceed? Thanks in 
advance!


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


django: drop down menu not displaying on template despite correct syntax

2016-02-16 Thread clarksonchris81


I have successfully configured a way to upload files to a website that I am 
making. However we would like to include a drop-down menu on the site. 
However, we want to include in the form of a drop-down menu called 
"mismatch choice":


models.py: for drop-down menu

 class Mismatches(models.Model):

  MISMATCH_CHOICES = (

   ('0', '0'),

   ('1', '1'),

   ('2', '2'),

   ('3', '3'),

   )

  mismatch = models.IntegerField(max_length=1, default='0', choices 
= MISMATCH_CHOICES)


forms.py for drop-down menu:

  class MismatchesForm(ModelForm): #unsure how to reference a 
class in our in-app-urls.py

class Meta:

model = Mismatches

fields = ['mismatch']

'model=Mismatches' links to the Mismatches class in models and the 'field' 
gives the options.


views.py for drop-down menu

 class Mismatch_Choice(FormView):

   template_name = 'list.html'

   form_class = MismatchesForm



"template_name = 'list.html'" links the html page called list.html. 
'form_class' links to the form 'MismatchesForm'.

html for drop-down menu

{% csrf_token %}

  {{ form.mismatch }}

  




We used a tutorial as a template for our code but it won't display on our 
html page even though we have referenced it with {{ form.mismatch}} which 
links to the variable 'mismatch' which is set in our form as the 'model' 
and hence links to the options given in models.py. 

We are wondering if the html page is not seeing the drop-down menu because 
it's set as a class in the forms.py but we haven't referenced a class in 
our in-app urls.py (is there a way to do this?)...

NOTE: all migrations were accordingly applied and the server was restarted 
multiple times

-- 
You received this message because you are subscribed 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/e7785168-32ed-4a42-8406-291ca8140051%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Deploy Adagios web application

2016-02-16 Thread Adriaan Wilmink


Op dinsdag 16 februari 2016 14:03:20 UTC+1 schreef Adriaan Wilmink:
>
> I setup Nagios Core in a Centos 6.4 VM. 
>
> updated httpd.conf file:
>
> WSGIScriptAlias / /opt/adagios/adagios/wsgi.py
> WSGIPythonPath /opt/adagios/
> WSGIDaemonProcess 10.149.21.79 python-path=/opt/adagios:
> /usr/lib64/python2.6/site-packages
> WSGIProcessGroup 10.149.21.79
>
>
> 
> 
> Order deny,allow
> Allow from all
> 
> 
>
>
> Regardless of adding the actual python path, or when I leave out 
> daemonizing Django, I get a website error.
>

If I use port number 8000 I get the error connection refused, if I use 
default port 80 I get a service temporarily unavailable error.

 

-- 
You received this message because you are subscribed 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/3fe21c11-2225-4eff-bcf9-e634fc032973%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to install on windows?

2016-02-16 Thread Jonas Svensson
Hi,
you already have virtualenv with python3.5.

To create a new virtual environment you can do.

c:\Temp>c:\Python35\python c:\Python35\Tools\Scripts\pyvenv.py myenv


(https://docs.python.org/3/library/venv.html)

Cheers

On Monday, February 15, 2016 at 1:49:33 AM UTC+1, bob gailer wrote:
>
> I tried following the instructions at 
> https://docs.djangoproject.com/en/1.9/howto/windows/. 
>
> I installed Python in C:\python35. After that most things didn't seems 
> to work as promised. 
>
> Python 3.5 does not appear in the PATH. (Python 3.3 is there.) Yes I 
> checked |Add Python 3.5 to PATH. 
>
> C:\>python --version 
> Python 3.3.3 
>
> I typed (at the C: prompt) pip install virtualenvwrapper-win 
>
> 'pip' is not recognized as an internal or external command, 
> operable program or batch file. 
>
> After searching I found pip in C:\python35/scripts 
>
> So I changed to that directory and typed 
> ||C:\python35/scripts>||pip install virtualenvwrapper-win 
>
> That worked.| 
>
> |Then I tried |mkvirtualenv myproject and got 
> 'virtualenv.exe' is not recognized as an internal or external command, 
> operable program or batch file. 
>
> A few years ago I tried to install Django. I recall running into similar 
> issues. 
>
> I must be missing something. Any guidance would be appreciated. 
>

-- 
You received this message because you are subscribed 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/e3d50098-cc28-4937-8960-8544ccad0df7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Running a Django site on a standalone Windows laptop

2016-02-16 Thread Remco Gerlich
Hi,

We have a web application that usually runs on Ubuntu servers on the
Internet. In the background it calls software that runs on Windows servers,
over a network.

For a new project, this application must run standalone on a laptop, in the
field, used by not very technical users. We can make the Python/Django code
Windows compatible pretty easily, but not the background software, so it
will be a Windows laptop that will run everything.

What's the best way to run Django as a service under Windows? Is Apache /
ModWSGI feasible?

Remco Gerlich

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


Re: Running a Django site on a standalone Windows laptop

2016-02-16 Thread m1chael
I would vote for a Virtualbox instance depending on your performance
requirements

On Tue, Feb 16, 2016 at 9:36 AM, Remco Gerlich  wrote:

> Hi,
>
> We have a web application that usually runs on Ubuntu servers on the
> Internet. In the background it calls software that runs on Windows servers,
> over a network.
>
> For a new project, this application must run standalone on a laptop, in
> the field, used by not very technical users. We can make the Python/Django
> code Windows compatible pretty easily, but not the background software, so
> it will be a Windows laptop that will run everything.
>
> What's the best way to run Django as a service under Windows? Is Apache /
> ModWSGI feasible?
>
> Remco Gerlich
>
> --
> You received this message because you are subscribed 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/CAFAGLK2KyoCgHJnXiHQAYiPo8o7FdDDEWWy_s5n2cX1_bawvOg%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/CAAuoY6O4Dz3W%2BtOuBeJ63PQ2a0FMEGOYFePvYk2X7ox3Knbx8w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Running a Django site on a standalone Windows laptop

2016-02-16 Thread Remco Gerlich
We thought about that and it's certainly an option, but 1) the
communication with the background tasks running on the Windows host is
going to be tricky and 2) I have no experience with running it as a service.

So I'd prefer running on Windows directly.

Remco Gerlich


On Tue, Feb 16, 2016 at 3:47 PM, m1chael  wrote:

> I would vote for a Virtualbox instance depending on your performance
> requirements
>
> On Tue, Feb 16, 2016 at 9:36 AM, Remco Gerlich  wrote:
>
>> Hi,
>>
>> We have a web application that usually runs on Ubuntu servers on the
>> Internet. In the background it calls software that runs on Windows servers,
>> over a network.
>>
>> For a new project, this application must run standalone on a laptop, in
>> the field, used by not very technical users. We can make the Python/Django
>> code Windows compatible pretty easily, but not the background software, so
>> it will be a Windows laptop that will run everything.
>>
>> What's the best way to run Django as a service under Windows? Is Apache /
>> ModWSGI feasible?
>>
>> Remco Gerlich
>>
>> --
>> You received this message because you are subscribed 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/CAFAGLK2KyoCgHJnXiHQAYiPo8o7FdDDEWWy_s5n2cX1_bawvOg%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/CAAuoY6O4Dz3W%2BtOuBeJ63PQ2a0FMEGOYFePvYk2X7ox3Knbx8w%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/CAFAGLK0_PyicqwwzaFhz3WqioJgELBk3aExF4zqWxzFzfTj6yw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Running a Django site on a standalone Windows laptop

2016-02-16 Thread Avraham Serour
I would also consider cygwin, you can even use uwsgi and nginx, you can
easily add them as cygwin services which cygwin takes care to add them as
windows services

On Tue, Feb 16, 2016, 4:59 PM Remco Gerlich  wrote:

> We thought about that and it's certainly an option, but 1) the
> communication with the background tasks running on the Windows host is
> going to be tricky and 2) I have no experience with running it as a service.
>
> So I'd prefer running on Windows directly.
>
> Remco Gerlich
>
>
> On Tue, Feb 16, 2016 at 3:47 PM, m1chael  wrote:
>
>> I would vote for a Virtualbox instance depending on your performance
>> requirements
>>
>> On Tue, Feb 16, 2016 at 9:36 AM, Remco Gerlich  wrote:
>>
>>> Hi,
>>>
>>> We have a web application that usually runs on Ubuntu servers on the
>>> Internet. In the background it calls software that runs on Windows servers,
>>> over a network.
>>>
>>> For a new project, this application must run standalone on a laptop, in
>>> the field, used by not very technical users. We can make the Python/Django
>>> code Windows compatible pretty easily, but not the background software, so
>>> it will be a Windows laptop that will run everything.
>>>
>>> What's the best way to run Django as a service under Windows? Is Apache
>>> / ModWSGI feasible?
>>>
>>> Remco Gerlich
>>>
>>> --
>>> You received this message because you are subscribed 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/CAFAGLK2KyoCgHJnXiHQAYiPo8o7FdDDEWWy_s5n2cX1_bawvOg%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/CAAuoY6O4Dz3W%2BtOuBeJ63PQ2a0FMEGOYFePvYk2X7ox3Knbx8w%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/CAFAGLK0_PyicqwwzaFhz3WqioJgELBk3aExF4zqWxzFzfTj6yw%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/CAFWa6tLM6_Z_qquge04y5uQ4C3eChF0rhnoKCFTNhLjjcM-_aw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to install on windows?

2016-02-16 Thread bob gailer

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

1. Uninstall all versions of Python on your machine

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


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

Good luck and welcome!

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

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

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

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

C:\>python --version
Python 3.3.3

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

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

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

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

That worked.|

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

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

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






--
Image and video hosting by TinyPic

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


Migration difficulties

2016-02-16 Thread C.J.S. Hayward
I am in the process of migrating a Django project that worked flawlessly,
at least far as nuts and bolts go. There were unpleasant surprises, but
they were all my fault.

I went to post a specific problem, with stacktrace below, but when I
searched, someone else had beaten me to the punch on a question with no
answers yet.

sh-3.2# python manage.py runserver

Unhandled exception in thread started by 

Traceback (most recent call last):

  File "/usr/local/lib/python2.7/site-packages/django/utils/autoreload.py",
line 226, in wrapper

fn(*args, **kwargs)

  File
"/usr/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py",
line 109, in inner_run

autoreload.raise_last_exception()

  File "/usr/local/lib/python2.7/site-packages/django/utils/autoreload.py",
line 249, in raise_last_exception

six.reraise(*_exception)

  File "/usr/local/lib/python2.7/site-packages/django/utils/autoreload.py",
line 226, in wrapper

fn(*args, **kwargs)

  File "/usr/local/lib/python2.7/site-packages/django/__init__.py", line
18, in setup

apps.populate(settings.INSTALLED_APPS)

  File "/usr/local/lib/python2.7/site-packages/django/apps/registry.py",
line 85, in populate

app_config = AppConfig.create(entry)

  File "/usr/local/lib/python2.7/site-packages/django/apps/config.py", line
90, in create

module = import_module(entry)

  File
"/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py",
line 37, in import_module

__import__(name)

  File "/Users/christos/pragmatometer/pragmatometer/models.py", line 4, in


from django.contrib.auth.models import User

  File
"/usr/local/lib/python2.7/site-packages/django/contrib/auth/models.py",
line 4, in 

from django.contrib.auth.base_user import AbstractBaseUser,
BaseUserManager

  File
"/usr/local/lib/python2.7/site-packages/django/contrib/auth/base_user.py",
line 49, in 

class AbstractBaseUser(models.Model):

  File "/usr/local/lib/python2.7/site-packages/django/db/models/base.py",
line 94, in __new__

app_config = apps.get_containing_app_config(module)

  File "/usr/local/lib/python2.7/site-packages/django/apps/registry.py",
line 239, in get_containing_app_config

self.check_apps_ready()

  File "/usr/local/lib/python2.7/site-packages/django/apps/registry.py",
line 124, in check_apps_ready

raise AppRegistryNotReady("Apps aren't loaded yet.")

django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.


A few questions:

First, if it is possible within reasonable effort to get my project running
on Gunicorn, how many more obstacles do I face before using Django becomes
something for people with deadlines?

Second, would there be any real problem with downgrading Django and
dependencies, perhaps determining a version by appropriate error, so that
Django acts like a version I'm familiar with?

Third, what should be my approach if my goal is "Get XYZ project which was
built under a version of Django working correctly"? I do not have new
projects which require newer functionality?


Thanks,


-- 
[image: Christos Jonathan Seth Hayward] 
*CJS Hayward *, Author, UI / UX.

*Amazon * • Author Bio
 • Email  • Facebook
 • *Flagship Website
* • Google Plus
 • LinkedIn
 • *Portfolio + More
* • Twitter  •
If you read one work out of all that I wrote, read *Doxology
*!

-- 
You received this message because you are subscribed 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/CAE6_B5RePXaOSMmJWh3LV4H%3D%2BOe%2BAdP2YFvaqcmk9vh601SBrA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Running a Django site on a standalone Windows laptop

2016-02-16 Thread Ezequiel Bertti
You can try docker with docker toolkit.

and run this sample:

https://docs.docker.com/compose/django/



On Tue, Feb 16, 2016 at 1:24 PM, Avraham Serour  wrote:

> I would also consider cygwin, you can even use uwsgi and nginx, you can
> easily add them as cygwin services which cygwin takes care to add them as
> windows services
>
> On Tue, Feb 16, 2016, 4:59 PM Remco Gerlich  wrote:
>
>> We thought about that and it's certainly an option, but 1) the
>> communication with the background tasks running on the Windows host is
>> going to be tricky and 2) I have no experience with running it as a service.
>>
>> So I'd prefer running on Windows directly.
>>
>> Remco Gerlich
>>
>>
>> On Tue, Feb 16, 2016 at 3:47 PM, m1chael  wrote:
>>
>>> I would vote for a Virtualbox instance depending on your performance
>>> requirements
>>>
>>> On Tue, Feb 16, 2016 at 9:36 AM, Remco Gerlich  wrote:
>>>
 Hi,

 We have a web application that usually runs on Ubuntu servers on the
 Internet. In the background it calls software that runs on Windows servers,
 over a network.

 For a new project, this application must run standalone on a laptop, in
 the field, used by not very technical users. We can make the Python/Django
 code Windows compatible pretty easily, but not the background software, so
 it will be a Windows laptop that will run everything.

 What's the best way to run Django as a service under Windows? Is Apache
 / ModWSGI feasible?

 Remco Gerlich

 --
 You received this message because you are subscribed 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/CAFAGLK2KyoCgHJnXiHQAYiPo8o7FdDDEWWy_s5n2cX1_bawvOg%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/CAAuoY6O4Dz3W%2BtOuBeJ63PQ2a0FMEGOYFePvYk2X7ox3Knbx8w%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/CAFAGLK0_PyicqwwzaFhz3WqioJgELBk3aExF4zqWxzFzfTj6yw%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/CAFWa6tLM6_Z_qquge04y5uQ4C3eChF0rhnoKCFTNhLjjcM-_aw%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Ezequiel Bertti
E-Mail: eber...@gmail.com
Cel: (21) 99188-4860

-- 
You received this message because you are subscribed 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@googleg

Where is the issues page?

2016-02-16 Thread shivam Agarwal
I want to contribute to Django but i cannot find the issues page , can 
someone help me find 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/9e74ba39-0183-4ed4-968b-9b5d7ac6fd04%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: mathematical function and django connect

2016-02-16 Thread Luis Zárate
What is wrong in your code?

I suggested you some scripts changes that allows import and use in views.

Help us to help you, give us more information about what are you doing,
what are you planning to do? Why you think you code is wrong?.

Did you create the view as I suggested?

I think you need to do this steps.

1. Create a django view with some HTML template
2. Create a form ( search for django forms)
3. Insert the form in the HTML template
4. Validate and extract the data inside forms ( it is easy using django
forms)
5. Format the data for use in mathematic function (send data to script in
the correct way )
6. Get data from script
7. Insert the data into template context
8. Render in HTML the data in the HTML template

El lunes, 15 de febrero de 2016, Xristos Xristoou 
escribió:
> after read your toturial from the django docs and next page from
the django docs
> i think so my python code is wrong to get in views.py, i think so get in
form
> Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos
Xristoou έγραψε:
>>
>> hello,
>>
>> i create some python mathematical function on python idle,
>> i want to create website where the user import value numbers on the
function
>> and take the results from that.
>> question one,how to connect my mathematical function on the django?
>> question two,how to connect input and output from the scipts in the
website ?
>> the second question i ask because input and output from the function is
a dynamic define from the user
>>
>>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/f4806da4-886f-4562-8e46-4633693b333e%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed 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/CAG%2B5VyOJ4H2mvjdaBRvmRizzCiwKB4vsXowKbwypAYJG%3DPp7-Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Where is the issues page?

2016-02-16 Thread Luis Zárate
https://code.djangoproject.com/


El martes, 16 de febrero de 2016, shivam Agarwal 
escribió:
> I want to contribute to Django but i cannot find the issues page , can
someone help me find 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/9e74ba39-0183-4ed4-968b-9b5d7ac6fd04%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

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


Re: Running a Django site on a standalone Windows laptop

2016-02-16 Thread James Schneider
On Tue, Feb 16, 2016 at 6:36 AM, Remco Gerlich  wrote:

> Hi,
>
> We have a web application that usually runs on Ubuntu servers on the
> Internet. In the background it calls software that runs on Windows servers,
> over a network.
>
> For a new project, this application must run standalone on a laptop, in
> the field, used by not very technical users. We can make the Python/Django
> code Windows compatible pretty easily, but not the background software, so
> it will be a Windows laptop that will run everything.
>
> What's the best way to run Django as a service under Windows? Is Apache /
> ModWSGI feasible?
>
>
I would first try a native installation of Apache/mod_wsgi. Apache installs
as a service and can easily be made available on both the laptop and other
machines on the same network. Adding other complexity layers like
virtualization, containers, or Cygwin (which I'm not even sure how to
classify, lol) will almost certainly give you trouble with a portable
server environment like you are trying to establish. Not that it isn't
possible to do it with those technologies, but your level of complexity
increases immensely, and the ratio of complexity layers to end-user issues
is usually exponential in nature.

Having never dealt with Django/Python on Windows myself, I'm afraid I can't
speak to how well supported such a setup is (although it seems to be per
the Apache/WSGI pages).

This guide seems reasonable and appears to be close to what you want.
https://frepple.com/docs/2.2/installation-guide/windows-apache.html

Also happened to just stumble across this on a Googling expedition:

https://code.djangoproject.com/wiki/WindowsInstall

Good luck!

-James

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


Re: file upload fails with slow network bandwith in django

2016-02-16 Thread James Schneider
>
> How long does the file upload work before receiving the error?

>>>
>>> There is no response from the server (fiddler returns -1, whatever this
>>> means)
>>>
>>
>> Well, no response from the server doesn't necessarily mean that there
>> were no logs. Can you check the error and access logs of the server?
>>
>
>

Have you checked the server logs?



>
>
>>
>> Does Fiddler return an immediate response of -1, or does it seem like
>> there is a timeout period?
>>
>
> immediate response, no time out period.
>


Without looking at the server logs, I can only guess that Gnuicorn is
unhappy with the headers that are being sent, and might be closing the
connection. A long timeout would probably indicate that Gnuicorn is waiting
for more data but something in the upload process is not triggering that it
has reached the end of the data stream.



>
>> After a quick glance at Fiddler itself, are you using any customizations
>> on the rules
>>
>
> no customization. Default "Simulate Modem speeds". I must say I use fiddle
> to be able to reproduce the error locally. If I hit the server (production)
> using wifi (slower than ethernet) I got the same thing, no fiddler in the
> middle.
>

But it works using a wired Ethernet connection? Honestly, the speed
difference between Wi-Fi and Ethernet for this purpose is probably not
relevant to the problem. The server logs would tell you more about what is
happening.



>>
 Nice advice...I'll look into this. Do you know any nice example for
>>> that JS library chunk upload.
>>>


>>
>> Probably best to stick with your existing JS framework of choice if you
>> are using one. All of the major ones have some version of a chunked
>> uploader (JQuery and Angular), and I come across resumable.js fairly
>> frequently. I've never personally had a need for one, so I can't really
>> comment on them in any sort of detail or make a recommendation.
>>
>
> Testing resumable.jslet's see how it goes.
>
> So, far there is some response, but after a while got 404 response
> (testing locally against DAJNGO)will it make a difference against
> gunicorn?
>
>
> 
>

This smells like either a memory exhaustion/ceiling issue or some kind of
internal connection/process timeout, neither of which are likely easy to
adjust using the Django dev server. Gunicorn probably has 10,000 knobs to
adjust those timers and limits, though.

Look at the server error/access logs.

-James

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2Be%2BciWH3YarsJHniWWv-wzZ4%3D%3DM4Yg7X%2BeBeCKwRRbhQDhG3w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


var1 = var2 = var3

2016-02-16 Thread anotherdjangonewby

Hi,

this may be a bit off-topic, but:

How are expressions like:

var1 = var2 = var3

called Python. Without a hint I cannot goolge this.

Thanks

Kai

--
You received this message because you are subscribed 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/56C38119.5040807%40gmx.de.
For more options, visit https://groups.google.com/d/optout.


Re: var1 = var2 = var3

2016-02-16 Thread Alex Heyden
That's an assignment statement. See
https://docs.python.org/2/reference/simple_stmts.html for more.

On Tue, Feb 16, 2016 at 2:05 PM, anotherdjangonewby <
anotherdjangone...@gmx.de> wrote:

> Hi,
>
> this may be a bit off-topic, but:
>
> How are expressions like:
>
> var1 = var2 = var3
>
> called Python. Without a hint I cannot goolge this.
>
> Thanks
>
> Kai
>
> --
> You received this message because you are subscribed 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/56C38119.5040807%40gmx.de.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Running a Django site on a standalone Windows laptop

2016-02-16 Thread Mike Dewhirst
I agree with James. Apache and mod_wsgi is fine on Windows. There may be 
some Windows-specific Apache conf tweaks but running single-user on a 
laptop should be easy.


On 17/02/2016 6:55 AM, James Schneider wrote:

On Tue, Feb 16, 2016 at 6:36 AM, Remco Gerlich mailto:re...@gerlich.nl>> wrote:

Hi,

We have a web application that usually runs on Ubuntu servers on the
Internet. In the background it calls software that runs on Windows
servers, over a network.

For a new project, this application must run standalone on a laptop,
in the field, used by not very technical users. We can make the
Python/Django code Windows compatible pretty easily, but not the
background software, so it will be a Windows laptop that will run
everything.

What's the best way to run Django as a service under Windows? Is
Apache / ModWSGI feasible?


I would first try a native installation of Apache/mod_wsgi. Apache
installs as a service and can easily be made available on both the
laptop and other machines on the same network. Adding other complexity
layers like virtualization, containers, or Cygwin (which I'm not even
sure how to classify, lol) will almost certainly give you trouble with a
portable server environment like you are trying to establish. Not that
it isn't possible to do it with those technologies, but your level of
complexity increases immensely, and the ratio of complexity layers to
end-user issues is usually exponential in nature.Â

Having never dealt with Django/Python on Windows myself, I'm afraid I
can't speak to how well supported such a setup is (although it seems to
be per the Apache/WSGI pages).

This guide seems reasonable and appears to be close to what you want.
https://frepple.com/docs/2.2/installation-guide/windows-apache.html

Also happened to just stumble across this on a Googling expedition:

https://code.djangoproject.com/wiki/WindowsInstall

Good luck!

-James


--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to django-users+unsubscr...@googlegroups.com
.
To post to this group, send email to django-users@googlegroups.com
.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CA%2Be%2BciXsZw5-CqL4px93vUM8LAofKATeFSLcmov3fKNesnE0bw%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/56C395F7.8090205%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


null datetime field and json fixtures

2016-02-16 Thread Malik Rumi
There are a ton of answers to this question out there - if you can wade 
through all the ones that refer to forms and not models. The consensus 
seems to be that datetime has to be set to both blank=true and null=true. 
And when I put in one test row of data manually through the admin, I could 
leave my datetime field blank with no problems. But when I tried to load 
the 89 other instances through a fixture, I got error after error.

As near as I can tell, if you leave a json value blank, loaddata says it 
isn't a json document. But if you put the empty string, '', Null, None, 
"Null", "None" or "-00-00" in there, it is rejected as not valid date 
format. Therefore, it seems there is no way to do this through a fixture. 
My question: Is this correct? If so, is there any alternative to doing it 
all manually? 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/db367bcf-8cbf-4001-8976-f602e93576d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Deploy Adagios web application

2016-02-16 Thread Luis Zárate
I don't know where is your problem, and I deployed django with apache time
ago, but if I remember well WSGIDaemonProcess is not a IP, It is the user
of process that run wsgi so I used like

WSGIDaemonProcess myuser
WSGIDaemonGroup myusergroup

I sorry if I am not in the truth.


El martes, 16 de febrero de 2016, Adriaan Wilmink 
escribió:
>
>
> Op dinsdag 16 februari 2016 14:03:20 UTC+1 schreef Adriaan Wilmink:
>>
>> I setup Nagios Core in a Centos 6.4 VM.
>> updated httpd.conf file:
>> WSGIScriptAlias / /opt/adagios/adagios/wsgi.py
>> WSGIPythonPath /opt/adagios/
>> WSGIDaemonProcess 10.149.21.79
python-path=/opt/adagios:/usr/lib64/python2.6/site-packages
>> WSGIProcessGroup 10.149.21.79
>>
>>
>> 
>> 
>> Order deny,allow
>> Allow from all
>> 
>> 
>>
>> Regardless of adding the actual python path, or when I leave out
daemonizing Django, I get a website error.
>
> If I use port number 8000 I get the error connection refused, if I use
default port 80 I get a service temporarily unavailable error.
>
>
> --
> You received this message because you are subscribed 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/3fe21c11-2225-4eff-bcf9-e634fc032973%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed 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/CAG%2B5VyMyJXVGeXFefUDdEfuaFSWjJo78v%3Dmx1P_tNHQqi4V9Og%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.