Re: This site can’t be reached 127.0.0.1 refused to connect.

2018-06-05 Thread Jamie Roberts
Hi, This is from memory and may not be your problem but ... I had to add 127.0.0.1 to ALLOWED_USERS in settings.py Sent from my iPhone > On 5 Jun 2018, at 16:38, Avitab Ayan Sarmah wrote: > > While going through the turolal 7 of the django project, couldn't connect to > the url.Please

Re: Django Channels - Throttling/Traffic Management?

2017-08-08 Thread Jamie Counsell
at I'm hoping will see the light of day in production, but would hate to get version-locked if the rewrite changes too much. Thank you! And keep up the great work. Jamie On Tuesday, 8 August 2017 15:45:03 UTC-4, Andrew Godwin wrote: > > Hi Jamie, > > At the moment Channels has qui

Django Channels - Throttling/Traffic Management?

2017-08-08 Thread Jamie Counsell
Hey folks, I'm working on a Django Channels project and was wondering if there was (or was a roadmap for) features that could help us control load issues at the application level. I asked on StackOverflow

Channels: Sudden & Mysterious 400 Bad Request

2017-07-07 Thread jamie . bliss
I'm using Nginx -> Daphne -> Redis -> manage.py runworker. Nginx and daphne are both producing a 400 Bad Request to simple GET requests. I'm not seeing the request in the worker log (-v 3). Redis answers to `redis-cli ping`. Daphne logs look like it just served the request normally. Worker logs

Re: Django can't find database

2016-10-22 Thread Jamie Lawrence
> On Oct 22, 2016, at 11:35 AM, Gary Roach wrote: > When I try to migrate, I get the following error: > >> psycopg2.OperationalError: FATAL: database "archivedb" does not exist > What's happening here? Are you certain the ‘archivedb’ database actually exists?

Prevent Django from prepending site domain to beginning of feed links

2016-09-09 Thread Jamie
I'm creating an RSS feed that contains application links for URLs, but Django is prepending the domain name to any link that doesn't begin with *http*. So, links that should be *appname://* are being generated as *http://domain.comappname...* How do I prevent Django from trying to correct

Re: Turn off migrations completely in Django 1.7

2015-04-27 Thread Jamie Lawrence
On Apr 27, 2015, at 7:01 PM, Mike Dewhirst wrote: > >> On 27/04/2015 9:54 AM, marcin.j.no...@gmail.com wrote: >> So what about that? I'm also interested in disabling migrations. > > Would it suffice to have all your models specify "managed = False" in the > Meta class? >

Re: Thinking about EAV database model for flexibility. How (in)compatible is it with the django model?

2014-12-22 Thread Jamie Lawrence
> >> On Tuesday, December 16, 2014 11:24:12 AM UTC+1, Felipe Faraggi wrote: >> Thanks for your responses Jamie and Erik, >> >> We've since reconsidered and will in fact, be creating a standard relational >> structure. >> >> Again, thanks for your

Re: Thinking about EAV database model for flexibility. How (in)compatible is it with the django model?

2014-12-15 Thread Jamie Lawrence
Just to add to Erik's very good advice on (not) using EAV, another thing to keep in mind is that the downsides of EAV tend to manifest after your app is hosting a substantial amount of data, at which point the exercise of sanitizing it in order to port it to a saner model can be *excruciating*.

Re: linux or windows

2013-05-31 Thread Jamie Lawrence
I don't count this as 'voluntary', except in the sense that I wasn't forced at the point of a gun, but I can say that it is possible to back a Django site with SQL Server. I do not recommend it, and the details vary based on which particular stack you are running. My recommendations are:

Re: How can I find and clean an user's session from an user's id?

2013-01-21 Thread Jamie Lawrence
It is ok. Really. In llvikgiimn. In. Go g -j I hurry. -- Sent from a phone, please excuse typos and terseness. On Jan 21, 2013, at 4:10 PM, Nikolas Stevenson-Molnar wrote: > I took a quick peek at the sessions implementation and it doesn't look > like this is

Re: index_together...shouldn't indexes be created AFTER populating the table?

2012-11-14 Thread Jamie Lawrence
Keep in mind that whatever RDBMS you are using is completely separate from your application. You can alter it out from under the app in any way you see fit. The code offers some convenience methods for generating things, but that doesn't tie the two together more than an expectation on the

