defining an app stub using AppConfig?

2014-11-24 Thread Eric Abrahamsen
I'm messing around with testing many Github forks of the emencia newsletter app, looking for one I like. In the meantime (and as I'm likely to continue switching around for a while), I'd like not to have to commit code that points at the different names of the different apps: they all have the

Re: Django install packages using pip

2014-11-24 Thread Hossein Rashnoo
the problem was i use python2.6 with django 1.7 and when install django 1.6 problem solved -- 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

How to do DB memcaching in Django with derived data?

2014-11-24 Thread Saqib Ali
My question is explained in detail here: http://stackoverflow.com/questions/27114947/how-to-do-db-memcaching-in-django-with-derived-data -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails

Re: Obtaining content from Git

2014-11-24 Thread martin f krafft
also sprach Russell Keith-Magee [2014-11-25 01:16 +0100]: > Sure - that could work too. Although I'd question why you'd do > this, rather than just checking out the relevant hash onto the > filesystem, and doing a direct filesystem read. Yeah, and I think you have me

Re: django on ubuntu

2014-11-24 Thread Collin Anderson
Also, in case you haven't seen it, the official django tutorial is amazing. https://docs.djangoproject.com/en/dev/intro/ On Saturday, November 22, 2014 10:42:13 AM UTC-5, Mosharof sabu wrote: > > hi > i a going to start django on ubuntu . can any one please give me > some link of good

Re: Image input missing from POST request

2014-11-24 Thread Collin Anderson
Hi, I certainly am learning something new about . However, it may be that that trick simply doesn't work correctly for file fields. My question is: _does_ it work correctly when the is a child of the ? Collin On Saturday, November 22, 2014 1:21:32 PM UTC-5, Abhishek Batra wrote: > > Hey

Re: DecimalField returns 'This value must be a decimal number' when blank

2014-11-24 Thread Collin Anderson
Hi, Use form.cleaned_data instead of request.POST, because form.cleaned_data will property convert strings into decimals or None. codpozo = form.cleaned_data['codpozo'] But again, use a ModelForm. it's super easy: class PozoForm(forms.ModelForm): class Meta: model = Pozo

Re: Obtaining content from Git

2014-11-24 Thread Russell Keith-Magee
On Mon, Nov 24, 2014 at 7:43 PM, martin f krafft wrote: > also sprach Russell Keith-Magee [2014-11-24 > 11:38 +0100]: > > Perhaps I wasn't clear. > > No, you were. I am just pushing back a little bit because I come > from another angle and I greatly

Logging \u2083 as cp1252 UnicodeEncodeError in Python 3.4

2014-11-24 Thread Mike Dewhirst
Somehow recently the character causing the logging problem is one of many which are working well in the browser. They are unicode subscripted numbers for example, \u2083 is subscripted "3". But in logging under Python 3.4 it causes --- Logging error --- Traceback (most recent call last):

Re: not thread-safe function can break a django application?

2014-11-24 Thread Collin Anderson
On Saturday, November 22, 2014 4:46:56 AM UTC-5, Fabio Caritas Barrionuevo da Luz wrote: > > I was trying to answer a question in a Brazilian forum about django. > > one of the proposed solutions utilized the function locale.setlocale() > from locale module. > > according to the

Re: Little baffled: object has no attribute 'save' only when running tests.

2014-11-24 Thread Detectedstealth
Never mind I need some sleep I named my TestCase with the same name as my model... I can't believe I didn't see that. class FishType(TestCase): On Monday, November 24, 2014 2:31:33 PM UTC-8, Detectedstealth wrote: > > When writing a test to just try and create an object from my model I get >

Little baffled: object has no attribute 'save' only when running tests.

2014-11-24 Thread Detectedstealth
When writing a test to just try and create an object from my model I get the following error: line 10, in test_saving_and_retrieving_fishtypes test2.save() AttributeError: 'FishType' object has no attribute 'save' tests.py from django.test import TestCase from trip.models import

Re: How do I supply an appropriate application.wsgi to Gunicorn?

2014-11-24 Thread Christos Jonathan Seth Hayward
And with that, I'm off and running! Thank you for your help. On Mon, Nov 24, 2014 at 4:05 PM, Carl Meyer wrote: > On 11/24/2014 03:00 PM, Carl Meyer wrote: > > On 11/24/2014 02:56 PM, Christos Jonathan Seth Hayward wrote: > >> Thanks so much! > >> > >> Could you confirm the

Re: How do I supply an appropriate application.wsgi to Gunicorn?

2014-11-24 Thread Carl Meyer
On 11/24/2014 03:00 PM, Carl Meyer wrote: > On 11/24/2014 02:56 PM, Christos Jonathan Seth Hayward wrote: >> Thanks so much! >> >> Could you confirm the invocation? >> >> cjsh@ps306627:~/cynthia$ gunicorn cynthia.wsgi 0.0.0.0: >> >> usage: gunicorn [OPTIONS] [APP_MODULE] >> >> gunicorn: error:

