Re: template include for Django 1.8

2016-07-14 Thread Mike Dewhirst

On 14/07/2016 4:53 PM, James Schneider wrote:

On Jul 13, 2016 6:54 PM, "Mike Dewhirst" mailto:mi...@dewhirst.com.au>> wrote:


I need to include the contents of a css file in my template [1]

The css content needs to exist within  and
 tags so that the pdf output software I'm using can see the styles.


I can get the correct effect by copying and pasting the contents of

the css file into the template but that way madness lies!




Not necessarily. If that's the only location where this CSS is used,
then it may be appropriate to include it directly in the template.


It is used elsewhere too




{% include %} exists but seems designed for other templates. And I

can't find it in the docs.




https://docs.djangoproject.com/en/1.8/ref/templates/builtins/#include


Sorry about that. Missed it when scanning the index list on the right of 
the page.





Is there a way to include the content of a css file?



I'm reasonably confident that the include tag will do exactly what you
want it to do. Django is not going to care whether it is including HTML
or CSS or a recipe for chocolate French fries. It'll only care if other
template tags are included and cause other issues, but otherwise the
content is irrelevant. All the template system does is generate a text
file, ultimately.


Includes the css file thanks James but it doesn't satisfy the pdf software.

Back to the embedded styles copied and pasted.

Oh well.

Mike



I'm assuming this CSS file is located in your template directories and
not in your static files area so that the template system can find it.

-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%2BciUCGXTfH3hg6G105cLbParD1fD2iijbUtE3uJ682E1hNg%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/846fa131-6270-2de5-eebf-73ee6faf6433%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: template include for Django 1.8

2016-07-14 Thread James Schneider
>
>
> Includes the css file thanks James but it doesn't satisfy the pdf
software.
>
> Back to the embedded styles copied and pasted.
>
> Oh well.
>

I'd be curious as to why. There should be no difference between you c/p the
styles in to the template vs. having them included via the template tag.

Did you examine the rendered output that was being sent to your PDF
generator?

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


Re: template include for Django 1.8

2016-07-14 Thread Mike Dewhirst

On 14/07/2016 5:17 PM, James Schneider wrote:



Includes the css file thanks James but it doesn't satisfy the pdf

software.


Back to the embedded styles copied and pasted.

Oh well.



I'd be curious as to why. There should be no difference between you c/p
the styles in to the template vs. having them included via the template tag.

Did you examine the rendered output that was being sent to your PDF
generator?


No I didn't. I will do so. I sometimes give in too easily.

Cheers

Mike





-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%2BciXDuep9achG-%2BAm%2B8NmwZcGtNnc1y%3DYUYPqR7K9Avo6Ag%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/0a9ced57-9db1-bf5b-14e9-7c0f20bf6abb%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: django_bootstrap_calendar and admin backend

2016-07-14 Thread ludovic coues
If you are using
https://github.com/sandlbn/django-bootstrap-calendar/, I assume you
have changed some things. For exemple, the module don't come with an
admin.py file.
All your change would be nice so we can replicate your problem :)

2016-07-13 22:33 GMT+02:00 Cronos Cto :
> Hello Ludovic, what part of the code would you like me to post ?
>
> --
> 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/6dfb8f1c-70be-433f-b2fc-e79a3c1507f1%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Coues Ludovic
+336 148 743 42

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


Re: Easiest way to ajax enable django forms

2016-07-14 Thread ludovic coues
A JS library like Jquery or plain javascript.
Listen to event, intercept & cancel them, make the query to django,
insert or remove the appropriate item.

2016-07-13 20:25 GMT+02:00 J Singh :
> I want functionality such as add/delete line items to an order , do not want
> a form resubmit every time an item is added . What is the best way to do
> this without having to use angular/ react etc
>
> --
> 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/9fdac377-aeb0-4b5c-b3fc-f57a64b4f5f3%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Coues Ludovic
+336 148 743 42

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


Re: django_bootstrap_calendar and admin backend

2016-07-14 Thread Cronos Cto



Yes https://github.com/sandlbn/django-bootstrap-calendar/ 

 this 
is the one I am using.
This are the parts I changed.




\mysite\mysite\settings.py

INSTALLED_APPS = [
'django_bootstrap_calendar',
'blog',
'staff',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
-
\mysite\mysite\urls.py

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

urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^', include('staff.urls')),
url(r'^blog/', include('blog.urls')),
url(r'^calendar/',include('django_bootstrap_calendar.urls')),
]
-

