Re: Dynamic View Selection

2017-08-11 Thread Russell Keith-Magee
Yes - but it doesn’t depend on some hidden feature of Django. It’s A Django View is just a function that accepts a request + args, and returns a response. That view can, itself, call other functions - including other functions that can act as views. So, you could write a “switch statement”

Re: Multiple User Types in Django 1.11

2017-07-24 Thread Russell Keith-Magee
Short version: You don’t. Your site may have 2 types of user - but that doesn’t mean you have 2 user models. The user model is primarily for determining authentication; authorisation can be handled separately. So - set up a user model the way you normally would; then define a Teacher model

Re: Django Virtual Environment

2017-06-12 Thread Russell Keith-Magee
Hi Yingi, Once you create a virtual environment, it is an isolated sandbox. It doesn’t have access to the world outside that sandbox. That includes Django - your virtual environment will need to have Django installed separately, even if your “main” Python 3.5 install already has Django

Re: Session Variables

2017-05-30 Thread Russell Keith-Magee
Please stop spreading FUD like this. The Django Community Code of Conduct isn’t a blunt instrument attempting to stop all dissent or disagreement. It’s there to ensure that everyone treats everyone else with respect in all communications. The fact that Daniel criticised Hungarian notation is in

Re: vs {{ form }}

2017-05-16 Thread Russell Keith-Magee
On 16 May 2017, 12:51 AM -0700, guettli , wrote: > > I know that real super heroes prefer the hard way. I don't like the hard way. > Call me wuss, pussy, weenie if you want to. That kind of language is completely unnecessary. I don’t care how frustrated you

Re: Theming

2017-04-08 Thread Russell Keith-Magee
Hi Clinton, On Sat, Apr 8, 2017 at 4:05 PM, Clinton Blackburn < clinton.blackb...@gmail.com> wrote: > Russ, > > How would this work for base/nested templates? Say my view is rendering > the potential templates ['my-theme/page.html', 'page.html'], and the > templates inherits base.html. Do I have

Re: Theming

2017-04-08 Thread Russell Keith-Magee
On Sat, Apr 8, 2017 at 1:28 AM, Clinton Blackburn < clinton.blackb...@gmail.com> wrote: > Has anyone solved site-aware theming? I have a multi-tenant site (using > sites framework) and I want to render custom templates for each site. My > current design calls for a default design, and overrides

Re: What was the rationale behind ClassBasedView.as_view()

2017-03-13 Thread Russell Keith-Magee
There’s also a summary of the various options that were considered: https://code.djangoproject.com/wiki/ClassBasedViews Yours, Russ Magee %-) On Tue, Mar 14, 2017 at 10:08 AM, Frederik Creemers < frederikcreem...@gmail.com> wrote: > That makes heaps of sense, thanks! > > On Mon, Mar 13, 2017

Re: Is there a spanish version of Two Scoops of Django?

2016-05-17 Thread Russell Keith-Magee
Hi David, On Wed, May 18, 2016 at 6:40 AM, David Alejandro Reyes Milian < davidreyesmilia...@gmail.com> wrote: > Thanks for asking. I could like to make a full Spanish translation of > this amazing book, how can I speak to Audrey or Danny? Can you help? > Danny is @pydanny on twitter; Audrey

Re: Is there a spanish version of Two Scoops of Django?

2016-05-17 Thread Russell Keith-Magee
Hi David, To the best of my knowledge, there aren’t any translations of Two Scoops available - but I’ve asked Audrey and Danny to confirm. If there is, I’ll report back and let you know. Yours, Russ Magee %-) On Tue, May 17, 2016 at 9:03 PM, David Alejandro Reyes Milian <

Re: DjangoCon US 2016

2016-03-24 Thread Russell Keith-Magee
The complimentary ticket for speakers is new for DjangoCon US this year - it’s the first year that *all* speakers have been guaranteed a free ticket. Complimentary speaker tickets have existed for DjangoCon Europe and AU in some years, and DjangoCon US has given free tickets to speakers as a

Re: Looking for Django people to attend/staff booth at PgConf.US 2016

2016-03-14 Thread Russell Keith-Magee
Hi Joshua, On Tue, Mar 15, 2016 at 2:23 AM, Joshua D. Drake wrote: > Hello, > > We at PgConf.US (a 501c3 PostgreSQL conference) are looking for a > community team to staff a community booth at PgConf.US 2016!. Here are the > details: > > PgConf.US is held in NYC and the

Re: Python Windows + Web +Mobile application: Kivy or Django