Re: Setting an unusable password on an existing user

2012-09-22 Thread Jamie Lawrence
This isn't that rare - it is a common UX requirement. Set the value to something that cannot hash to any input. Depending on your setup, '0' could work, or any other nonsense value. If you have a strict DB schema, IIRC, there are some magic values that SHA will never generate, but I'd have to

Re: Difficulties using generic views (Tutorial 4, Django 1.4)

2012-08-16 Thread Jamie Re
I have had to reboot my VM so it recognizes new files, that could have been your problem? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/Q3NRvTo_Jr0J. To

Re: Problems with {% url %} in templates

2012-03-29 Thread Jamie Lawrence
On Mar 29, 2012, at 12:59 PM, Alasdair Nicol wrote: > Hi Jamie, > Don't include the (.*)$ in the regex for the include. The documented pattern > [1] for the include is > >(r'^d/events/', include('myproject.events.urls')), Ah, thank you, that was it. (I do need sleep - don'

Problems with {% url %} in templates

2012-03-29 Thread Jamie Lawrence
I'm very confused… this has worked fine in the past. Django 1.3.1 In myproject/urls.py: urlpatterns = patterns('', (r'^d/events/(.*)$', include('myproject.events.urls')), […] in myproject/events/urls.py : urlpatterns = patterns('myproject.events.views', url(r'^add/$', 'add_view',

Re: Automated Processes

2012-03-02 Thread Jamie Lawrence
On Mar 2, 2012, at 12:10 PM, Scott Macri wrote: > I'm trying to figure out the best way to create an automated in a > python/django web application. My intention is to send an email > message in the future based on the given future date/time. What is > the best approach to do this? > > I was

Display ForeignKey label rather than ID in a CharField

2010-11-19 Thread Jamie Pittock
I have to override the default display of a foreignkey field in a form and instead display it as a CharField. Currently it displays the selection's ID but I need to display the label instead To be clear, the select option would be the default display for the ForeignKey. At the moment after I've

BrightonPy event: The Why and How of Automated Testing with Python and Django

2010-10-20 Thread Jamie Matthews
Hi all, I thought our next BrightonPy meeting might be of interest to this list: The Why and How of Automated Testing with Python and Django Jim Purbrick, Tuesday October 26, 2010, 19:30 at The Skiff http://brightonpy.org/meetings/2010-10-26/ Why do we write tests? How do we write them? What

private models and inheriting model permission?

2010-07-27 Thread Jamie
ave done the easy stuff. I have a Project model and a Task model. At the moment any new task can be created against any project (no security in place). Where should I start? I've looked around for a app which does this but haven't had any luck. Perhaps i'm not using the correct keywords to find the ri

Re: View assistance

2009-11-25 Thread Jamie Pittock
Thanks again. On Nov 25, 4:00 pm, Javier Guerra <jav...@guerrag.com> wrote: > On Wed, Nov 25, 2009 at 10:42 AM, Jamie Pittock <ja...@erskinedesign.com> > wrote: > > Rolando, thanks.  Both your and Javier's solutions work.  Do they both > > do the same think in diff

Re: View assistance

2009-11-25 Thread Jamie Pittock
Rolando, thanks. Both your and Javier's solutions work. Do they both do the same think in different ways? Is one way better than the other in any way? On Nov 25, 3:40 pm, Jamie Pittock <ja...@erskinedesign.com> wrote: > Well that was ridiculously easy!  Thanks very much for responding

Re: View assistance

2009-11-25 Thread Jamie Pittock
Well that was ridiculously easy! Thanks very much for responding Javier. On Nov 25, 3:25 pm, Javier Guerra <jav...@guerrag.com> wrote: > On Wed, Nov 25, 2009 at 9:43 AM, Jamie Pittock <ja...@erskinedesign.com> > wrote: > > This is working as expected.  Howev

View assistance