\mysite\django_bootstrap_calendar\admin.py

from django.contrib import admin
from django_bootstrap_calendar.models import CalendarEvent

class CalendarEventAdmin(admin.ModelAdmin):
list_display = ["title", "url", "css_class", "start", "end"]
list_filler = ["title"]

admin.site.register(CalendarEvent,CalendarEventAdmin)

-
\mysite\staff\templates\staff\header.html

**
**

**
**

**
* Centro de Dia de Messines*
* *
* {% load staticfiles %}*
* *
* *
* *
* html,*
* body {*
*  height:100%*
* }*
* *
**

**
* *
* *
*  *
*  *
*  *
* *
*  *
*  *
*  *
*  *
*  *
*  Uma Familia maior*
*  *
*  *
* *

* *
*  *
*  *

*  *
*   *
* *
* *
*  *
* Ínicio*
* Calendário*
* Blog*
* Contatos*
*  *
*  *
*   *
*  *
 
* *
* *
*   {% block content %}*
*   {% endblock %} *
* *
*  *
*  *
* *
* *
* *
* Contact | LinkedIn | Twitter | Google+*
* *
*  *
**

**




This about all the stuff I changed, I realize that some code that I still 
need to change is not changed like Load templatetags, In your template 
file, base.html file css section and base.html file javascript section. The 
problem is I do not understand very well where to do this part of the 
instalation.

If needed I can send you the files so you can replicate easier.

-- 
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/9b930883-674c-4b53-9344-d225a4869a22%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django and aws elastic beanstalk

2016-07-14 Thread matthew
Hi, I’ve been directed to you for technical support regarding Django. I can get 
it working on my own computer running on the provided local server however when 
I follow any tutorial to host it on elastic beanstalk I get one of two of the 
following errors:
    “ERROR: your requirements.txt is invalid.”
    “ERROR: WSGIPath refers to a file that does not exist.”

I’ve tried everything I can think of but nothing seems to work. 
I look forward to hearing back from you and hope that you can help me with this.


Matthew Bates
VOG Calgary Developer Inc - We Are Mobile Development Professionals
Phone: (403) 399-2519 || Email: matt...@vogcalgaryappdeveloper.com
1900 11 Street SE,Suite 150, Calgary, AB T2G 3G2

-- 
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/578704a5.4e57240a.c684b.9d0c%40mx.google.com.
For more options, visit https://groups.google.com/d/optout.


分享一个用python和javascript开发的Django: advanced network website

2016-07-14 Thread Cherry Chen




大家好,我是内地的,想知道这个群里是否有来自中国内地,香港和台湾的朋友。希望大家喜欢我的分享,多多交流。

https://www.livecoding.tv/olivierpons/videos/JYpDK-django-advanced-network-website-cogofly-2


-- 
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/da55dc00-e38f-41d6-b42c-8c29a5f55dad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django invoice generation system

2016-07-14 Thread USMAN MALIK
Hi. I'm new to django and i'm creating a buisness application for my 
company. i want to generate a monthly invoice for every member in my 
company and for this i have two models in which all the information is 
stored. Is there a way to generate an automatic invoice based on the 
information in these two models? kindly help me. 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/ab6fca84-0cc7-4789-9e62-9d02cba01f6b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: drop-in replacement for admin module foreign key relation UI

2016-07-14 Thread muin
when I use this method, I can only use its id, So how can it show related 
model's field which has been defined in __str__

On Tuesday, February 17, 2015 at 3:20:22 PM UTC+8, Jani Tiainen wrote:
>
> On Mon, 16 Feb 2015 15:03:05 -0800 (PST) 
> Jani Kajala > wrote: 
>
> > Hi all, 
> > 
> > I have tons of objects referenced by ForeignKey in Django Admin module 
> UI, 
> > and I would like to replace it with something more optimal, e.g. 
> auto-fill 
> > input box or something. 
> > 
> > My model looks something like this: 
> > 
> > class SoapCall(models.Model): 
> > customer = models.ForeignKey(Customer, null=True, blank=True) 
> > created = models.DateTimeField(default=now) 
> > wsdl = models.CharField(max_length=255) 
> > func = models.CharField(max_length=63) 
> > request = models.TextField() 
> > response = models.TextField() 
> > 
> > Now, this works great, but if I have 10 Customer objects it's not 
> very 
> > nice to generate one huge ... element for every page 
> load. 
> > 
> > There seems to be many possible plugins/implementations for this, but I 
> was 
> > just wondering if anyone would have up-to-date recommendations in this 
> > mailing list. I'm on Python 3.4.2 and Django 1.7.4. 
>
> I would start with built-in implementation, a.k.a. rawid_id_fields <
> https://docs.djangoproject.com/en/1.7/ref/contrib/admin/#django.contrib.admin.ModelAdmin.raw_id_fields>
>  
>
>
>
> -- 
> 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/d669c0e2-ec77-489e-86dd-6fbb31929f1a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django REST - localization settings