2016-02-05 Thread Russell Keith-Magee
On Fri, Feb 5, 2016 at 10:42 PM, MHK wrote: > Hi All, > > I am planning to develop an application which should be mainly work with > desktop and latter may be use the same desktop app to convert into web and > mobile application using python. I wanted to know

Re: Scaling Django

2016-02-03 Thread Russell Keith-Magee
On Wed, Feb 3, 2016 at 11:30 PM, Joshua Pokotilow wrote: > At the startup where I work, we've written a lot of our server code in > Django. So far, we've adopted a "build it fast" mentality, so we invested > very little time in optimizing our code. A small amount of load

Re: async / await

2016-01-20 Thread Russell Keith-Magee
On Thu, Jan 21, 2016 at 8:19 AM, Benjamin Melki wrote: > > > > To implement this sort of feature, you need to have a worker queue - > Celery is the heavy duty answer for this; if you just need a cheap and > cheerful answer, RQ is a fairly easy-to-use option, or you can >

Re: async / await

2016-01-20 Thread Russell Keith-Magee
Hi Benj, On Thu, Jan 21, 2016 at 6:41 AM, Benj wrote: > Hi, > > on my django project, at a point i resize an image with pilow before > associating it to django field, then saving the instance. > > is there any benefit in making the image resize / saving on disk async ? >

Re: settings.py variables in fixtures

2015-12-27 Thread Russell Keith-Magee
Hi Salvatore, On Mon, Dec 28, 2015 at 12:09 AM, Salvatore Scaramuzzino < salvatorescaramuzz...@gmail.com> wrote: > hi to everyone > > i'm newbye in django, but i really appreciate this useful framework. I > have a simple question but i don't know if is appropriate. > > i have a fixture written

Re: What will be the replacement for .extra()?

