Re: cant start a new project ,just installed django

2016-10-03 Thread Sylvain Dégué
What Django & python version do you have? Le lundi 3 octobre 2016 19:07:03 UTC-4, new user a écrit : > > followed the intro: > https://docs.djangoproject.com/en/1.10/intro/tutorial01/ > > when i run django-admin startproject mysite > > its prompt : "manage.py already exists, overlaying a project o

cant start a new project ,just installed django

2016-10-03 Thread new user
followed the intro: https://docs.djangoproject.com/en/1.10/intro/tutorial01/ when i run django-admin startproject mysite its prompt : "manage.py already exists, overlaying a project or app into an existing directory won't replace conflicting files" not matter what name i give to the project , i

Composite pattern for models

2016-10-03 Thread Sylvain Dégué
Hi, I was wondering if it was possible to apply the Composite Pattern in the models. If yes, how? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop re

Re: Testing a reusable app which uses a database

2016-10-03 Thread Victor Porton
Well, I did it. On Monday, October 3, 2016 at 10:41:59 PM UTC+3, Victor Porton wrote: > > I try to make a reusable app which uses transaction.atomic(). > > When I run my test.py (below) for my reusable app, I get the below errors. > > Is it possible to test this reusable app outside of a Django pr

Re: Testing a reusable app which uses a database

2016-10-03 Thread Carl Meyer
On 10/03/2016 01:41 PM, Victor Porton wrote: > I try to make a reusable app which uses transaction.atomic(). > > When I run my test.py (below) for my reusable app, I get the below errors. > > Is it possible to test this reusable app outside of a Django project? It is not possible to test it with

Testing a reusable app which uses a database

2016-10-03 Thread Victor Porton
I try to make a reusable app which uses transaction.atomic(). When I run my test.py (below) for my reusable app, I get the below errors. Is it possible to test this reusable app outside of a Django project? [[[ import unittest from transaction_utils.transaction import retry class TestRetry(uni

How to debug oauth2 code?

2016-10-03 Thread Etienne Robillard
I'm trying to build a custom Django app with OAuth 2.0 support through django-hotsauce-oauthclient, however once I logged in all requests will share my username. I use gevent for handling thread-local data (the request.environ object). Is there a proper way to debug OAuth 2.0 code ? Thank

Re: An almost reusable app, how to make it reusable?

2016-10-03 Thread Carl Meyer
Hi Victor, On 10/03/2016 01:06 PM, Victor Porton wrote: > I've created an app which is "almost" reusable: it depends on a variable > in /setting.py of our project . > > from .settings import TRANSACTION_ATTEMPT_COUNT > > Can it be made into an reusable app? Certainly. Change the import to `from

Re: An almost reusable app, how to make it reusable?

2016-10-03 Thread Tim Graham
Typically, you import settings (even those that you define yourself) using "from django.conf import settings". https://docs.djangoproject.com/en/stable/topics/settings/#using-settings-in-python-code On Monday, October 3, 2016 at 3:06:01 PM UTC-4, Victor Porton wrote: > > I've created an app whic

Re: An almost reusable app, how to make it reusable?

2016-10-03 Thread ludovic coues
Provide a default value or raise a ImproperlyConfigured error if the key is missing. Document the need to set the key. That should be enough to call your app "reusable". 2016-10-03 21:06 GMT+02:00 Victor Porton : > I've created an app which is "almost" reusable: it depends on a variable in > /set

An almost reusable app, how to make it reusable?

2016-10-03 Thread Victor Porton
I've created an app which is "almost" reusable: it depends on a variable in /setting.py of our project . from .settings import TRANSACTION_ATTEMPT_COUNT Can it be made into an reusable app? -- You received this message because you are subscribed to the Google Groups "Django users" group. To u

Re: django form converter to PDF

2016-10-03 Thread Ovnicraft
On Mon, Oct 3, 2016 at 7:05 AM, M Hashmi wrote: > Hi, > > I need some simple library to convert a simple quote form to PDF. I tried > xhtml2pdf and few others but need really simple process to use but creating > a fancy pdf. > I highly recommend you check http://wkhtmltopdf.org/ it works really

How to detect deadlocks?

2016-10-03 Thread Victor Porton
How to detect deadlocks of a transaction? Which exception is thrown if a deadlock happens? We currently use SQLite and MySQL but may switch to another DB. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: django form converter to PDF

2016-10-03 Thread Walt
You can also check out the Python wrapper for pdftk. https://github.com/revolunet/pypdftk It allows you to take a pdf form and fill it dynamically and "flatten" it. Aside from that, Weasyprint also works pretty well. Walt On Monday, October 3, 2016 at 8:05:43 AM UTC-4, M Hashmi wrote: > > H

Re: django form converter to PDF

2016-10-03 Thread 06userit
Hello Mudassar, I agree with Ludovic : you could try weasyprint. I am using it on my project and am very satisfied. One hint : if I remember correctly, images on html page should be png in order for pdf to be generated by default. jpg support package is optional. See documentation https://media

Re: django form converter to PDF

2016-10-03 Thread M Hashmi
You are a rockstar in the group man. Let me try it and I will let you know about the results. I didn't get a change to look at Weasy_print. Regards, Mudassar On Mon, Oct 3, 2016 at 5:26 AM, ludovic coues wrote: > the xhtml2pdf doc point to weasyprint [1]. After a quick look at the > doc [2], it

Re: django form converter to PDF

2016-10-03 Thread ludovic coues
the xhtml2pdf doc point to weasyprint [1]. After a quick look at the doc [2], it look like a simple way to generate pdf from html file. If you already have a url on your django app rendering the quote, I would use weasyprint like that: from io import BytesIO from django.http.response impo

django form converter to PDF

2016-10-03 Thread M Hashmi
Hi, I need some simple library to convert a simple quote form to PDF. I tried xhtml2pdf and few others but need really simple process to use but creating a fancy pdf. If anyone knows please let me know. Regards, Mudassar -- You received this message because you are subscribed to the Google Gro