2016-07-14 Thread Wequu A
Hello, 

I am using django to create rest api with django-rest-framework. I will not 
use its template system. My database backend is PostgreSQL where I set 
client_encoding to UTF8 and timezone to UTC. In settings.py there are 
options like USE_I18N, USE_L10N and USE_TZ. Do I need them? 
I don't understand what doc says about them , because I haven't seen what 
they do in practice. I think that in my case it is the best to store 
datetime in UTC and client will convert it to locale. Is this good approach?

Thanks in advance,
Tobias


-- 
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/3727cf96-98b2-4bd9-9de4-b8c7657e5b23%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Custom Models

2016-07-14 Thread AT
Thanks for this. Now everything makes perfect sense.

On 13/07/2016 09:18, Bruno A. wrote:
> |defget_queryset(self,request):qs
> =self.model.with_expired_objects.get_queryset()   
> ordering =self.get_ordering(request)ifordering:qs
> =qs.order_by(*ordering)returnqs |

-- 
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/5787784E.605%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django_bootstrap_calendar and admin backend

2016-07-14 Thread ludovic coues
I haven't managed to reproduce your error. In fact, I managed to make
it working.

What output do you get when you hit
http://localhost:8000/calendar/json/?from=146532400&to=149000240
? Adjust the hostname and port to your dev server.

2016-07-14 11:54 GMT+02:00 Cronos Cto :
>
>
>
> Yes https://github.com/sandlbn/django-bootstrap-calendar/ this is the one I
> am using.
> This are the parts I changed.
>
>
>
>
> \mysite\mysite\settings.py
>
> INSTALLED_APPS = [
> 'django_bootstrap_calendar',
> 'blog',
> 'staff',
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> ]
> -
> \mysite\mysite\urls.py
>
> from django.conf.urls import url, include
> from django.contrib import admin
>
> urlpatterns = [
> url(r'^admin/', admin.site.urls),
> url(r'^', include('staff.urls')),
> url(r'^blog/', include('blog.urls')),
> url(r'^calendar/',include('django_bootstrap_calendar.urls')),
> ]
> -
>
> \mysite\django_bootstrap_calendar\admin.py
>
> from django.contrib import admin
> from django_bootstrap_calendar.models import CalendarEvent
>
> class CalendarEventAdmin(admin.ModelAdmin):
> list_display = ["title", "url", "css_class", "start", "end"]
> list_filler = ["title"]
>
> admin.site.register(CalendarEvent,CalendarEventAdmin)
>
> -
> \mysite\staff\templates\staff\header.html
>
> 
> 
>
> 
> 
>
> 
> Centro de Dia de Messines
> 
> {% load staticfiles %}
>  type = "text/css"/>
> 
> 
> html,
> body {
>  height:100%
> }
> 
> 
>
> 
> 
> 
>  
>  
>  
>  style='max-height:100px;' alt="face">
>  
>  
>  
>  
>  
>  Uma Familia maior
>  
>  
> 
>
> 
>  
>  
>
>  
>   
> 
> 
>  
> Ínicio
> Calendário
> Blog
> Contatos
>  
>  
>   
>  
>
> 
> 
>   {% block content %}
>   {% endblock %}
> 
>  
> 
> 
> 
> 
> Contact |  target="blank">LinkedIn | Twitter |  href="#" target="blank">Google+
> 
> 
> 
>
> 
>
>
>
>
> This about all the stuff I changed, I realize that some code that I still
> need to change is not changed like Load templatetags, In your template file,
> base.html file css section and base.html file javascript section. The
> problem is I do not understand very well where to do this part of the
> instalation.
>
> If needed I can send you the files so you can replicate easier.
>
> --
> 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/9b930883-674c-4b53-9344-d225a4869a22%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Coues Ludovic
+336 148 743 42

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


Re: I am not sure what “: command not found” means when I run virtualenvwrapper mkvirtualenv command

2016-07-14 Thread monoBOT
2016-07-13 20:00 GMT+01:00 Leo :