2015-12-09 Thread Russell Keith-Magee
Hi Luis, On Thu, Dec 10, 2015 at 7:10 AM, Luis Masuelli wrote: > When I see the docs ( > https://docs.djangoproject.com/en/1.8/ref/models/querysets/#extra), I > notice .extra will be deprecated and removed. Is there a plan for the > replacement? As I see it, limiting

Re: Is django-nonrel still updating, or will be part of future django

2015-11-19 Thread Russell Keith-Magee
Hi Alex, On Thu, Nov 19, 2015 at 5:09 PM, Alex Yang wrote: > Is django-nonrel still updating, or will be part of future django > I can’t comment on whether nonrel is still updating, but I can say with a high degree of certainty that it is unlikely to be part of Django at

Re: Merging Codeigniter withe Django

2015-11-09 Thread Russell Keith-Magee
Hi Masum, On Sat, Nov 7, 2015 at 4:25 PM, Masum Hasan wrote: > Hi, > > I have a class project partially done with Django, but my lab partner has > done her part in Codeigniter. I was wondering if it is possible to merge > these two and complete the project? > Any thought

Re: Login with email address

2015-11-04 Thread Russell Keith-Magee
On Wed, Nov 4, 2015 at 11:58 PM, victor menezes wrote: > I agree that it is time for django to change it (at least making the > changes easier) > I’m intrigued - exactly how much easier do you want us to make it? At this point, it is *literally* installing a third

Re: Authenticate users with both username and email

2015-11-04 Thread Russell Keith-Magee
Yes, there *is* a very simple way to implement “Email address as username” - you use a custom user model that implements that approach. https://docs.djangoproject.com/en/1.8/topics/auth/customizing/#substituting-a-custom-user-model Django’s docs contain details of how to do this, and there are

Re: Password protect content

2015-11-02 Thread Russell Keith-Magee
Hi Andrew, On Tue, Nov 3, 2015 at 12:37 AM, Andrew S wrote: > Hello, > > I have a folder full of HTML files that will reside on a subdomain. > > I would like to password protect these with user accounts etc. > > > Can this be easily completed with Django? is there any

Re: Are jobs postings allowed on this forum?

2015-10-06 Thread Russell Keith-Magee
Hi John, As long as they're on topic (i.e, for Django jobs), you're clear about the geographical constraints on the job (e.g., only looking for people in city X, relocation budget available; telecommuting welcome; US citizen required), the job advertisement doesn't trigger any Community Code of

Re: Djangocon Costa Rica next year.

2015-08-19 Thread Russell Keith-Magee
On Wed, Aug 19, 2015 at 9:50 AM, Luis Zárate wrote: > Hello everyone, > > I want to organize the first "djangocon Costa Rica" next year, I know it's > too soon to speak about this but it's the first time here and it's very > important to do it well, so the community and I are

Re: User and Permission from admin to the app

2015-08-18 Thread Russell Keith-Magee
Hi Predator, Permission checks need to be manually added to each view, on a case-by-case basis. Django can't "interpret" what your view is trying to do - all user views look the same to Django - so you need to provide the extra information to describe which permissions are needed at any given

Re: is there anybody who test this django mongodb engine ?

2015-08-18 Thread Russell Keith-Magee
On Tue, Aug 18, 2015 at 3:31 AM, MahdiX wrote: > Hi folks > I just start learning and using mongoDB , it's looks like a really nice > replacement for mysql. > If you're judging relational databases by comparing to MySQL, you're really not doing a fair comparison. MySQL is a

Re: pyjs - a compiler from Python to JavaScript

2015-08-08 Thread Russell Keith-Magee
On Sat, Aug 8, 2015 at 4:27 PM, Uri Even-Chen wrote: > Hi Russ, > > I checked the projects you mentioned, but is it possible to communicate > with other JavaScript scripts such as jQuery, jQuery UI and plugins for > jQuery? I would like to have a way to communicate from Python

Re: pyjs - a compiler from Python to JavaScript

2015-08-07 Thread Russell Keith-Magee
Hi Uri, There are multiple projects out there trying to bridge the gap between Python and Javascript. PyJS was one of the first I was aware of, but to the best of my knowledge, it hasn't been very active for the last couple of years. Brython and Skulpt are two other projects - those two *have*

Re: Individual form element modification in Django

2015-07-21 Thread Russell Keith-Magee
Hi Rafer, I think what you're looking for is the "attrs" argument on a form widget. https://docs.djangoproject.com/en/1.8/ref/forms/widgets/#django.forms.Widget.attrs That page has some examples showing adding a class to a field as a specific example: class CommentForm(forms.Form): name =

Re: SHOP APP

2015-07-21 Thread Russell Keith-Magee
On Tue, Jul 21, 2015 at 7:11 PM, dravid rahul wrote: > Hi can anyone please help me with this.. I am newbie to django. > > PLEASE FIND BELOW ATTACHMENT > > Thanks in Advance > Dravid > Dravid - we're not going to do your homework for you. You've been given a task for

Re: Is there a plan to modernize Django-admin?

2015-07-17 Thread Russell Keith-Magee
On Sat, Jul 18, 2015 at 2:54 AM, xliiv wrote: > Hi! > Like the topic, though I don't mean only frontend. > Backend could be also rewritten with for example class-based views and > other stuff used in regular Django apps? > Would it be a waste? I'm just curious what

Re: Have a problem with a first Django App due to the Web Tutoral

2015-07-10 Thread Russell Keith-Magee
Hi, The error message by itself doesn't give us a lot to work with - it's not an error I'd normally expect to see while doing the tutorial. My first guess would be that there is something corrupted in your Django install - this might happen if you've got multiple versions of Django installed, or

Re: Django model for non web applications

2015-07-02 Thread Russell Keith-Magee
On Thu, Jul 2, 2015 at 12:50 AM, Jeff Fritz wrote: > I'm fairly new to Django and making my way through the tutorial. > > Knowing what I've learned so far, I'd like to explore using > django.db.models.Model in a non-web application. I'd like to take the > entire model layer

Re: Django 1.8 Transaction Begin

2015-06-17 Thread Russell Keith-Magee
Hi Katarzyna, I'm not sure what gave you the impression that Django doesn't support transactions - there's a whole section in the documentation about this very topic: https://docs.djangoproject.com/en/1.8/topics/db/transactions/ You don't explicitly execute a "BEGIN" statement, but you can

Re: Django users Group admin

2015-06-12 Thread Russell Keith-Magee
Hi Eike, I'm an admin; feel free to mail me any list admin requests. Yours, Russ Magee %-) On Friday, June 12, 2015, Eike Post wrote: > Hello Django users, > does anybody of you know how to get in touch with the Django user group > admin? > I tried via contact admin and

Re: how to get get-pip.py

2015-06-05 Thread Russell Keith-Magee
On Fri, Jun 5, 2015 at 4:51 PM, Steve Burrus wrote: > Okay Monte I will certsainly "man up" and start over and try to do what > you said. > Hi Steve, A quick aside: I'm sure you didn't intend any offence, but using language like "man up" isn't something we support in

Re: Embeding HSQLDB in a standalone App

2015-05-19 Thread Russell Keith-Magee
On Tue, May 19, 2015 at 7:49 PM, Kapil Solanki wrote: > Hi All, > > I need to embed hsqldb in my project. I have been looking for solution > online but couldnt find a proper one. > BDW am new to django and python so its bit difficult also for me to search > the right

Re: Scaling/Parallel patterns for a View executing complex database transaction

2015-05-14 Thread Russell Keith-Magee
On Thu, May 14, 2015 at 6:03 PM, Me Sulphur wrote: > Stack: Django 1.7 + Postgres 9.3 + Linux (No caching) > > Our application has a view which is called/executed very frequently. The > view receives, parses and responds a JSON. > > In between request and response, there are

Re: Invalid HTTP_HOST, can someone explain why I am getting this?

2015-05-13 Thread Russell Keith-Magee
, frocco <faro...@gmail.com> wrote: > Thanks for getting back to me. > I am on django 1.5. Is there a setting I can use to avoid getting these > emails? > I get at least 5 a week. > > > > On Tuesday, March 17, 2015 at 6:58:00 PM UTC-4, Russell Keith-Magee wrote:

Re: Leveraging the ORM for very complex queries

2015-05-03 Thread Russell Keith-Magee
Hi Suriya, It sounds like you're looking for raw SQL queries: https://docs.djangoproject.com/en/1.8/topics/db/sql/#performing-raw-queries This allows you to issue a SQL query in SQL, rather than trying to bend the ORM to meet some complex query requirement. You can't compose a raw query like a

Re: How to rename crfstoken

2015-04-28 Thread Russell Keith-Magee
Hi Vermus, Yes, the form value is currently hard coded. I can't think of any particular reason that this shouldn't be configurable though. If you're looking to get into Django development, it would be a fairly easy feature to contribute - there isn't that much code required to implement the

Re: How to rename crfstoken

2015-04-28 Thread Russell Keith-Magee
Hi Vermus, Calling this a security "breach" is a bit inaccurate; but I certainly agree that it is good practice to make the framework undetectable from the client side. That's why there's a setting that does exactly what you suggest:

Re: What happens if pk value gets too big?

2015-04-03 Thread Russell Keith-Magee
On Sat, Apr 4, 2015 at 6:25 AM, Mike wrote: > Hi, > Is there risk of getting too big PK value while adding and deleting rows > for long time in same table? > -Mike > It depends on what you mean. This code: while True: obj = MyObject.objects.create()

Re: Multiple Django projects using the same database

2015-03-29 Thread Russell Keith-Magee
On Mon, Mar 30, 2015 at 10:20 AM, Ien C. wrote: > Thanks Russ! > > Good point about the validation logic. Will definitely keep that in mind. > And yes, my basic approach here is the same code base working on different > subsets of data by default, with the ability for data to

Re: Multiple Django projects using the same database

2015-03-29 Thread Russell Keith-Magee
On Mon, Mar 30, 2015 at 12:14 AM, Ien C. wrote: > Hi everyone, > > I'm hoping to confirm my understanding on how to deploy multiple Django > websites using the same database, using postgres and gunicorn/nginx. > > Doing this seems to me as simple as: > 1. Creating a copy of

Re: Re-run only tests that failed last time

2015-03-24 Thread Russell Keith-Magee
Hi Gergely, One option is to use a test suite GUI tool, like cricket: http://pybee.org/cricket Cricket lets you view your entire test suite as a tree, select subsets of the suite to run, see test results as the suite executes, and re-run the failures from the previous execution. Yours, Russ

Re: How to supply parameters to "python manage.py syncdb" from a script?

2015-03-20 Thread Russell Keith-Magee
On Sat, Mar 21, 2015 at 5:25 AM, Dan Dong wrote: > Hi, > Does anybody know how to supply the input parameters to "python > manage.py syncdb" from a script? E.g, to set the the followings parameters: > > Would you like to create one now? (yes/no): yes > Username (leave

Re: Django 1.6's lifespan for security updates?

2015-03-19 Thread Russell Keith-Magee
On Thu, Mar 19, 2015 at 2:27 PM, Mike Dewhirst wrote: > Maybe ... some effort to solve the infrastructure issue would make it > worth kickstarter funding. > > A couple of colleagues are pushing me towards Docker as a packaged Python > 3.4 environment but that is beyond my

Re: Django 1.6's lifespan for security updates?

2015-03-19 Thread Russell Keith-Magee
On Thu, Mar 19, 2015 at 12:05 PM, James Bennett wrote: > On Wed, Mar 11, 2015 at 3:54 PM, Tim Graham wrote: > >> Having managed the last few security releases for Django, I'll say it's >> one of my least favorite tasks and I'm quite looking forward

Re: Invalid HTTP_HOST, can someone explain why I am getting this?

2015-03-17 Thread Russell Keith-Magee
Hi, It's possible that you're getting this error for the exact reason that the check was added - someone is submitting requests to your site with a manipulated HTTP_HOST header. This may not be malicious - it could just be a badly configured robot making web requests. It might also point at a

Re: GSoKites Virtual Classroom

2015-03-10 Thread Russell Keith-Magee
Hi Barclay, Welcome to the community! If you want to know anything about the Django Project's involvement in Google Summer of Code, our wiki page is here: https://code.djangoproject.com/wiki/SummerOfCode2015 If you've got any more questions, let us know. Yours, Russ Magee %-) On Tue, Mar 10,

Re: [Choose Database based on geolocalization]

2015-03-08 Thread Russell Keith-Magee
On Sun, Mar 8, 2015 at 9:15 PM, 'Petros Moisiadis' via Django users < django-users@googlegroups.com> wrote: > On 03/08/2015 01:42 AM, Russell Keith-Magee wrote: > > Hi Xina, > > > > The short answer is "not easily, and not within Django". > > > > D

Re: [Choose Database based on geolocalization]

2015-03-07 Thread Russell Keith-Magee
Hi Xina, The short answer is "not easily, and not within Django". Django's DB Routers don't contain any detail about the request, so there's no ability to geolocated the requesting IP for routing purposes. For the record, this is because Django is a general purpose toolkit - there's no guarantee

Re: Embedding a compiler to my web page

2015-03-07 Thread Russell Keith-Magee
If you're going to be compiling code, you almost certainly don't want to be using subprocess for this. A view should be able to return in milliseconds. Very few native code compilations are going to be complete in milliseconds. What you should be doing is treating the compilation step as a

Re: Research: Translations od documentation

2015-02-26 Thread Russell Keith-Magee
On Thu, Feb 26, 2015 at 9:51 PM, Tomáš Ehrlich wrote: > Hi Tim, > I'm aware that it's possible to translate Django documentation. I also > know that it's translated to french only. > > My question is one step behind: Does it makes sense to translate Django >

Re: Python / Django slow ? Deciding my next technological stack

2015-02-24 Thread Russell Keith-Magee
On Wed, Feb 25, 2015 at 7:30 AM, Benj wrote: > Hi, > i'm going to invest lots of time and energy in various web projects > (mostly community web sites), and want to pick up a language / framework > and invest heavily on it. > I've spent a lot of time evaluating the various

Re: Django GUI Frameworks?

2015-02-24 Thread Russell Keith-Magee
Hi Thomas, On Wed, Feb 25, 2015 at 4:29 AM, ThomasTheDjangoFan < stefan.eichholz.ber...@googlemail.com> wrote: > Hi ya, > > I wonder if Django has any gui-frameworks which give common solutions for > handling frontend data, p.e. in combination with Twitter Bootstrap? > Some time ago I had a look

Re: Design question: Is it really a good idea for models having “side effects”?

2015-02-20 Thread Russell Keith-Magee
On Fri, Feb 20, 2015 at 4:23 PM, Gergely Polonkai wrote: > Hello, > > I’m currently implementing a finite state machine in my application using > Django FSM[1]. In the Usage section of the README the author said that > “This function may contain side-effects, like updating

Re: cache.set(key, timeout=0)

2015-02-10 Thread Russell Keith-Magee
Hi Thomas, You are correct - if you set timeout=0, the cached value immediately expire (effectively "don't cache"). This appears to be an oversight of the documentation; the section you reference includes a discussion of the None value, but not the 0 value - a clarification would definitely be

Re: App for storing ChangeLogs in database

2015-02-06 Thread Russell Keith-Magee
On Fri, Feb 6, 2015 at 8:24 PM, Thomas Güttler wrote: > Hi, > > we want to make the changes in our applications better visible for our > customers. > > We use several git repos: > > - foo_customer: Here settings.py lives. It is quite small. > > - foo_core: Central part of

Re: Pillow on QPython3

2015-02-03 Thread Russell Keith-Magee
Hi Adewale, Installing Pillow is always a bit of a struggle, because it involves native code - the pieces of pillow that do the actual image processing rely on system libraries for handling JGEG, PNG etc. If the makers of QPython haven't included Pillow (or PIL) in their build, you're going to be

Re: Kickstarter: Django opensource improved import-export package

2015-02-01 Thread Russell Keith-Magee
Hi, Best of luck with your Kickstarter! However, I'd like to advise that your usage of the Django logo my be bordering on a violation of the Django trademark license: https://www.djangoproject.com/trademarks/ It isn't clear if "will code Django for food" is a product name, service mark, or

Re: Restrict downloading files in Django?

2015-01-31 Thread Russell Keith-Magee
On Sun, Feb 1, 2015 at 1:33 AM, Javier Guerra Giraldez wrote: > On Sat, Jan 31, 2015 at 11:52 AM, Robert Rössler > wrote: > > what is the best way to restrict downloading files only to authorized > users? > > it's not hard to do if you manage the file

Re: using Django on an existing mysql schema

2015-01-30 Thread Russell Keith-Magee
On Fri, Jan 30, 2015 at 10:47 PM, William Muriithi < william.murii...@gmail.com> wrote: > ‎Hello, > > I am new to Django and planning to use it for a project I have in mind. I > am strong in mysql, but not too good in developing. In fact, the secondary > purpose of this project is to improve my

Re: using Django on an existing mysql schema

2015-01-30 Thread Russell Keith-Magee
On Sat, Jan 31, 2015 at 3:14 AM, Tobias Dacoir wrote: > I'm certainly no Django expert, but I'm not sure if you can use the orm > and an already existing database. > Yes, you absolutely can. There's even a management command (inspectdb) to help write the wrapper models, and a

Re: Two user model problem

2015-01-28 Thread Russell Keith-Magee
On Thu, Jan 29, 2015 at 1:39 AM, 詹上潁 wrote: > Before I use the design as I mention above, I had thought of using two > type of profile. > Using two profile model in a project, I need to implement two login page > for each type of user, and I also need to check which of user

Re: Two user model problem

2015-01-28 Thread Russell Keith-Magee
On Wed, Jan 28, 2015 at 9:32 PM, Andreas Kuhne <andreas.ku...@suitopia.com> wrote: > 2015-01-28 13:26 GMT+01:00 Russell Keith-Magee <russ...@keith-magee.com>: > >> >> On Wed, Jan 28, 2015 at 3:00 PM, 詹上潁 <boy801...@gmail.com> wrote: >> >>> My p

Re: Two user model problem

2015-01-28 Thread Russell Keith-Magee
On Wed, Jan 28, 2015 at 3:00 PM, 詹上潁 wrote: > My project need an admin for staff and a normal website for normal user. > Staff can only login to staffsite and normal user can only login to > website. Staff will login to admin to do some management. They can > view normal

Re: Looking for a way to broadcast live video streams. Is it possible with Django ?

2015-01-27 Thread Russell Keith-Magee
Hi Jeremy, What you're trying to tackle here is fairly complex - and for the most part, won't have anything to do with Django. The capability of capturing webcam video and sending it will be almost entirely "client side" - which means that the logic will reside in the browser, and will be

Re: Downloading thumbnails and replacing them with full images

2015-01-23 Thread Russell Keith-Magee
On Sat, Jan 24, 2015 at 12:20 AM, Larry Martell wrote: > I have a django app that downloads 100's of images. To increase the > performance, I want to change it so that it downloads thumbnails, and > when the user clicks on one then download the full image. > > I'm sure I

Re: Accessing Django test client in setUpClass

2015-01-22 Thread Russell Keith-Magee
Hi Nicole, (I've added this answer to SO as well) Short answer is no - but that's not the end of the story. self.client is a convenience that is configured as part of the "pre-test" sequence. This means it is configured on a per-test basis; so you can use it in setUp(), but not setUpClass().

Re: Communication between listboxes in form

2015-01-22 Thread Russell Keith-Magee
On Thu, Jan 22, 2015 at 4:17 PM, joulumaa wrote: > Hi, beginner question. > > I need to have two listboxes A and B on web page, When user selects one > item from A it should add it in B. > > If I understand right, form A should somehow save change to database and > wake

Re: Question for Django Core Team?

2015-01-18 Thread Russell Keith-Magee
On Sun, Jan 18, 2015 at 8:28 PM, Petar Pilipovic wrote: > Hello there this is maybea of topic but I wont to ask Django Core Team, > did they now someone who is practising Django in Belgrade-Serbia, or > Zagreb-Croatia, I now there is a strong Slovenia team there, but I was >

Re: Instructions from Django to run under Python don't work.

2015-01-18 Thread Russell Keith-Magee
On Sun, Jan 18, 2015 at 10:23 AM, Lisa Jennings wrote: > I have been trying for two days to install django with Python 3.4 > operating in windows 7. Everything I try according to your instructions, > fails. The command "import django" seems to work but the command "print >

Re: do migrations (Django 1.7+) handle production data?

2015-01-13 Thread Russell Keith-Magee
On Wed, Jan 14, 2015 at 3:03 PM, Abraham Varricatt < abraham.varric...@googlemail.com> wrote: > Hello everyone, > > One of the biggest features introduced in Django 1.7 are migrations. They > can broadly be classified into 2 types - > * schema migrations > * data migrations > > Schema migrations

Re: AWS FOR STEEL PLATE TO SUS316L

2014-12-26 Thread Russell Keith-Magee
Hi MajiD, Are you sure you've got the right mailing list? It sounds like you're talking about arc welding - this is a mailing list discussing a computer software framework called Django. If your question *is* about Django - you're going to need to explain your acronyms, because AWS is the only

Re: potential bug with defer() & only()

2014-12-23 Thread Russell Keith-Magee
Hi Will, On Tue, Dec 23, 2014 at 3:56 PM, William Earp wrote: > > Hi all, > > I'm writing some tests #18586) for defer() and only() and there appears to > be a bug when it comes to chaining these two in a single query. > > If you look at the docs ( >

Re: Poll Tutorial (for Django 1.7) Files Available?

2014-12-23 Thread Russell Keith-Magee
Hi Ken, No - the full tutorial code isn't available anywhere (at least, not in an official capacity). If you need help debugging a problem, let us know what error you're getting, and we might be able to help you; if you're looking for some immediate feedback, try the #django IRC channel. There's

Re: Raw access to cache table

2014-12-21 Thread Russell Keith-Magee
On Sun, Dec 21, 2014 at 12:55 PM, Collin Anderson wrote: > > Hi Erik, > > If you want a nicer interface, I just ran manage.py inspecdb on one of my > databases and got this for the cache table. Not sure why django still does > it by hand. > Gather `round, children, and let

Re: Loving the new site / Performance and Optimization

2014-12-17 Thread Russell Keith-Magee
Hi JJ, For archival purposes, I've just deleted your post from the Django Users archive. Pete and the team at Lincoln Loop are long standing, highly respected members of the Django community, and you've just done them a huge disservice. The very first page in the "High performance Django" book

Re: ANN: Django website redesign launched

2014-12-16 Thread Russell Keith-Magee
On Wed, Dec 17, 2014 at 6:55 AM, Schmitt, Christian < c.schm...@briefdomain.de> wrote: > Somehow I hate it. The website is the worst website I've seen since a long > time. > The contrast is really aweful. > The issue Tracker got unusable due to the colors that aren't focused on > readability. > >

Re: ANN: Django website redesign launched

2014-12-16 Thread Russell Keith-Magee
On Wed, Dec 17, 2014 at 2:38 AM, Jannis Leidel wrote: > > > On 16 Dec 2014, at 17:17, Fred Stluka wrote: > > > > Jannis, > > > > Care to summarize what has changed? At first glance, it looks like > > mostly the same excellent content and the same sensible >

Re: InMemoryUploadedFile object retrieved from request.FILES got closed automatically on django 1.7

2014-12-15 Thread Russell Keith-Magee
On Tue, Dec 16, 2014 at 4:53 AM, Hong Yi wrote: > Hello, > > I am new to Django and have implemented two views and their corresponding > template pages and they are working well in Django 1.6. However, when > migrating to Django 1.7, I got an error "I/O operation on closed

Re: how to learn django and I don't kill in the attempt,

2014-12-15 Thread Russell Keith-Magee
On Mon, Dec 15, 2014 at 2:57 PM, Shazwi Suwandi wrote: > +1 to what Jorge mentioned. You can find books online but most of them > (the ones I found) cover up till Django 1.6 and if you wanna use Django > 1.7, some things won't apply. For example, things like South is

Re: Can anyone give me a suggestion or a recommendation as to how I can access the current user's username in the models.py?

2014-12-14 Thread Russell Keith-Magee
On Mon, Dec 15, 2014 at 9:14 AM, Fred Stluka wrote: > Collin and Russell (and anyone else), > > Do you have any opinion on this? > - https://bitbucket.org/aptivate/django-current-user > > It was offered in an earlier post: > -

Re: Modify a queryset and add computed value to the objects

2014-12-09 Thread Russell Keith-Magee
Hi Karim, On Wed, Dec 10, 2014 at 8:07 AM, Karim wrote: > Hi everyone! I have a "Services" model and I would like to get a > QuerySet with all the services filtered based on the distance between > the logged user and the service. > > I have latitude and longitude about the

Re: Backup vs Audit

2014-12-08 Thread Russell Keith-Magee
Hi Andrea, In short, you don't - at least, not out of the box. That's not what Django's admin interface is for. Django's admin is a quick-and-dirty CRUD interface you can throw over some models, with some customisation hooks that means it has a lifespan beyond initial bootstrapping. It isn't a

Re: Add another link missing in Chrome

2014-12-06 Thread Russell Keith-Magee
Hi Timothy, No two browsers will ever render things *identically*, but it should certainly be functionally equivalent, and at least bear a striking resemblance to each other. There certainly shouldn't be a missing button or anything like that. My immediate reaction is that you've probably got

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

2014-12-06 Thread Russell Keith-Magee
Hi Mariusz, It depends how many sharp edges you're willing to live with. I've been working on a project to allow users to develop native mobile apps in Python: http://pybee.org/toga/ It's *very* early stage though - nothing close to production ready. There isn't even really a tutorial for

Re: Seeking for advise on usage MySQL together with MongoDB

2014-12-05 Thread Russell Keith-Magee
On Fri, Dec 5, 2014 at 8:56 PM, Artie wrote: > Good day, Community, > > I'm looking for advise on MySQL & MongoDB usage so please let me take your > time to describe the situation. > > I came to work on e-commerce shop of electrical components with about 10 > millions of

Re: Matching wit XOR

2014-12-05 Thread Russell Keith-Magee
On Fri, Dec 5, 2014 at 5:24 PM, inoyon artlover KLANGRAUSCH < inoyonartlo...@googlemail.com> wrote: > Hi everybody, > > need to accomplish a matching in following fashion: > > Users have to edit their psychological profile and > select XOR characteristic on each category. > > Qestions: > 1. >

Re: Obtaining content from Git

2014-11-24 Thread Russell Keith-Magee
On Mon, Nov 24, 2014 at 7:43 PM, martin f krafft <madd...@madduck.net> wrote: > also sprach Russell Keith-Magee <russ...@keith-magee.com> [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 >

Re: Obtaining content from Git

2014-11-24 Thread Russell Keith-Magee
On Mon, Nov 24, 2014 at 5:06 PM, martin f krafft <madd...@madduck.net> wrote: > also sprach Russell Keith-Magee <russ...@keith-magee.com> [2014-11-24 > 07:16 +0100]: > > The right place is in the view. > […] > > If you want to do "interesting" thing

Re: Obtaining content from Git

2014-11-23 Thread Russell Keith-Magee
On Mon, Nov 24, 2014 at 1:45 PM, martin f krafft <madd...@madduck.net> wrote: > also sprach Russell Keith-Magee <russ...@keith-magee.com> [2014-11-24 > 00:42 +0100]: > > The problem is that there isn't one. There's several :-) > > > > I'm aware of at least 3:

Re: Obtaining content from Git

2014-11-23 Thread Russell Keith-Magee
On Sun, Nov 23, 2014 at 5:28 AM, martin f krafft wrote: > Hello, > > we have a Django project with a few pages that come from Git. > Currently, Apache rewrite rules serve those files statically (and > they make use of the same template/CSS as Django does, so the user > does

Re: What on earth is causing this "naive datetime" warning?

2014-11-19 Thread Russell Keith-Magee
Hi Daniel, A naïve datetime is a datetime that doesn't have a timezone. If you have USE_TZ=True enabled in your settings file (which is the default for new projects), Django expects you to fully specify datetime objects with a timezone; if you don't, you get the warning you've seen, because the

Re: Django + Database Connections

2014-11-13 Thread Russell Keith-Magee
On Wed, Nov 12, 2014 at 11:42 AM, Edward Armes wrote: > HI guys, > > Thanks for your responses, they have indeed answered all my questions > pretty much as I was mainly looking for information on how to modify how > Django accesses it's ORM layer. However from your answer

Re: set the css class of a form widget based on the data

2014-11-13 Thread Russell Keith-Magee
Hi Michael, The best bet would be to write a custom widget, and override the render() method. render() takes the name of the widget, the value to render, and a dictionary of attr values. In your subclass, you can override this method to inject the additional attributes based on the provided value

Re: Django + Database Connections

2014-11-11 Thread Russell Keith-Magee
Hi Edward, On Tue, Nov 11, 2014 at 12:30 AM, Edward Armes wrote: > Hi there, > > I am currently looking at Django for a personal project. While I > understand how a lot of it works I can't wrap my head around how the actual > DB querying is done specifically what part of

  1   2   3   4   5   6   7   8   9   10   >