Re: How do I supply an appropriate application.wsgi to Gunicorn?

2014-11-24 Thread Carl Meyer
On 11/24/2014 02:56 PM, Christos Jonathan Seth Hayward wrote: > Thanks so much! > > Could you confirm the invocation? > > cjsh@ps306627:~/cynthia$ gunicorn cynthia.wsgi 0.0.0.0: > > usage: gunicorn [OPTIONS] [APP_MODULE] > > gunicorn: error: No application module specified. That's the

Re: How do I supply an appropriate application.wsgi to Gunicorn?

2014-11-24 Thread Christos Jonathan Seth Hayward
Thanks so much! Could you confirm the invocation? cjsh@ps306627:~/cynthia$ gunicorn cynthia.wsgi 0.0.0.0: usage: gunicorn [OPTIONS] [APP_MODULE] gunicorn: error: No application module specified. cjsh@ps306627:~/cynthia$ gunicorn cynthia.wsgi:application 0.0.0.0: usage: gunicorn

Re: How do I supply an appropriate application.wsgi to Gunicorn?

2014-11-24 Thread Carl Meyer
On 11/24/2014 02:38 PM, Christos Jonathan Seth Hayward wrote: > Ok; wonder if I should upgrade Django. > > I just ran a startproject earlier today (I can re-create it; I was just > trying to get it running and see the start page in my browser before going > further). > >

Re: How do I supply an appropriate application.wsgi to Gunicorn?

2014-11-24 Thread Christos Jonathan Seth Hayward
Ok; wonder if I should upgrade Django. I just ran a startproject earlier today (I can re-create it; I was just trying to get it running and see the start page in my browser before going further). cjsh@ps306627:~/cynthia$ find . -name \*.wsgi cjsh@ps306627:~/cynthia$ python manage.py shell

Re: How do I supply an appropriate application.wsgi to Gunicorn?

2014-11-24 Thread Carl Meyer
Hi, On 11/24/2014 02:19 PM, Christos Jonathan Seth Hayward wrote: > From > http://stackoverflow.com/questions/27113466/how-can-i-deploy-django-gunicorn-under-apache-proxy > : > > 've run through the documentation and am hitting the same pages over and > over again. At present I've found

How do I supply an appropriate application.wsgi to Gunicorn?

2014-11-24 Thread Christos Jonathan Seth Hayward
From http://stackoverflow.com/questions/27113466/how-can-i-deploy-django-gunicorn-under-apache-proxy : 've run through the documentation and am hitting the same pages over and over again. At present I've found documentation to run off an existing myapp.wsgi file, but documentation for how to make

Re: How to deal with CSRF middleware from a crawler

2014-11-24 Thread Carl Meyer
Hi Torsten, On 11/24/2014 01:00 PM, Torsten Bronger wrote: > We use crawlers, which in our case a Python scripts that read data > from disk and send a lot of HTTP POST requests to the Django > deployment. The POST requests hit the same URLs/Views that are also > used by the browser to edit

How to deal with CSRF middleware from a crawler

2014-11-24 Thread Torsten Bronger
Hallöchen! We use crawlers, which in our case a Python scripts that read data from disk and send a lot of HTTP POST requests to the Django deployment. The POST requests hit the same URLs/Views that are also used by the browser to edit something with a web . If I activate the CSRF middleware,

Re: Obtaining content from Git

2014-11-24 Thread reduxionist
Arg, Google Groups' mobile interface sucks for posting rather than reading. As I was trying to say: On Tuesday, November 25, 2014 2:43:55 AM UTC+7, reduxionist wrote: > > >Hence I was thinking: how much trouble would it be to have Django > >reach into Git rather than its database and obtain

Obtaining content from Git

2014-11-24 Thread reduxionist
>Hence I was thinking: how much trouble would it be to have Django >reach into Git rather than its database and obtain data there to be >filled into template slots? Ideally, there'd be the possibility of >running a filter (e.g. reStructuredText) between Git and the >template rendering. >What

Re: Web and mobile app with Django? Kivy? sth else?

2014-11-24 Thread Fred Stluka
+1 for writing a single RWD (Responsive Web Design) web app using Django, instead of writing separate web, Android and iOS apps. If necessary, wrap the result in PhoneGap to mobile-specific features, uploading images from the camera, capturing the GPS location, showing maps, accessing the local

Re: Obtaining content from Git

2014-11-24 Thread Tim Chase
On 2014-11-24 11:49, martin f krafft wrote: > also sprach Tim Chase [2014-11-24 > 11:19 +0100]: > > urlpatterns = patterns('', > > url(r'^blob/([0-9a-f]{40})/$', > > 'myapp.views.render_blob', ...), ) > > … this is straight-forward, thanks. I'd probably try