> virtualenvwrapper


​You have to follow the setup process step by step ... you are probably
missing the location of the wrapper command in your path.

http://virtualenvwrapper.readthedocs.io/en/latest/install.html​



-- 
*monoBOT*
Visite mi sitio(Visit my site): monobotsoft.es/blog/

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


Re: Django REST - localization settings

2016-07-14 Thread monoBOT
If you want the django app to be timzone, localization and
intentioanlization aware you have to set the propper settings in the
settings.py

2016-07-14 11:07 GMT+01:00 Wequu A :

> Hello,
>
> I am using django to create rest api with django-rest-framework. I will
> not use its template system. My database backend is PostgreSQL where I set
> client_encoding to UTF8 and timezone to UTC. In settings.py there are
> options like USE_I18N, USE_L10N and USE_TZ. Do I need them?
> I don't understand what doc says about them , because I haven't seen what
> they do in practice. I think that in my case it is the best to store
> datetime in UTC and client will convert it to locale. Is this good approach?
>
> Thanks in advance,
> Tobias
>
>
> --
> 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/3727cf96-98b2-4bd9-9de4-b8c7657e5b23%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*monoBOT*
Visite mi sitio(Visit my site): monobotsoft.es/blog/

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


Any one tried of Django Postgres with Ngnix?

2016-07-14 Thread khaleela . visolve

 Any one tried of Django Postgres with Ngnix?

-- 
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/e3f5d76a-a844-44a0-847c-eb0e18c3c3da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Any one tried of Django Postgres with Ngnix?

2016-07-14 Thread Rafael E. Ferrero
YES, I do !!


Rafael E. Ferrero

2016-07-14 11:16 GMT-03:00 :

>
>  Any one tried of Django Postgres with Ngnix?
>
> --
> 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/e3f5d76a-a844-44a0-847c-eb0e18c3c3da%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/CAJJc_8VQLt5pqHzV7q96tFqiwyChS4%3DkTFKY1OHMNQ0L62Hm5Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Easiest way to ajax enable django forms

2016-07-14 Thread Derek
Not surprisingly, someone (well, more than one someone, actually) has 
already done this:

https://realpython.com/blog/python/django-and-ajax-form-submissions/
or
http://stackoverflow.com/questions/14099038/an-easy-way-to-submit-django-forms-using-ajax-jquery
or
https://aliteralmind.wordpress.com/2014/09/21/jquery_django_tutorial/
or (real-time version)
https://www.youtube.com/watch?v=KgnPSmrQrXI

And I am sure a good search engine will turn up more...

On Thursday, 14 July 2016 11:34:48 UTC+2, ludovic coues wrote:
>
> A JS library like Jquery or plain javascript. 
> Listen to event, intercept & cancel them, make the query to django, 
> insert or remove the appropriate item. 
>
> 2016-07-13 20:25 GMT+02:00 J Singh >: 
> > I want functionality such as add/delete line items to an order , do not 
> want 
> > a form resubmit every time an item is added . What is the best way to do 
> > this without having to use angular/ react etc 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Django users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to django-users...@googlegroups.com . 
> > To post to this group, send email to django...@googlegroups.com 
> . 
> > Visit this group at https://groups.google.com/group/django-users. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/django-users/9fdac377-aeb0-4b5c-b3fc-f57a64b4f5f3%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>
>
>
> -- 
>
> Cordialement, Coues Ludovic 
> +336 148 743 42 
>

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


Re: Any one tried of Django Postgres with Ngnix?

2016-07-14 Thread Vijay Khemlani
nginx + uwsgi + postgres here

On Thu, Jul 14, 2016 at 10:43 AM, Rafael E. Ferrero <
rafael.ferr...@gmail.com> wrote:

> YES, I do !!
>
>
> Rafael E. Ferrero
>
> 2016-07-14 11:16 GMT-03:00 :
>
>>
>>  Any one tried of Django Postgres with Ngnix?
>>
>> --
>> 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/e3f5d76a-a844-44a0-847c-eb0e18c3c3da%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/CAJJc_8VQLt5pqHzV7q96tFqiwyChS4%3DkTFKY1OHMNQ0L62Hm5Q%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/CALn3ei0im8ptCG6x_BstB_JBz%2BR4nKSz2WZneh9VE02pA2Lb-g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


ModelAdmin dynamic fields

2016-07-14 Thread Bernat Bonet
I need to add dynamic fields to ModelAdmin fieldset that are not part of 
Model.

This field is to show or hide certain fields.

