Re: Data migrations ran multiple times during deploy

2023-01-10 Thread Harris Lapiroff
Thanks, all for the responses! They're helpful, particularly: - Using a separate single service to run migrations - django-syzygy looks interesting and might also solve another issue we've been having lately trying to achieve zero-downtime deploys Best, Harris On Sunday, January 8

Data migrations ran multiple times during deploy

2023-01-06 Thread Harris Lapiroff
off a migration command simultaneously (thus all three containers saw that the migration hadn't been run yet) and Postgres didn't block any of the transactions as conflicting. How do you all avoid this? Thanks! Harris -- You received this message because you are subscribed to the Google Groups

New User Authentication Guide (:

2019-08-06 Thread Aaron Harris
Hi all, pretty excited about our new guide to Django User authentication on the Kite Blog . Nice to have a reference if authentication maybe isn't your *favorite* part of webdev. https://kite.com/blog/python/django-authentication/ -- You received this message because you are

Project Setup Checklist. Found this helpful...

2019-04-25 Thread Aaron Harris
Just curious how your project setup compares here and other resources you might suggest. Thanks!! *Easily Install Django: A Quick Guide* *Installation* Assuming you have Python setup with pip – installation is simple. This will install Django along with a useful command that will help you get

Re: a question about django admin and language

2016-02-26 Thread Will Harris
Hi Paul, If you want the admin site to behave differently than the main site, you could consider running two instances, one with the i18n activated for the main site, and one for admin users with it disabled. In production, from a security standpoint, it's a good idea to have the admin site

Re: Debugging DJango app on production for High CPU Usage

2016-02-24 Thread Will Harris
Hey Web Architect, I guess you never got that DB dump running in development? ;-) Why don't you run some profiling middleware to see if you can some traces of the production system? Or how about New Relic or some such? That's pretty good at helping to identify problems spots in your stack.

Re: Handling cookies that contain illegal values

2016-02-05 Thread Will Harris
issue can be fixed without cause security problems > but I'm not sure. Please follow > https://code.djangoproject.com/ticket/26158 and related Python tickets. > > On Friday, February 5, 2016 at 3:13:14 AM UTC-5, Will Harris wrote: >> >> Hey Daniel, >> >> Tha

Re: Handling cookies that contain illegal values

2016-02-05 Thread Will Harris
Hey Daniel, Thanks for the reply. Unfortunately doing this in a custom middleware is not an option, as the this processing needs to take place at a very low level, at the point where the Request object is being built. By the time the request is passed in to the middleware layers for

Handling cookies that contain illegal values

2016-02-04 Thread William Harris
I recently ran into this problem on a production server, and it was causing my users to lose their sessions. Many browsers will happily post UTF-8 encoded data in cookie strings. This will result in cookie data such as this, which I captured from my nginx log:

Registering a stand-alone test app

2015-02-10 Thread Nicole Harris
Hi All, I have an app in my root folder named 'bdd'. It contains an (empty) models.py as well as some files for running behave tests. I have added this app to INSTALLED_APPS in my settings.py so that I can run the tests with the Django Behave

Validation on two user foreign keys

2015-01-28 Thread Nicole Harris
Hi All, I have a model called 'Friendship' that includes two foreign keys to User. One is the 'initiator' of the Friendship, the other the 'recipient'. I want to make sure the Friendship only exists once regardless of who is the recipient and who is the initiator. Any thoughts on the best way

Accessing Django test client in setUpClass

2015-01-22 Thread Nicole Harris
I just posted this on Stack Overflow and then realised I might have more luck here. Basically, I'd like to know if I can access self.client inside setUpClass(cls) when setting up a Django test: http://stackoverflow.com/questions/28084683/accessing-django-test-client-in-setupclass If anybody

Re: Can't enter admin site

2013-04-19 Thread Jonathan Harris
Hello Alex Just to see how far you have gone: Have you uncommented 'django.contrib.admin' in settings.py and run syncdb? Also, have you uncommented the relevant lines in urls.py? On Fri, Apr 19, 2013 at 4:17 PM, Alex Lee wrote: > Hi guys, I just started the second

re: Displaying And Selecting Tags in Admin Site

2013-03-28 Thread Jonathan Harris
Hi All New to Django and coding in general, so sorry if this has been covered - I did search the group postings, have read the documentation, trawled the net etc, but couldn't find anything directly relevant I have been following various tutorials (django homepage, youtube etc) for how to start

Re: load-on-startup equivalent in django?

2011-10-21 Thread Martyn Harris
You could use SimpleXMLRPCServer to create a client in your view.py with a function to call the server side, and pass the information over when done. See: http://docs.python.org/library/simplexmlrpcserver.html You'd need to have the server side running the whole time in the background, if you

View to serve dumpdata output

2010-09-14 Thread David Somers Harris
Is it possible to write a view which serves the JSON output of dumpdata? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to

Re: ModelName.objects.none().update() makes changes to db

2010-09-11 Thread David Somers Harris
Ah! I'm still on Ubuntu's release version. Thanks Bruno! -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to

Re: ModelName.objects.none().update() makes changes to db

2010-09-10 Thread David Somers Harris
I haven't set a custom manager as far as I'm aware. Here is what happens to me: >>> from cube.books.models import Book >>> no_books = Book.objects.none() >>> Book.objects.all().count() 1667 >>> Book.objects.filter(status='O').count() 1 >>> no_books.update(status='O') 1667 >>>

Re: Fields validating as optional

2010-06-22 Thread Dan Harris
a model, blank=True inside the models is transformed into required=False for the form. class MyModelForm(forms.ModelForm): class Meta: model = MyModel Hope this helps! Dan Harris dih0...@gmail.com On Jun 22, 4:11 pm, Jonathan Hayward <christos.jonathan.hayw...@gmail.com> wrote:

Re: Question regarding subdomains of a single project

2010-06-22 Thread Dan Harris
be looking for. Cheers, Dan Harris dih0...@gmail.com On Jun 22, 10:59 am, Venkatraman S <venka...@gmail.com> wrote: > On Tue, Jun 22, 2010 at 8:06 PM, M Rotch <planetra...@gmail.com> wrote: > > I'm setting up a website with multiple subdomains, and one thing I > > notice

Re: modeling a book repository

2010-06-15 Thread Dan Harris
the super class delete. This way when the cascades go through it doesn't have links to next or previous chapters and not everything is deleted. Hope this helps, Dan Harris dih0...@gmail.com On Jun 15, 12:11 pm, Tim Arnold <a_j...@bellsouth.net> wrote: > Hi, > I have a model for a Book t

Re: ordering fields in admin form

2010-06-13 Thread Dan Harris
# replace with your ordering method return db_field.formfield(**kwargs) return super(MyModelAdmin, self).formfield_for_foreignkey(db_field, request, **kwargs) Hope this helps, Dan Harris dih0...@gmail.com On Jun 13, 8:53 am, backdoc <ali...@crotchett.com> wrote: > This onl

Re: Controlling access to objects

2010-06-12 Thread Dan Harris
This article might help you out: http://djangoadvent.com/1.2/object-permissions/ Cheers, Dan Harris dih0...@gmail.com On Jun 11, 11:46 pm, Wiiboy <jordon...@gmail.com> wrote: > Hi guys, > I don't know whether the built-in permissions system would be > appropriate here, but I

Re: Simplification of a DB "query"

2010-06-11 Thread Dan Harris
last meeting before 3 or start betweeen 3pm and 5pm" MyModel.objects.filter(latest_meeting | after_3_and_before_5) Not sure if this is what you're looking for or if it's even right :) Dan Harris dih0...@gmail.com On Jun 11, 4:28 pm, Cesar Devera <cesardev...@gmail.com> wrote: > I'm

Re: Model named FOOD_DES shows as "foo d_des" in admin

2010-06-11 Thread Dan Harris
the space. See: http://docs.djangoproject.com/en/1.2/ref/models/options/#verbose-name for more details. Cheers, Dan Harris dih0...@gmail.com On Jun 11, 2:38 pm, creecode <creec...@gmail.com> wrote: > Hello Dan, > > Thanks for the info.  verbose_name does take care of the display &

Re: Model named FOOD_DES shows as "foo d_des" in admin

2010-06-11 Thread Dan Harris
the "db_table" meta option. Please refer to the docs at: http://docs.djangoproject.com/en/1.2/ref/models/options/#model-meta-options for more information. Cheers, Dan Harris dih0...@gmail.com On Jun 11, 1:06 pm, creecode <creec...@gmail.com> wrote: > Hello all, > > I

Re: error: unsupported operand type(s) for *: 'Decimal' and 'float'

2010-06-11 Thread Dan Harris
That looks ok from a code readability point of view, however you will still need to cast the form values to float or cast the float values (i.e. pow(2,2) and pow(2*math.pi*v,2) to Decimals otherwise will you will get an UnsupportedOperation exception. Dan Harris dih0...@gmail.com On Jun 11, 6:58

Re: Writing your first Django app tutorial, part 3 question

2010-06-10 Thread Dan Harris
Looks like you haven't created any polls yet, at least not one with an ID of 5. Go into the admin section described in part 2 of the tutorial and make a few polls. Once you've create some you should see polls of IDs 1,2,3 etc show up and the URLs should start to work. Dan Harris dih0...@gmail.com

Re: not able to recognize non-default python files in app + project directory

2010-06-10 Thread Dan Harris
models.py file only. If you make a models directory, you have to import all models you want Django to recognize into your __init__.py file within the models directory. Hopefully this makes sense, if not I can try to be more clear. Dan Harris dih0...@gmail.com On Jun 10, 4:46 pm, rahul jain <

Re: Writing your first Django app tutorial, part 3 question

2010-06-10 Thread Dan Harris
first-view part of the documentation for more. Cheers, Dan Harris dih0...@gmail.com On Jun 10, 6:30 pm, albert kao <albertk...@gmail.com> wrote: > I try the "Writing your first Django app tutorial, part 3" (http:// > docs.djangoproject.com/en/dev/intro/tutorial03/#intro-tuto

Re: error: unsupported operand type(s) for *: 'Decimal' and 'float'

2010-06-10 Thread Dan Harris
} As a readability thing, you might want to split that giant line of code into a few separate calculations, but that's just an idea! Cheers, Dan Harris dih0...@gmail.com On Jun 10, 3:33 pm, Dan Harris <dih0...@gmail.com> wrote: > The error looks like you are attempting to multiply

Re: select_related() depth when specifying fields

2010-06-10 Thread Dan Harris
ead the docs, it may not be correct :) Cheers, Dan Harris dih0...@gmail.com On Jun 10, 4:54 pm, Michael Hrivnak <mhriv...@americanri.com> wrote: > I read that myself.  I asked the question because it goes on to state that you > can specify down-stream models like this: > > query.select_re

Re: annotate with query set for distinct values

2010-06-10 Thread Dan Harris
n a list of the form: [{'name__count': 2, 'name': u''}, {'name__count': 1, 'name': u'bbb'}] Hope this helps! Dan Harris dih0...@gmail.com On Jun 10, 5:01 pm, SlafS <slaf...@gmail.com> wrote: > Hi there! > I have a question. If i have a model with some fields (let's say all &g

Re: annotate with query set for distinct values

2010-06-10 Thread Dan Harris
over like: {% for r in res %} {{ r.name }} - {{ r.name__count}} {% endfor %} however there may be duplicated {{ r.name }} Dan Harris dih0...@gmail.com On Jun 10, 5:24 pm, SlafS <slaf...@gmail.com> wrote: > Thanks. > > I've already tried that but this isn't quite what i'm looking for.

Re: select_related() depth when specifying fields

2010-06-10 Thread Dan Harris
a foreign keys with a depth of two. Hope this helps, Dan Harris dih0...@gmail.com On Jun 10, 3:19 pm, Michael Hrivnak <mhriv...@americanri.com> wrote: > If I use select_related() on a queryset and specify some attribute names, will > it follow those relationships as far as possib

Re: error: unsupported operand type(s) for *: 'Decimal' and 'float'

2010-06-10 Thread Dan Harris
an convert the decimal returned by the form into a float, or convert the floats into decimals and do your math. Converting to decimal is probably more precise. Hope this helps, Dan Harris dih0...@gmail.com On Jun 10, 3:22 pm, Waleria <waleriantu...@gmail.com> wrote: > Hello.. > >

Re: Need subset on Admin interface

2010-06-10 Thread Dan Harris
Sounds about right, glad it's working for you! Dan Harris dih0...@gmail.com On Jun 10, 12:41 pm, onorua <ono...@gmail.com> wrote: > I did following: > add Media JS for User model (jquery and my own script follows), with > FireBug get the names of HTML id of the elemets I

Re: assigning data based on a comparison between two tables

2010-06-08 Thread Dan Harris
e than 1 match found") candidates[0].incumbent = True candidates[0].save() Something like that might work for you assuming that the models and stuff are similar. Also, this code is just off the top of my head, so who knows if it will actually work :) Cheers, Dan Harris dih0...@gmail.com

Re: django's default id (auto primary key) sorting

2010-06-08 Thread Dan Harris
the comments to toggle ascending vs descending. Hope this helps, Dan Harris dih0...@gmail.com On Jun 5, 9:16 pm, rahul jain <jainwolver...@gmail.com> wrote: > Hi Django, > > I tried lots of different ways to get my ids listed in ascending order > (1 - x). But it always d

Re: i can't import newforms(newbie)

2010-06-08 Thread Dan Harris
ou reading? If they are the official Django tutorials that is most likely a bug in the documentation. The documentation on the deprecation of newforms in favor of form is in the Django 1.0 release notes at: http://docs.djangoproject.com/en/dev/releases/1.0/ Cheers, Dan Harris dih0...@gmail.com O

Re: Model inheritance and simple access

2010-06-08 Thread Dan Harris
uot;might" work. And obviously if you have like 5 child classes, this gets ugly very quickly. Dan Harris dih0...@gmail.com On Jun 8, 3:27 pm, John M <retireonc...@gmail.com> wrote: > Hmm, that doesn't really get me what I want, it just caches the > related child objects in one SQL qu

Re: Need subset on Admin interface

2010-06-08 Thread Dan Harris
ModelAdmin. You of course don't have to use JQuery, but it is included by default in the admin and is quite popular. Dan Harris dih0...@gmail.com On Jun 8, 3:17 pm, onorua <ono...@gmail.com> wrote: > Hello, thank you for your reply! > That's really what I've looked for, some way to pre

Re: setting DEBUG=False disables flatpages

2010-06-08 Thread Dan Harris
You need to have a 500.html and a 404.html defined when DEBUG=False. See: http://code.djangoproject.com/ticket/3335 Hope this helps! Dan Harris dih0...@gmail.com On Jun 8, 2:56 pm, adrian <adrian.imm...@gmail.com> wrote: > tracked the problem more down... > > the problem appe

Re: Need subset on Admin interface

2010-06-08 Thread Dan Harris
ef/contrib/admin/#modeladmin-methods) Hope this helps! Dan Harris dih0...@gmail.com On Jun 8, 10:04 am, onorua <ono...@gmail.com> wrote: > I have > > class User(models.Model): >     Switch = models.ForeignKey(Switch, related_name='SwitchUsers') >     Port = models.Fo

Re: Multiple Django versions on one server?

2010-05-03 Thread Dan Harris
virtualenv can be used with mod_wsgi, we are doing so on our production servers. see http://code.google.com/p/modwsgi/wiki/VirtualEnvironments for more information Cheers, Dan On May 3, 8:26 am, Stodge wrote: > I am aware of virtualenv, but can it be used with mod_wsgi. Time

Re: nested list in templates

2009-09-15 Thread Leon Harris
>From a glance at your code looks it looks like the cat reference is not being updated to the sub category and is just endlessly looping over the top level category something more along these lines may help (where 'do_menu' is an inclusion tag)

Re: how to deploy Django on the web server?

2009-08-07 Thread Dan Harris
I just wanted to give a shout out as well to webfaction. I used to use my own virtual private server for hosting django stuff, but to cut costs i switched to a webfaction account and it is pretty fantastic. Super easy to set up, if you decide to go that way just drop me and email and i'd be happy

Re: Threaded comments on django 1.1

2009-08-07 Thread Dan Harris
Have you checked out: http://code.google.com/p/django-threadedcomments/ I think it is still being updated for 1.1, but it should still work with 1.1. I haven't used it, just know of it's existence. Cheers, Dan On Aug 7, 11:44 am, Alessandro Ronchi wrote: > I

Re: Trouble getting page to work

2009-08-01 Thread Dan Harris
what error are you getting? On Aug 1, 4:41 pm, cprsystems wrote: > I'm trying to write a simple html page using Django that passes one > variable via a submit button and text line and prints it out to > another hmtl document. I'm having trouble getting it to work. Could >

Re: customization using form_class with generic views

2009-07-25 Thread Dan Harris
Assuming that you set_sub_date() function just sets the publish date to when the item was created and easy way to do this is in the model class PressRelease(models.Model): pub_date = models.DateField(auto_now_add=True) That will just set the pub_date to the current date when it is added to

Re: '_CheckLogin' object has no attribute 'objects' ??

2009-07-25 Thread Dan Harris
Looks just like you have an error in your programming, the name of your view is "Dpatas", then you attempt to later call "Dpatas.objects.filter()" as if Dpatas was a model. The _CheckLogin is coming from your use of the @login_required decorator I would imagine. Hopefully that helps, Dan On

Re: Getting data from Django ModelForm ?

2009-07-25 Thread Dan Harris
Take a peek at the Django forms documentation, specifically the ModelChoiceField and ModelMultipleChoiceField, the docs are at: http://docs.djangoproject.com/en/dev/ref/forms/fields/ These fields allow you to specify a queryset to populate your form select fields, this queryset can be the list

Re: django-registration and RegistrationFormUniqueEmail subclass

2009-07-22 Thread Dan Harris
The stuff in the brackets are the optional arguments passed to the "register" view. You can read the documentation about the view at: http://bitbucket.org/ubernostrum/django-registration/src/b360801eae96/docs/views.txt Alternatively you can check out the code as well. Cheers, Dan

Re: Pass template tags through TextField?

2009-07-22 Thread Dan Harris
That shouldn't be a problem, after all templates are just strings as are textfields. If you have a model with your textfield in it as so: class MyModel(models.Model): template = models.TextField() and you have a view which renders the template defined in the next field def

Re: Don't understand ModelForm

2009-07-21 Thread Dan Harris
Oh I gotcha now. Django model forms by default do not represent auto fields (ID's) because it wouldn't make much sense for a user to be able to edit the PK in a form. Having said that, I do understand why you need to be able to see the PK. I shown in my example, I personally prefer to represent

Re: Don't understand ModelForm

2009-07-21 Thread Dan Harris
What do you mean by having the ID "in" the form? I don't quite understand what you are trying to do. On Jul 21, 4:15 pm, mettwoch wrote: > Ok, I come back to what I wrote before. If the partner already exists > it has an id (primary-key or whatever). If it doesn't exist it has

Re: Don't understand ModelForm

2009-07-21 Thread Dan Harris
This may not be helpful but here is how I usually go about processing model forms: class Partner(models.Model): # this is your model, DB fields go in here # This is your model form class PartnerForm(forms.ModelForm): class Meta: model = Partner # This is the view that displays a

Re: Recommendations for a Django development book?

2009-07-21 Thread Dan Harris
You can always check out the free online Django book at: http://www.djangobook.com/ There is the 1.0 version (outdated) and a free web-preview of the 2nd edition available. In addition to books, the documentation for Django is pretty fantastic to learn from for a beginner. This is located at:

Re: Authenication for django.views.generic Views

2009-04-16 Thread Dan Harris
http://docs.djangoproject.com/en/dev/topics/auth/#limiting-access-to-generic-views hope this helps. Basically you write your own view which calls the generic view after you have done your authentication. On Apr 16, 11:25 am, Col Wilson wrote: > I'm using

Re: Different settings.py files for server and development

2008-11-11 Thread Doug Harris
One thing I've noticed is that some settings don't stick if I override them in local_settings.py. One key example is CACHE_BACKEND. Has anybody seen this sort of behavior? On Oct 23, 5:54 pm, felix <[EMAIL PROTECTED]> wrote: > at the very bottom of settings.py : > > from local_settings import

Re: [django] Subject in posts

2007-05-04 Thread M Harris
ect line all that much, and benefits much of the community. I concur with the idea.~please... -- Kind regards, M Harris <>< --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dj

Re: django comparison

2007-04-19 Thread M Harris
Well, that is precisely what this client wants us to do. We provide the front-end, host the machine, etc, and they are free to custom tweak. So, I am really hoping that aspect works out. Thanks folks. -- Kind regards, M Harris <>< --~--~-~--~~~---~

Re: django comparison

2007-04-18 Thread M Harris
hing else? -- Kind regards, M Harris <>< --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe

Re: django comparison

2007-04-17 Thread M Harris
On Tuesday 17 April 2007 21:12, Jay Parlar wrote: > The Django server can only handle one request at a time, so "load" > would be defined as two people trying to access the site :) Very good. Thanks guys. -- Kind re

Re: django comparison

2007-04-17 Thread M Harris
to run on Apache, etc.? Thanks folks. -- Kind regards, M Harris <>< --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send ema

django comparison

2007-04-16 Thread M Harris
someone to provide a comparison / contrast between Django and joomla please, no hype, just the facts. I am interested in the strengths and weaknesses of each. Thanks folks, Ps Please feel free to send directly to my email to cut down on list traffic. tnx -- Kind regards, M Harris

Re: IN THE NAME OF GOD

2007-04-06 Thread M Harris
r die". I believe this. I am a follower of Isa. -- Kind regards, M Harris <>< --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, s

Newbie Question

2007-03-31 Thread M Harris
I am new to the Django lists. I would like to know what types/kinds of messages frequent this list... and (as a web page creator--- hopefully with python/django) which list is more appropriate for useage, documentation, etc, questions? Is the developer list strictly for development questions

Django position in Washington D.C. - The Washington City Paper

2006-07-18 Thread Brantley Harris
The Washington City Paper needs a Web Programmer to helm the technical rebirth of the alt newsweekly on the Web. Your job would be to help rethink and rebuild the site and site architecture, publish newspaper content on the Web weekly, produce Web-based projects daily, and rebuild and update

Re: Anonymous Sessions

2005-11-18 Thread Brant Harris
Unfortunately the whole thing seemed to cause the "User tampered with cookie" error. I'm not sure why, or how, but storing the results seemed to create the erorr. O well. On 11/18/05, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 11/16/05, Brant Harris <

Anonymous Sessions

2005-11-16 Thread Brant Harris
Is it wise to store a large amount of data in an anonymous session? For instance, and most applicable to my design, if I store results of a search in a session like so: request.session['search_results'] = objects.get_list(name__icontains=query) And then I can more easily give paged results back

Custom Manipulator Save

2005-10-27 Thread Brant Harris
I can't seem to figure out how to rig my custom manipulator to save on an object. It keeps telling me: AttributeError: 'Document' object has no attribute 'id' when it saves. I'm confusored.

Re: FileUploadField in an AddManipulator

2005-09-13 Thread Brant Harris
D'oh! Thanks

Re: Help me checking this model.. (tb included)

2005-08-22 Thread Brant Harris
if there is a solid use-case for it. So if you can conjure up a model that is a. usefull, and b. cannot be implemented using the current Django ORM, then please post here, because I would be very interested in seeing it. On 8/22/05, xtian <[EMAIL PROTECTED]> wrote: > > On 8/22/05, Br

Re: Help me checking this model.. (tb included)

2005-08-22 Thread Brant Harris
> My question is.. if order matters, is there the possibility, expecially > in complex models, to reach a "deadlock" condition? > "Deadlock" really only occurs between processes or threads (http://en.wikipedia.org/wiki/Deadlock). So that is impossible here because your django model is being

Re: On referencing ForeignKey fields in meta.Admin

2005-08-19 Thread Brant Harris
It seems to me that you could simply use the rel_name, and if that's not specified than what it defaults to: the class name. But in my case ,"supervisor_id" didn't work. I had to use "user_id", and I still don't know how to get the ManyToManyField shown there.