2009-11-25 Thread Jamie Pittock
I have two models, Project and Task. They are related via a foreign key in the task model. The view that displays a task is below... def task_detail(request, project_slug, task_id): project = get_object_or_404(Project, slug=project_slug) return object_detail(

Re: IDE for Django and Ext JS

2009-07-28 Thread Jamie
On the mac, there's textmate (an editor, not an IDE), which has a language plugin architecture, and a couple of django-specific plugins that do syntax highlighting, one for django apps, one for django templates. On Jul 28, 2:20 pm, Jonas Obrist wrote: > Maybe a good

Re: Limiting Choices of a ForeignKey with 'self'.

2009-05-14 Thread Jamie
Have you found a solution for this? I'm surprised no one has at least responded that it is or is not possible. On Apr 9, 1:09 pm, Nicky Bulthuis wrote: > Hello Django Users, > > I'm trying to learn Django as best as i can, however i've come to   > problem which i hope

Save() method doesn't update until an item has been saved twice

2009-05-14 Thread Jamie
I'm running into a problem with the save() method in which I need Django to update items in Model_B when an item from Model_A is saved. The problem is that I save Model_A but Model_B is not updated. However, if I save Model_A a second time (without changing anything) then Model_B is updated.

Field value from queryset as extra_context

2009-05-10 Thread Jamie Pittock
Please excuse the subject if it makes no sense. Simplified, I have two models Pub and Town. Pub has a ForeignKey field called 'town'. I'm using the generic object_list view to display all pubs in a particular town (based on a town slug in the url). Something like this... def

Re: Wrapping object_detail generic view in another view

2009-05-09 Thread Jamie Pittock
Thanks George. On May 7, 9:32 pm, George Song <geo...@damacy.net> wrote: > On 5/7/2009 1:01 PM, Jamie Pittock wrote: > > > Basically, am I doing things right, and if so which is the best > > solution from the above? > > Yup, you are doing things

Wrapping object_detail generic view in another view

2009-05-07 Thread Jamie Pittock
') Basically, am I doing things right, and if so which is the best solution from the above? Thanks in advance, Jamie --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this g

Re: Limiting Choices of a ForeignKey with 'self'.

2009-04-28 Thread Jamie
I have the same problem and am hoping that a solution to one will work for both of us. In my case, I am working on an online newspaper site. My models for this particular app are Issue and Article. Articles are assigned to Issues so that they can all be published when the issue is published. That

Re: Converting from local DST to UTC

2009-04-15 Thread Jamie
On Apr 14, 9:34 pm, Brian Neal wrote: > This is how I am doing it (I'm also integrating with Google Calendar): > tz = pytz.timezone(tz_name)  # create timezone > local = tz.localize(d)  # make naive datetime localized > zulu = local.astimezone(FixedOffset(0))  # convert to UTC

Converting from local DST to UTC

2009-04-14 Thread Jamie
I am working on an app that will export a calendar event to Google Calendar. Google Calendar requires that event datetimes be in UTC format. I can make the conversion from local (America/New_York) to UTC using pytz, but the time is off by an hour due to daylight savings time (Python thinks the

Re: limit_choices_to using a dynamic model attribute

2009-03-30 Thread Jamie
': datetime.date.today } On Mar 30, 1:53 pm, Jamie <utkja...@gmail.com> wrote: > Is it possible to use limit_choices_to with a dynamic model attribute? > > Some background: I am using a StaffMember model for content creators > who do not have user accounts. Each staff member h

limit_choices_to using a dynamic model attribute

2009-03-30 Thread Jamie
Is it possible to use limit_choices_to with a dynamic model attribute? Some background: I am using a StaffMember model for content creators who do not have user accounts. Each staff member has a start and end date and the model has a dynamic attribute called 'is_active' that compares the

Re: Count filtered by status

2009-03-21 Thread Jamie Pittock
Malcolm, thanks very much for this. I don't have time to properly look at this until Monday but I wanted to at least acknowledge before then my appreciation of your replies. I'll no doubt be back with either more thanks or more questions. On Mar 21, 4:55 am, Malcolm Tredinnick

Count filtered by status

2009-03-20 Thread Jamie Pittock
? Many thanks in advance. Jamie --~--~-~--~~~---~--~~ 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 from this group,

Re: get_object_or_404 and foreignkey

2009-03-08 Thread Jamie Pittock
Thanks again. I'm still new to all this. On Mar 7, 9:37 pm, Daniel Roseman <roseman.dan...@googlemail.com> wrote: > On Mar 7, 8:21 pm, Jamie Pittock <smallb...@gmail.com> wrote: > > > Thanks Daniel.  Yeah it's just a way of getting the county so I'll try > >

Re: get_object_or_404 and foreignkey

2009-03-07 Thread Jamie Pittock
Thanks Daniel. Yeah it's just a way of getting the county so I'll try your second option. Could you possibly point me to the docs that explain the double underscore? On Mar 7, 7:39 pm, Daniel Roseman <roseman.dan...@googlemail.com> wrote: > On Mar 7, 5:42 pm, Jamie Pittock <smallb.

Re: get_object_or_404 and foreignkey

2009-03-07 Thread Jamie Pittock
Sorry, the correct url would be domain.com/country/county/ On Mar 7, 5:42 pm, Jamie Pittock <smallb...@gmail.com> wrote: > Hi, > > I have an app with countries and counties.  The simplified model is: > > class Country(models.Model): >         name = models.CharField(max_l

get_object_or_404 and foreignkey

2009-03-07 Thread Jamie Pittock
Hi, I have an app with countries and counties. The simplified model is: class Country(models.Model): name = models.CharField(max_length=50) slug = models.SlugField() def __unicode__(self): return self.name class County(models.Model): name =

Populating list_display with data from two models?

2009-02-26 Thread Jamie Richard Wilson
I've extended the User model with a UserPofile model and have inline editing working. Setup is something like this: class UserProfile(models.Model): user = models.ForeignKey( User, unique=True, ) position = models.ForeignKey(Position) ...etc... I need a

Re: InlineModelAdmin objects question

2009-02-25 Thread Jamie Richard Wilson
This might answer your question: http://groups.google.com/group/django-developers/browse_thread/thread/45bce29f331acb5e Kevin Coyner wrote: > I am using the Auth system in django and have a separate app People > that I'm using to keep more detailed info (i.e. address, phone, etc) > on my

Admin interface for user management

2009-02-25 Thread Jamie Richard Wilson
I'm working on an online newsroom project and have a need to extend the user profile beyond the included basics. I also need to grant permissions to allow the online editorial staff to create new user accounts to associate with new content if the account doesn't already exist. In most cases there

Re: Where to install additional libraries?

2008-06-23 Thread Jamie Pittock
mber   > reading a lot of complaints on this issue so... be careful! > > Eric > > On Jun 23, 2008, at 10:10 PM, Jamie Pittock wrote: > > > > > Thank you Gordon (and Joshua) that's really useful. > > > I think I'll use the site-packages folder then.  After doin

Re: Where to install additional libraries?

2008-06-23 Thread Jamie Pittock
/Python.framework/Versions/2.4/lib/python2.4/ (currently being used) This is probably due in part to upgrading to Leopard and it changing the location, maybe? I presume again it doesn't matter which of these I use aslong as I'm consistent? On Jun 23, 2:23 pm, gordyt <[EMAIL PROTECTED]> wrote: &

Where to install additional libraries?

2008-06-23 Thread Jamie Pittock
are they supposed to go? Installation instructions always say download the the files and run 'python setup.py install' but they never state where to put the files. Is there a specific place they need to go...or if not specific, is there a conventional place? Thanks in advance. Jamie

Tumblelog - Generic table or combine queries or...?

2008-02-17 Thread Jamie Pittock
Hi, I'm wanting to create a "tumblelog" of sorts made up of content from several different models within my site and I'm looking for suggestions on the best way of accomplishing it. The two ideas I have so far are: 1. Combine the results from different queries into one (as already discussed

Adding own auth methods

2007-07-07 Thread Jamie Pittock
Hi all, I'm trying to figure out whether I can use Django's built in auth system for my needs. I need to limit access to certain areas depending on whether the user is member of particular groups. Not groups as in whether they area admins, moderators etc, but more in a social network type

Re: One-to-one relationship (model inheritance) or generic relations?

2007-06-29 Thread Jamie Pittock
, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On 6/28/07, Jamie Pittock <[EMAIL PROTECTED]> wrote: > > > > > I don't want to code myself into a corner, so when I start looking at > > features such as allowing users to search all venues would I be

One-to-one relationship (model inheritance) or generic relations?

2007-06-28 Thread Jamie Pittock
I'm still new to Django so bear with me ;) I have models for different types of venues (Bars, Clubs, etc). Because for example, I'd like to use one Rating model across all these venue Models I'd presumed that I'd need a parent Venue Model, using some kind of one-to-one relationship (until model

Re: Subclasses or OneToOne relationship

2007-04-21 Thread Jamie Pittock
OK thanks very much for the reply Malcolm. On Apr 21, 3:47 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Fri, 2007-04-20 at 20:00 +0000, Jamie Pittock wrote: > > Hi all, > > > I'm currently planning my first Django application and after a quick > > s

Subclasses or OneToOne relationship

2007-04-20 Thread Jamie Pittock
thread? Is a OnetoOneField the best option, or ,given that (after another quick search) it seems Model Inheritance may well be back in the not too distant future, is there another option that would make an easy transition once it is supported? Any advice much appreciated. Jamie

Why is IPAddressField a char(15) instead of an int?

2006-12-17 Thread Jamie
% faster to scan for an IP address when it's an integer and not a string on a non-indexed column. Thanks, Jamie --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Getting primary key value from FormFieldCollectionWrapper

2006-11-15 Thread Jamie Norrish
for that name. The name admin form has the name part objects as edit_inline. There needs also to be a link from each name page to the change page for the entity it is associated with. Am I going about this the right way? Jamie --~--~-~--~~~---~--~~ You received

Re: Add to Favourites type feature?

2006-11-11 Thread Jamie Pittock
That's great. Thanks alot. --~--~-~--~~~---~--~~ 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 from this group, send email to

Re: Add to Favourites type feature?

2006-11-11 Thread Jamie Pittock
Sorry, I didn't mean add to your browser favourites. I meant more of a feature built into a website where users can mark an article/entry as a "favourite" to store or read later. that kind of thing. Russell Keith-Magee wrote: > On 11/10/06, Jamie Pittock <[EMAIL PROTECTED]>

Add to Favourites type feature?

2006-11-10 Thread Jamie Pittock
might help? Any help appreciated. Jamie --~--~-~--~~~---~--~~ 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 from this group,

Ordering by str

2006-11-10 Thread Jamie Pittock
I'm refering again to using this code from the cookbook: http://code.djangoproject.com/wiki/CookBookCategoryDataModelPostMagic My entry class has an 'assoc_cats' field (assoc_cats = models.ManyToManyField(Category)). How can I order the categories to match the __str__ (Home :: Garden) rather

Re: Child Category Views

2006-11-09 Thread Jamie Pittock
Sorry, I missed those last two replies as I was replying myself. I'll take a look now and check I'm doing things right. Many thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: Child Category Views

2006-11-09 Thread Jamie Pittock
great. I'm sure it's not perfect yet but I ended up with this: def entries_by_category(request, slug, childslug=None): if childslug is not None: slug = childslug category = get_object_or_404(Category, slug=slug) entry_list_by_category =

Re: Child Category Views

2006-11-09 Thread Jamie Pittock
Sorry to reply to myself so quickly. After a bit of refactoring my two views look like this: def entries_by_category(request, slug): category = get_object_or_404(Category, slug=slug) entry_list_by_category = category.entry_set.order_by('-pub_date', 'title') return

Child Category Views

2006-11-09 Thread Jamie Pittock
HttpResponse(t.render(c)) And then as I say, if there's also a child category in the url I'm basically replicating that view with def entries_by_child_category(request, slug, childslug): I'm sure there's a much better way of doing this using just one view. Can anyone give me a pointer? Jamie

Re: Trouble with default values in model w/ sqlite

2006-06-23 Thread Jamie Scheinblum
if not getattr(self, field.name): setattr(self, field.name, field.get_default())super(User, self).save() I really don't like this solution, but it works, and does not require any changes/patches to the django libraries.Cheers,-jOn 6/21/06, Jamie Scheinblum <[EMAIL PROTEC

Trouble with default values in model w/ sqlite

2006-06-21 Thread Jamie Scheinblum
Hi,I'm having trouble with default values in my model.  I've tried to establish what the default for a column should be when the input doesn't supply a value.  The model defaults seem to work fine when using django's python shell, but when I use either the admin interface or my own view, the

Re: recursive template calls

2006-02-07 Thread Jamie Scheinblum
that's funny. they answered how to do the tree thing, but the wiki basically says no recursion... I should look into the % recurse % keyword tho. -j On 2/7/06, Shannon -jj Behrens <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm trying to build ye ol' bulletin board application to try out > Django.