How can I do this?

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/c2bb9ef2-e57c-49f8-8091-5bed4d541cb5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Dynamic ModelAdmin Field

2016-07-14 Thread Bernat Bonet
I need to add dynamic fields to ModelAdmin that are not part of the Model.

Models:

product: cod, des
product_categories: cat, val

I want to add val1, val2 in ProductAdmin

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/47fa72e8-5954-4a20-989b-f8e99ad4a9b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jet Admin Backend Prob with Google Analytics

2016-07-14 Thread Michael Schintler
Hi all , 

I m sorry but new to Django and after some learning i came to Jet Admin 
Backend. All works fine excepting the "Google Analytics Widget". 
Could anybody help me ? 

I folowed absolutly this link 
https://github.com/geex-arts/django-jet/blob/master/docs/dashboard_modules.rst

but it s a prob with my Document root . When i set the absolute path to the 
client_secrets.json i become this output

 File 
"/home/developer/webapps/machine2/django/lib/python3.5/importlib/__init__.py", 
line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 986, in _gcd_import
  File "", line 969, in _find_and_load
  File "", line 958, in _find_and_load_unlocked
  File "", line 673, in _load_unlocked
  File "", line 662, in exec_module
  File "", line 222, in 
_call_with_frames_removed
  File "/home/developer/webapps/machine2/django/pressmedia/pm/settings.py", 
line 4, in 
JET_MODULE_GOOGLE_ANALYTICS_CLIENT_SECRETS_FILE = 
os.path.join(PROJECT_DIR, 
'/home/developer/webapps/machine2/django/pressmedia/client_secrets.json')
NameError: name 'PROJECT_DIR' is not defined


Thanks a lot if someone has an answer for 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/f8f30a8d-a3b4-45b5-ab24-39c0251eaa95%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jet Admin Backend Prob with Google Analytics

2016-07-14 Thread ludovic coues
You have no variable named PROJECT_DIR your file pressmedia/pm/settings.py.
You might want to remove os.path.join as you already specify the full path.

2016-07-14 17:16 GMT+02:00 Michael Schintler :
> Hi all ,
>
> I m sorry but new to Django and after some learning i came to Jet Admin
> Backend. All works fine excepting the "Google Analytics Widget".
> Could anybody help me ?
>
> I folowed absolutly this link
> https://github.com/geex-arts/django-jet/blob/master/docs/dashboard_modules.rst
>
> but it s a prob with my Document root . When i set the absolute path to the
> client_secrets.json i become this output
>
>  File
> "/home/developer/webapps/machine2/django/lib/python3.5/importlib/__init__.py",
> line 126, in import_module
> return _bootstrap._gcd_import(name[level:], package, level)
>   File "", line 986, in _gcd_import
>   File "", line 969, in _find_and_load
>   File "", line 958, in _find_and_load_unlocked
>   File "", line 673, in _load_unlocked
>   File "", line 662, in exec_module
>   File "", line 222, in
> _call_with_frames_removed
>   File "/home/developer/webapps/machine2/django/pressmedia/pm/settings.py",
> line 4, in 
> JET_MODULE_GOOGLE_ANALYTICS_CLIENT_SECRETS_FILE =
> os.path.join(PROJECT_DIR,
> '/home/developer/webapps/machine2/django/pressmedia/client_secrets.json')
> NameError: name 'PROJECT_DIR' is not defined
>
>
> Thanks a lot if someone has an answer for 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/f8f30a8d-a3b4-45b5-ab24-39c0251eaa95%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Coues Ludovic
+336 148 743 42

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


Document storage and data mining

2016-07-14 Thread Gary Roach

Hi all;

I have finished most of the official Django tutorial, have started 
fooling around with my actual project and have realized that I'm not 
sure how to start. My projects initial objectives are as follows:


Photos of the pages of a document are aggregated into a single pdf file 
for those who wish to view the original document. An rtf transcript of 
the document is include for readability and a txt transcript is included 
for global searches. A metafile is included - part of which will be 
generated by the program - to facilitate key word searches. I wish to be 
able to search documents - probably by key word - and then pull up the 
document set by document key. No changes to the documents will be 
allowed after they have been loaded into the database. At present, my 
main objective is to get the documents into the database in retrievable 
form.


While - with the exception of the metafile - these are static files, we 
are talking about hundreds of documents. I do not think that storing 
them as static files will work. They have to be searchable. I assume 
that I need a model that will set up appropriate fields in the database 
(postgresql) This is where I stumble. I've looked at the Model.field 
reference but can't seem to come up with what I need or don't know what 
I'm looking at. The latter being the most probable.