Re: Has anyone successfully used django-concurrency?

2014-11-24 Thread Collin Anderson
Hi Ian, You may want to try opening an issue on django-consurrency showing the error you're getting. https://github.com/saxix/django-concurrency/issues Thanks, Collin On Friday, November 21, 2014 6:16:14 PM UTC-5, ia...@me.com wrote: > > Hey everyone, > > One last try. I've given up on

Re: Form doesn't show in HTML template

2014-11-24 Thread Collin Anderson
Hi, Are the form fields in the html source (view source) and then getting hidden using CSS or removed using JavaScript? What does this output? {% if form %}Yes, there's a form{% else %}No form{% endif %} Collin On Friday, November 21, 2014 11:33:16 AM UTC-5, Some Developer wrote: > > On

Re: Web and mobile app with Django? Kivy? sth else?

2014-11-24 Thread Collin Anderson
Hi, Django can do all of those things except the native android/ios apps. Django specializes in websites and especially helpful for handling things like logging in, querying a database, processing form input, and generating html. Here are some ways Django can help with your situation: You

Meta inheritance across abstract base class

2014-11-24 Thread Torsten Bronger
Hallöchen! I have the following model structure: class A(models.Model): ... class Meta: ordering = ["timestamp"] get_latest_by = "timestamp" class B(A): class Meta(A.Meta): abstract = True class C(B): ... Then,

Unable to open URL in new tab from ajax hit

2014-11-24 Thread swapnil srivastava
Ext.Ajax.request({ url: 'generate_birt/', }); in view.py def generate_birt(request): url = 'http://10.2.114.2:8080/birt/frameset?__report=report/test.rptdesign=my+parameter&__format=pdf' return HttpResponseRedirect(url,mimetype='pdf') following error throws XMLHttpRequest cannot

Re: Using Sum() for a models method inside a Query

2014-11-24 Thread monoBOT
You can also do that using the ORM instead of SQL, just instead of doing the calls on the instanced model use a manager and do the calls on all the objects in the database, something like this: class Objectmanager(models.Manager): def SumAB(self): return sum([(obj.a + obj.b) for obj

Re: Using Sum() for a models method inside a Query

2014-11-24 Thread Jorge Andrés Vergara Ebratt
Thanks, the best bet is the raw query, because I actually need the Sum of the method result for all the instances in the query... 2014-11-24 3:52 GMT-05:00 monoBOT : > You can create a model method (with no parameter) that can solve that, so > you can call it from the

Re: Obtaining content from Git

2014-11-24 Thread martin f krafft
also sprach Russell Keith-Magee [2014-11-24 11:38 +0100]: > Perhaps I wasn't clear. No, you were. I am just pushing back a little bit because I come from another angle and I greatly appreciate your explanations in helping me understand the Django way of thinking. So in

Re: models.py question for setting up multiple sql entries for 1 master sql entry

2014-11-24 Thread François Schiettecatte
Hi You should consider having a single Barcodeid table and have a one-to-many relationship between the Hardwareid and Barcodeid. François > On Nov 24, 2014, at 1:43 AM, Bovine Devine wrote: > > Hello, > > I am creating hardware database webapp in django and I have a

Re: Obtaining content from Git

2014-11-24 Thread martin f krafft
also sprach Tim Chase [2014-11-24 11:19 +0100]: > urlpatterns = patterns('', > url(r'^blob/([0-9a-f]{40})/$', 'myapp.views.render_blob', ...), > ) … this is straight-forward, thanks. I'd probably try not to expose the SHAs to the user but request from

Re: Obtaining content from Git

2014-11-24 Thread Russell Keith-Magee
On Mon, Nov 24, 2014 at 5:06 PM, martin f krafft wrote: > also sprach Russell Keith-Magee [2014-11-24 > 07:16 +0100]: > > The right place is in the view. > […] > > If you want to do "interesting" things like retrieve a specific > > file version,

Re: Obtaining content from Git

2014-11-24 Thread Tim Chase
On 2014-11-24 10:06, martin f krafft wrote: > It could come from Git! After all, Git is really a database by > itself, just like the filesystem could be viewed as a database. [snip] > Furthermore, I'd actually like to post-process the data. The Git > repo would contain reStructuredText files and

Re: Obtaining content from Git

2014-11-24 Thread martin f krafft
also sprach Russell Keith-Magee [2014-11-24 07:16 +0100]: > The right place is in the view. […] > If you want to do "interesting" things like retrieve a specific > file version, you're not going to be able to use the storage API, > because most raw Interesting

Re: Using Sum() for a models method inside a Query

2014-11-24 Thread monoBOT
You can create a model method (with no parameter) that can solve that, so you can call it from the templates. something like: class MyObject(models.Model): a = models.IntegerField() b = models.Integerfield() def miOperation(self): return self.a + self.b def