If someone  could point me in the right direction or to documentation 
that would help; it would be sincerely appreciated.


Gary R.

--
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/bd99bc90-e65b-1705-9392-3fac0e316ef3%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: 分享一个用python和javascript开发的Django: advanced network website

2016-07-14 Thread David Wong
我上海的

发自我的 iPhone

> 在 2016年7月14日,16:11,Cherry Chen  写道:
> 
> 
> 大家好,我是内地的,想知道这个群里是否有来自中国内地,香港和台湾的朋友。希望大家喜欢我的分享,多多交流。
> 
> https://www.livecoding.tv/olivierpons/videos/JYpDK-django-advanced-network-website-cogofly-2
> 
> 
> -- 
> 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/da55dc00-e38f-41d6-b42c-8c29a5f55dad%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/9CC697FE-188B-4CB3-ACD7-D11341AA8133%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: 分享一个用python和javascript开发的Django: advanced network website

2016-07-14 Thread muin
我杭州的

On Thursday, July 14, 2016 at 7:31:45 PM UTC+8, Cherry Chen wrote:
>
>
> 
>
> 大家好,我是内地的,想知道这个群里是否有来自中国内地,香港和台湾的朋友。希望大家喜欢我的分享,多多交流。
>
>
> https://www.livecoding.tv/olivierpons/videos/JYpDK-django-advanced-network-website-cogofly-2
>
>
>

-- 
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/50c28b7f-1f9c-4787-8f44-8d3fdb755e28%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Any one tried of Django Postgres with Ngnix?

2016-07-14 Thread khaleela . visolve
Hello all,thanks for the response.

I do use ngnix + uwsgi + postgres.

Before it was mongo DB, am migrating that to postgres. When I change the 
settings from mongo to postgres in Django settings file, immediately I get 
502 bad gateway error. 

And in ngnix log following error occurs:
 " upstream prematurely closed connection while reading response header 
from upstream"

When I revert that settings back to mongo - it works fine.

Did any one of you encountered this type of issues during your deployment ? 


On Thursday, July 14, 2016 at 8:39:00 PM UTC+5:30, Vijay Khemlani wrote:
>
> nginx + uwsgi + postgres here
>
> On Thu, Jul 14, 2016 at 10:43 AM, Rafael E. Ferrero  > wrote:
>
>> YES, I do !!
>>
>>
>> Rafael E. Ferrero
>>
>> 2016-07-14 11:16 GMT-03:00 >:
>>
>>>
>>>  Any one tried of Django Postgres with Ngnix?
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to django-users...@googlegroups.com .
>>> To post to this group, send email to django...@googlegroups.com 
>>> .
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/e3f5d76a-a844-44a0-847c-eb0e18c3c3da%40googlegroups.com
>>>  
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAJJc_8VQLt5pqHzV7q96tFqiwyChS4%3DkTFKY1OHMNQ0L62Hm5Q%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/5a9efd21-94c5-43cf-9319-9fb700cf94bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Any one tried of Django Postgres with Ngnix?

2016-07-14 Thread 06userit
Hello, I do use nginx + uwsgi + postgres. Maybe you could try one of 
following points below ?
Cheers.

1) there is a very good tutorial to install nginx, see below. This is the 
one I used for step by step installation on production server :
http://uwsgi-docs.readthedocs.io/en/latest/tutorials/Django_and_nginx.html

2) on top of my head, I had error " upstream prematurely closed connection 
while reading response header from upstream" one or two times several 
months ago, while installing production server. This was due to an 
incorrect setting in nginx configuration file 'mysite_nginx.conf'. I do not 
remember exactly which setting, sorry (are you running http or https ?).

3) you could check that your postgresql server is up and running (I do this 
with webmin http://www.webmin.com/ ).

4) you could try to install first nginx using 'TCP port socket' (and not 
'Unix socket') for test purpose. This is explained in tutorial above.

5) you could look at nginx error log in /var/log/nginx directory

6) error could be due to incorrect permissions. So maybe you should set 
permissions as below (this is explained in tutorial) :
uwsgi --socket site.sock --wsgi-file test.py --chmod-socket=666

7) you could add settting below in django settings.py in order to receive 
description of error by mail

ADMINS = (

('ME', ‘j...@gmail.com'),

)



-- 
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/b1c78398-109e-4764-aebe-250c6f511e74%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.