Re: Static files is not loading while deploying the project to AWS ec2

2022-11-05 Thread Malcolm MacKinnon
Using elastic beanstalk, I run the command manage.py collectstatic in a .config file during deployment. The config file is located in the .ebextensions folder. In settings.py STATIC_URL = '/static/' STATIC_ROOT = 'static' https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python

Re: Import issue

2021-10-01 Thread Malcolm MacKinnon
Is your module included in your installed apps in the settings.py file? On Fri, Oct 1, 2021 at 8:09 PM Sophia Iroegbu wrote: > > I noticed that each time I download a python package and import it. > It imports, it works but once I run my code it runs into an error. > > Error message: ModuleNotFou

Re: Django does't send email on the remote server

2021-03-03 Thread Malcolm MacKinnon
This might help: https://dev.to/abderrahmanemustapha/how-to-send-email-with-django-and-gmail-in-production-the-right-way-24ab On Wed, Mar 3, 2021 at 8:57 PM AMRIT SHAHI wrote: > > is that your site backend is fully backend > > On Tue, Feb 23, 2021 at 3:51 PM Sergei Sokov wrote: >> >> I am trying

Re: Error at the return of an AJAX POST in DJANGO

2020-10-25 Thread Malcolm MacKinnon
In your success function, you are assigning the variable e = 'OK', so in your if statement, it appears to throw an error. If you change it to if(e=="OK"), does it work? Note the two equal signs, == . On Sun, Oct 25, 2020 at 3:29 PM Walter Randazzo wrote: > I tried with no luck. When i remove it

Re: Error at the return of an AJAX POST in DJANGO

2020-10-25 Thread Malcolm MacKinnon
I'm not a JS expert, but is your success function defined properly? if(e="OK") vs. if(e=="OK") On Sun, Oct 25, 2020 at 2:06 PM Walter Randazzo wrote: > > Hi buddies, I have a POST request from ajax. At the backend some records are > updated in the django view, this is done fine but an error come

Re: VIRTUAL ENVIRONMENT

2020-04-10 Thread Malcolm MacKinnon
I'm not sure what you mean by compulsory, but most serious django programmers do use the virtual environment so that they don't run into errors among dependencies. For example, some versions of django may not be compatible with python 3.2, etc. There are different tools available to use a virtual e

Re: deploy django on AWS

2019-06-30 Thread Malcolm MacKinnon
I use this: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html There's a lot more to learn, especially if you want to connect to a database like postgres, but this is a good place to start. On Sun, Jun 30, 2019 at 9:52 AM Anirudh Jain wrote: > > You can use

Odd problem with Incorrect padding error in Oauth2 flow using Django >=2.0

2018-06-10 Thread Malcolm MacKinnon
a solution? Here's my traceback: Internal Server Error: /openid/login/ Traceback (most recent call last): File "/home/malcolm/anaconda3/envs/qb6/lib/python3.5/site-packages/django/core/handlers/exception.py", line 35, in inner response = get_response(request) File "/home/ma

Re: sqlite3 database encrytion for Django.

2017-05-05 Thread Malcolm MacKinnon
I suggest you consider using keyzar and django-encrypted-fields. Here's the code: https://github.com/defrex/django-encrypted-fields/ On Fri, May 5, 2017 at 11:51 AM, wrote: > Hello everyone, > > I want to encrypt my sqlite3 database such that it cannot be accessed > without a key. I came across

Re: Aggregation / annotation over results of a subquery

2016-05-23 Thread Malcolm Box
Thanks Simon, that's exactly what I needed. I had read the aggregation documentation, but hadn't figured out how to get it to do what I needed. Cheers, Malcolm On Friday, 20 May 2016 16:52:01 UTC+1, Simon Charette wrote: > > Hi Malcom, > > I suggest you look into the co

Aggregation / annotation over results of a subquery

2016-05-20 Thread Malcolm Box
to generate SQL that looks like this. Any pointers/help - even "you can't do that using the ORM" would be very welcome. Cheers, Malcolm -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this grou

Re: Adding dynamic methods to ModelAdmin fails in 1.8

2015-09-10 Thread Malcolm Box
Hi Simon, On Thursday, 10 September 2015 16:57:51 UTC+1, Simon Charette wrote: > > Hi Malcolm, > > > The system check checks that all the values returned from > get_readonly_fields exist as class attributes on the ModelAdmin (or are > callable/fields on model, neither of wh

Re: Adding dynamic methods to ModelAdmin fails in 1.8

2015-09-10 Thread Malcolm Box
Ticket filed: https://code.djangoproject.com/ticket/25374 On Thursday, 10 September 2015 11:27:13 UTC+1, Malcolm Box wrote: > > Hi Simon, > > I've tried that, and it still fails the same system check. > > The system check checks that all the values returned from > ge

Re: Adding dynamic methods to ModelAdmin fails in 1.8

2015-09-10 Thread Malcolm Box
ttr__, they don't. I'm coming to the conclusion that the right behaviour is to run the system check against an instance, not the class, since that's what the core admin code uses. Thanks for the offer to review changes - I'll try to put a patch together this week. Cheers, Mal

Re: Adding dynamic methods to ModelAdmin fails in 1.8

2015-09-09 Thread Malcolm Box
lly created attributes on ModelAdmin when validating fields 3. Metaclass programming is really the right way to do this Malcolm On 9 September 2015 at 02:23, Simon Charette wrote: > Hi Malcom! > > I would suggest you have a look at the ModelAdmin.get_fields() > <https://do

Adding dynamic methods to ModelAdmin fails in 1.8

2015-09-08 Thread Malcolm Box
s like overkill for a simple task like this. Should this even work, and if so is it a bug in the check framework? Cheers, Malcolm -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving em

Re: Why doesn't saving a related model update the _id field?

2014-06-10 Thread Malcolm Box
On Monday, 9 June 2014 03:08:21 UTC+1, Russell Keith-Magee wrote: > > On Sun, Jun 8, 2014 at 10:34 PM, Malcolm Box > wrote: > >> I'm confused by Django's behaviour when saving related models. Take for >> example: >> >> I kind of understand this,

Re: How to receive json data using HTTP POST request in Django 1.6?

2014-06-10 Thread Malcolm Box
Simplest answer is to use Django Rest Framework, which makes this extremely easy. Malcolm On Monday, 9 June 2014 11:20:05 UTC+1, Alok Singh Mahor wrote: > > Hi all, > > I am trying to receive JSON data using HTTP POST in django 1.6. > I tried using request.POST['data'

Re: execute a code at a particular date and time (aperidic task) in django

2014-06-10 Thread Malcolm Box
The canonical answer to this is to use Celery, which provides a task queue for any background/scheduled tasks you want to use. It's pretty easy to get set up, and works well. Malcolm On Tuesday, 10 June 2014 06:37:46 UTC+1, Rini Michael wrote: > > Hi, > i am looking for a w

Why doesn't saving a related model update the _id field?

2014-06-08 Thread Malcolm Box
turn unsaved versions of the model, but this is broken by the above. Any insight into what's going on and why would be much appreciated. Cheers, Malcolm -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this g

Re: django on rhel5 with both python2.4 and python2.7 confusion

2014-05-12 Thread David Malcolm
thanks for your reply WB. I was hoping to avoid virtualenv. My webapp is a frontend to a vulnerability scanner in a large corporation. They are very picky about what I can use and what I can't. Is virtualenv suitable for such a production system? They insist that I cannot use mod_wsgi (it annoy

Re: django on rhel5 with both python2.4 and python2.7 confusion

2014-05-12 Thread David Malcolm
Hi Timothy thanks for your suggestions. I'm still on the path. I'll put more details in my reply to WongoBongo below. cheers Dave -- 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

django on rhel5 with both python2.4 and python2.7 confusion

2014-05-07 Thread David Malcolm
I have been tasked with finishing a build for production that was interrupted due to another staff member leaving at short notice. It's RedHat Enterprise Linux 5 and there are two versions of python on the box. If I type python I get version 2.7. However if I try and use django-admin.py I find

Re: admin error, cannot edit fields or delete records, url refers to incorrect primary key

2012-05-19 Thread Malcolm MacKinnon
Problem solved. I had a double defined as my primary key in the mysql db. On Fri, May 18, 2012 at 10:49 PM, Mac wrote: > I've set up a 'Reps' model in the admin. I can add records > successfully, but if I try to change a record or field, I get a 404 > error. When I try to delete a record, I get

Re: memcached - Errors and Solution - please provide comments!

2011-11-10 Thread Malcolm Box
rs, I'd suggest running it through a hash function (e.g. MD5) that has a low probability of collision, and then use that. E.g. if the key was "poll:question:choice:a very long choice here that takes up 255 characters" I'd turn it into "poll:question:choice:" Malcolm -- Y

Re: Caching at model class level

2011-11-04 Thread Malcolm Box
. > How are you getting 7 queries the same? Would select_related solve the problem by doing it all in one query? Malcolm -- 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

Re: Login problems under heavy load

2011-10-31 Thread Malcolm Box
> > > > IOError: request data read error > > > > tl;dr - the user got bored waiting, pressed 'stop' on their browser. > > Although that's almost always true, it *is* possible to see "request data read error" on WSGI that isn't caused by the use

Re: Django tutorial hasn't received an update for 1.3

2011-10-31 Thread Malcolm Box
Hi, If you've figured this stuff out, how about writing some of the tutorial yourself and submitting a patch? Trying to teach someone else is the best way to figure out if you really understand something, and you'd be contributing to keeping the Django documentation great. Malc

Re: CAS and Django cache

2011-10-27 Thread Malcolm Box
Yes, get followed by set can lead to data loss. What you want is cache.add(). This sets the value if and only if there is no existing value. Its atomic on backends that support it - notably memcached. Sent from my iPhone, please excuse any typos On 27 Oct 2011, at 07:26, Dan Julius wrote:

Re: Is it possible to run from Django script?

2011-09-21 Thread Malcolm Box
s largely on how long the script might take to run. While it's running the Django instance serving the user's request and the user's browser will hang waiting for it to complete, so if it's going to take a while then you'd be better off running the script using something li

Re: django and thrift

2011-09-08 Thread Malcolm Box
On 8 September 2011 03:27, Li Lirong wrote: > Hi, > Thank you for your comments. I am new to both django and thrift. I > am hosting my service with a shared web hosting server. That's why I > want to use django to expose a thrift API. Basically, what I want is > to have a web service that can

Re: In unitTest, GET Formset returns 302 instead of 200

2011-09-07 Thread Malcolm Box
a cut'n'paste of your code, you have a typo in the self.client.login() call - you're passing "usernamer" not "username" Malcolm -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: Pagination of more than one field

2011-09-07 Thread Malcolm Box
On 7 September 2011 14:57, OC wrote: > Thank you very much for your reply, > I changed it but I guess Im doing something wrong cause it still > doesnt work: > It tries to go to the right page now, but provides nothing although I > know there's more than one page: > > in views.py > movies_page= in

Re: django and thrift

2011-09-07 Thread Malcolm Box
hose in the server. Don't try to tie handling Thrift into the Django URL/HttpRequest/HttpResponse cycle or you'll go mad. Malcolm -- 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

Re: Pagination of more than one field

2011-09-07 Thread Malcolm Box
e actors into actor_page. Update your links in the template to use the right query for the prev/next and all should work fine. Malcolm -- 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

Re: Problem updating data

2011-08-24 Thread Malcolm Box
onnection.queries e1.save() connection.queries to see what the SQL generated was. Then start looking at your database to see what it's doing. Malcolm On 23 August 2011 23:08, Karen McNeil wrote: > No, that's not the problem. Even if I redo the query now, I still get > the same

Re: Help installing django-sentry

2011-08-22 Thread Malcolm Box
Post your urls.py file - it looks like you have a pattern that is over aggressively matching /sentry as a poll. Malcolm Sent from my iPhone, please excuse any typos On 21 Aug 2011, at 21:18, tharshan muthulingam wrote: > Hi, > I have been having alot of trouble trying to install a

Re: Best approach to handling different types of Users

2011-08-20 Thread Malcolm Box
#x27;t seen anyone share a concrete example of *how* things go wrong. Anyone got a good example to scare the children with? Malcolm -- 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@googlegro

Re: Django Test Corrupted Test Data

2011-08-20 Thread Malcolm Box
call super(MyTestCase, self).setUp() and other superclass methods to get the DB setup right? Malcolm On 19 August 2011 22:05, patjenk wrote: > As I understand it, the database should be reset between each test. To > me this means that unless the variable being examined is an attribute >

Re: how to invalidate per-view cache?

2011-08-20 Thread Malcolm Box
ecords are changed. There is no info > about how to do that:/ You'll need to use the low-level cache API to invalidate the individual cache entries. Hook up a post_save handler to your model, figure out the key(s) for the views affected and use cache.delete() to remove the entry

Re: Specific models without a database table

2011-08-20 Thread Malcolm Box
ve to do to trick things. If it's a simple field that isn't used for queries, then you could look at creating a custom field type that knows how to read/write the values to the API. All the above advice is worth exactly what you paid for it! Malcolm -- You received this message because

Re: Django for a front end designer

2011-08-03 Thread Malcolm Box
ing obscure X-Windows settings to get a desktop that works. Oh, and the battery life is good. Malcolm -- Malcolm Box malcolm@gmail.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-u

Re: [django] Get request URL

2011-08-03 Thread Malcolm Box
The best you can do is look for a Referrer header in the request: request.META['HTTP_REFERER'] which should be the URL of the originating page. However that may or may not be there depending on user's browser etc etc. Malcolm On 3 August 2011 00:41, He Jibo wrote: > Hi, D

Re: Recommendations for load testing/profiling a django site server?

2011-07-22 Thread Malcolm Box
dth/CPU/memory to handle a significant amount of > > traffic is and/or to get an idea of the types of loads the site can > > handle before i need to upgrade. > > TSung and JMeter are both good. Unless you're expecting insanely high loads, then the best bet is probably JMeter and/or apa

Re: Problem with relationships in models

2011-07-21 Thread Malcolm Box
n ran again you'd get the error your seeing. If you have no data, just blow away the tables and start again. If you have data, now is a good time to find out about South (http://south.aeracode.org) Malcolm On 21 July 2011 15:34, Schmidtchen Schleicher wrote: > Something went wrong wit

Re: import django models without runing the server

2011-07-21 Thread Malcolm Box
time. If you make the script a management command, you have an easy way to build tests for it right into your app, so that it's impossible (ok, hard) for changes to break the script without you noticing. So my advice: if you're actively developing your app, then make any scripts that ne

Re: Django - can't open image in model save()

2011-07-18 Thread Malcolm Box
n the path. What happens when you step through the code - what's the value of self.image? Is it really a valid image file? Is it where it thinks it is? Malcolm -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, s

Re: import django models without runing the server

2011-07-18 Thread Malcolm Box
is undefined. > > You need to set the DJANGO_SETTINGS_MODULE environment variable. Malcolm -- 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: Scaling to 30k requests (malcolm box blog)

2011-07-11 Thread Malcolm Box
uld Be Wrong. > > > http://attentionshard.wordpress.com/2011/06/21/behind-the-scenes-using-cassandra-acunu-to-power-britains-got-talent/ > Explains a bit of their usage of using Cassandra. Would be interesting to > see some benchmarks though. > What benchmarks would you like to se

Re: 'WSGIRequest' object has no attribute 'update'

2011-07-11 Thread Malcolm Box
. You probably meant either: return render_to_response(template_name, locals(), context_instance=(request, )) # Note comma or return render_to_response(template_name, locals(), context_instance={'request':request})) HTH, Malcolm -- You received this message because you are subscr

Re: my frist django project Error

2011-07-10 Thread Malcolm Box
community. Malcolm Sent from my iPhone, please excuse any typos On 9 Jul 2011, at 21:49, "Cal Leeming [Simplicity Media Ltd]" wrote: > Question, have you ever used Python before? > > If no, then I suggest you learn Python before jumping into Django. > > If yes, then

Re: Speed of search question

2011-07-06 Thread Malcolm Box
t; > If I want to show the Calendars of the logged in user, I would have to > itterate the calendar objects, > getting the related appointments and from there the user. > I think this should work: Calendar.objects.filter(appointment__owner = request.user) Try it and see. Malcolm -- You

Re: change values in "select list"

2011-07-06 Thread Malcolm Box
your emotional health for more rewarding interactions. Please can we keep things civil and helpful here - I for one value that too much to see it go without a fight. Malcolm -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: upload file isn't working

2011-06-27 Thread Malcolm Box
even though I entered all the information). Help please. > > It looks to me like form.is_valid() is returning False, so you're seeing the error messages. You can debug the cause by putting import pdb;pdb.set_trace() just above the "if form.is_valid():" line and then stepping

Re: please recommend a video streaming app/lib

2011-06-26 Thread Malcolm Box
Adobe video server. It's the de facto standard and you can get access via amazon ec2 easily. On Jun 26, 2011 5:31 AM, "akonsu" wrote: > hello, > > can anyone recommend a library or an application for video streaming > that can be used in a commercial site that requires good performance > and scala

Re: mach-o, but wrong architecture

2011-06-23 Thread Malcolm Box
, you won't see the data in your cache. The simplest fix is to use memcached. HTH Malcolm Sent from my iPhone, please excuse any typos On 23 Jun 2011, at 22:00, John wrote: > O.K. I know that there are a lot of suggestions out there for this > problem, I think I have tried all

Re: Possible interest in a webcast/presentation about Django site with 40mil+ rows of data??

2011-06-22 Thread Malcolm Box
and anyone can > attend. I'd also offer up a Q&A session at the end. > > If you're interested, please reply on-list so others can see. > Count me in. Malcolm -- You received this message because you are subscribed to the Google Groups "Django users" g

Re: csrf protection and testing with tsung

2011-06-22 Thread Malcolm Box
On 22 June 2011 09:52, Ivan Uemlianin wrote: > > Thanks very much for your help!  You were exactly right.  The > following config works (simplified for exposition). Glad that helped, and thank you for coming back with the working settings for anyone else who runs into the same problem.

Re: csrf protection and testing with tsung

2011-06-21 Thread Malcolm Box
he csrf token out of the original form and re-inject it into the post you send back. As far as I understand it, all that the csrf protection is is an opaque value hidden in any form that needs to be present in the submitted version to be valid. That stops "loose" posts from CSRF attack

Re: Strange value_from_object() return value (2L returned instead of unicode string)

2011-06-21 Thread Malcolm Box
same behaviour for all fields - ie you're retrieving the value of the key for the related item. However for the Status model, that value is a string since you've defined a charfield as the primary key. Under the hood, related fields store the key of the related item, not the item it

Re: Strange value_from_object() return value (2L returned instead of unicode string)

2011-06-21 Thread Malcolm Box
get_field('distro') > >>> f.value_from_object(dev) > 2L > >>> # what the hell? Psychic debugging since you didn't post the Device model: dev.distro is a foreign key to the Distro model. When you ask for the value via the get_field, you actually end up wit

Re: Why does OpenLayers not load in django with this template ?

2011-06-19 Thread Malcolm Box
#x27;ve told it to look for the JS file at http://example.com/a/path/OpenLayers.js which is highly unlikely to map to something that gets served by your webserver. You need to read the documentation on media files, and then put the path to your media root in the script tag. Malcolm -- Yo

Re: Authentication in API (REST)

2011-06-14 Thread Malcolm Box
I think oauth solves this problem well. What do you see wrong with it? Malcolm Sent from my iPhone, please excuse any typos On 14 Jun 2011, at 16:35, Stuart MacKay wrote: > Neznez, > > The authentication problem is one that has never really been solved to any > general level of

Re: Updating static files: Still in browser cache

2011-06-10 Thread Malcolm Box
On 10 June 2011 14:54, Thomas Guettler wrote: > On 09.06.2011 19:18, Malcolm Box wrote: > > On 9 Jun 2011, at 14:21, DrBloodmoney wrote: > > > >> On Thu, Jun 9, 2011 at 9:16 AM, Malcolm Box > wrote: > >>> On 9 June 2011 08:09, Thomas Guettler wrote:

Re: Authentication in API (REST)

2011-06-10 Thread Malcolm Box
> View source is your friend. Have a look at the other site and figure out how they do it. My guess is that they will have an unauthenticated page with some JS on it that tries to make an authenticated call, catches any return error and prompts for login. Malcolm -- You received this message

Re: Authentication in API (REST)

2011-06-09 Thread Malcolm Box
entication before can be accessed, or > we can make it have to throw username and password to access the HTTP > Response? > > https://docs.djangoproject.com/en/1.3/topics/auth/ Malcolm -- You received this message because you are subscribed to the Google Groups "Django users&q

Re: Boolean field, unexpected behavior

2011-06-09 Thread Malcolm Box
ault values ("" for CharField, False for BooleanField), and because a Boolean field cannot be null (you need a NullBooleanField for that). Malcolm -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to d

Re: Updating static files: Still in browser cache

2011-06-09 Thread Malcolm Box
Sent from my iPhone, please excuse any typos On 9 Jun 2011, at 14:21, DrBloodmoney wrote: > On Thu, Jun 9, 2011 at 9:16 AM, Malcolm Box wrote: >> On 9 June 2011 08:09, Thomas Guettler wrote: >>> >>> My static files (JS/CSS) are cached in the browser. But if there

Re: Updating static files: Still in browser cache

2011-06-09 Thread Malcolm Box
t; > Version all static assets, bump the version when you change them. Malcolm -- 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: django transactions.

2011-06-09 Thread Malcolm Box
On 8 June 2011 11:07, Marc Aymerich wrote: > On Tue, Jun 7, 2011 at 11:53 PM, Malcolm Box > wrote: > > n 7 June 2011 15:16, Marc Aymerich wrote:You're > right :) I'm using Mysql with myisam, I'm going to switch to > InnoDB engine and try again. > > I

Re: 2 projects based on the same codebase

2011-06-09 Thread Malcolm Box
modifies the common code, you can git push/git pull the changes across between the two root repositories. You could also consider using git submodules to refer to the "master" copy of the calltracking module in the second team repository. Malcolm -- You received this message because y

Re: Re: Odp: Re: signals pre_save vs model's save()

2011-06-07 Thread Malcolm Box
, so could be a great fit for your use case. Malcolm -- 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 django-users+unsubscr

Re: django transactions.

2011-06-07 Thread Malcolm Box
rolls > back any database operation executed by this method, even the > operations executed by submethods called by this main method, right? > So I got this exception but the changes made on the DB during the > method execution still there. > > What database are you using? Does it

Re: Users not logging out

2011-06-07 Thread Malcolm Box
it. - It's possible to add an inactivity timer on the server side, so that if the user isn't seen for a while the session is expired. How to do this is left as an exercise to the reader. HTH, Malcolm -- You received this message because you are subscribed to the Google Groups "D

Re: repr(request.session)

2011-06-07 Thread Malcolm Box
gure it out. Do this by putting "import pdb; pdb.set_trace()" in your code where you're accessing the session. Malcolm -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-user

Re: Odp: Re: signals pre_save vs model's save()

2011-06-02 Thread Malcolm Box
On 29 May 2011, at 15:53, Mateusz Harasymczuk wrote: > W dniu niedziela, 29 maja 2011, 15:36:13 UTC+2 użytkownik Malcolm Box napisał: > On 28 May 2011 11:05, Mateusz Harasymczuk wrote: > I am thinking about splitting my model's save() method over few signals. > > For examp

Re: Disable debug logging for django.db.backends?

2011-06-02 Thread Malcolm Box
#x27;: 'django-db.log' }, }, 'loggers': { 'django' : { 'handlers': ['file_logging'], 'level' : 'DEBUG', 'propagate' : False, }, 'django.db

Re: How to create user on mobile app for Django site?

2011-06-02 Thread Malcolm Box
rse if you choose to do OAuth then you simply sign each authenticated request. This works really well if you want to do some authenticated and some unauthenticated requests. Malcolm -- You received this message because you are subscribed to the Google Groups "Django users" group. To p

Re: signals pre_save vs model's save()

2011-05-29 Thread Malcolm Box
making more than one signal pre_save to the same model? > > It will work, but it's the wrong approach. Malcolm -- 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

Re: choice_set.all()

2011-05-29 Thread Malcolm Box
ror: 'function' object has no attribute choice_set" . :( > can somone help?! > Psychic debugging: you previously typed: p = Poll.objects.get rather than p = Poll.objects.get(pk=1) If you did type the former, then p is a method reference and thus you would get the error above.

Re: primary key auto increment with PostgreSQL and non Django standard column name

2011-05-28 Thread Malcolm Box
You need to tell django what the db column name for your pollkey field is. Look at the dbname field option in the docs. Sent from my iPhone, please excuse any typos On 28 May 2011, at 05:13, Naoko Reeves wrote: > I see if column is set to AutoField then Django won't send INSERT poll_key > as

Re: caching ajax json (post)

2011-05-27 Thread Malcolm Box
o it's probable that whatever was cached before is no longer valid. If you really, really want to do this using Django, it has nothing to do with AJAX or JSON. Just alter your view function to cache the POST response and replay it to the next POST. You get to choose what comes back from

Re: Caught RuntimeError while rendering: invalid label:

2011-05-26 Thread Malcolm Box
On 26 May 2011 20:50, Bobby Roberts wrote: > anyone have any idea what invalid label means? > > Where are you getting this error? What did you do to trigger it? If you can give us more information, it's more likely that someone will be able to help you. Malcolm -- You receive

Re: Admin broken with large data table

2011-05-26 Thread Malcolm Box
On Mar 29, 4:31 pm, Malcolm Box wrote: > On Mar 29, 2:48 pm, Jacob Kaplan-Moss wrote: > > > On Tue, Mar 29, 2011 at 5:56 AM, Malcolm Box wrote: > > > On one of my models, the admin choice_list page is taking minutes to > > > load, which makes it somewhat broken.

Re: Userprofile, signal and admin inline edit.

2011-05-26 Thread Malcolm Box
eate - get_or_create() is your friend here. Malcolm -- 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 django-users+unsubscr...@g

Re: How do you organize your deployment enviroment

2011-05-23 Thread Malcolm Box
on language so not really a problem. I use Chef plus fabric to automate deployments of hundreds of nodes. Malcolm Sent from my iPhone, please excuse any typos On 23 May 2011, at 08:00, DK wrote: > Hi, > > I am having a django project that is being frequently deployed on clean >

Re: Memcached backend - caching data with infinite timeout

2011-05-17 Thread Malcolm Box
On 17 May 2011 11:15, Tom Evans wrote: > On Tue, May 17, 2011 at 11:03 AM, Malcolm Box > wrote: > > That looks like a bug in Django. I suggest you file a ticket. > > > > The fix would be to compare timeout to None > > > > A ticket has already been sub

Re: Memcached backend - caching data with infinite timeout

2011-05-17 Thread Malcolm Box
That looks like a bug in Django. I suggest you file a ticket. The fix would be to compare timeout to None Sent from my iPhone, please excuse any typos On 17 May 2011, at 10:54, Paweł Roman wrote: > Python-memcached docstring for set() says this: > > """ > @param time: Tells memcached the ti

Re: UTF-8 and files automatically created

2011-05-15 Thread Malcolm Box
an be configured to automagically do the conversions. Malcolm Sent from my iPhone, please excuse any typos On 13 May 2011, at 23:56, Michael wrote: > Hello everybody, > > I am a beginner with Django and I was wondering something about UTF-8. > As a matter of fact, the files crea

Re: Problem in Configuring the database

2011-05-08 Thread Malcolm Box
r through socket '/var/run/mysql/mysql.sock' (2)") " > > Almost certainly Mysql isn't running. Try 'ps aux | grep mysql' and see if there's anything listed (except for the grep command). If there's nothing, then 'sudo /etc/init.d/mysqld start

ANN: Two-level caching for Django

2011-05-04 Thread Malcolm Box
ing-to-30k-two-level-caches/ Hope this helps someone. Cheers, Malcolm -- 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 e

Re: Admin broken with large data table

2011-03-29 Thread Malcolm Box
On Mar 29, 2:48 pm, Jacob Kaplan-Moss wrote: > On Tue, Mar 29, 2011 at 5:56 AM, Malcolm Box wrote: > > On one of my models, the admin choice_list page is taking minutes to > > load, which makes it somewhat broken. > > > The table has about 2M rows and about 2.6GB in size,

Re: Help on setting TIME_ZONE to 'UTC'

2011-03-29 Thread Malcolm Box
Look in the docs here: http://docs.djangoproject.com/en/1.3/ref/settings/#time-zone As it says, this doesn't work on Window and will result in the system timezone being used. On Mar 29, 8:58 am, aa bb wrote: > Hi all! I'm a Django newbie. I set TIME_ZONE to 'UTC' in my project > settings.py. Th

Admin broken with large data table

2011-03-29 Thread Malcolm Box
91110#msg-91110 which improves things - from > 10 minutes to 134s - but not enough. It seems this should bite anyone using admin with large tables on InnoDB or Postgres, so perhaps this is a bug? Cheers, Malcolm -- You received this message because you are subscribed to the Google Groups "

Re: Error installing permissions superuser when a userprofile has been defined

2011-03-23 Thread Malcolm Box
#x27;m just creating a superuser manually using ./manage.py shell, but would welcome any ideas on how to solve this better. Malcolm On Mar 23, 10:11 am, Malcolm Box wrote: > Hi, > > I'm running into an error when doing a syncb on a clean DB during the > installation of the aut

Error installing permissions superuser when a userprofile has been defined

2011-03-23 Thread Malcolm Box
dation on how to deal with it. What's the right thing to do? Thanks, Malcolm -- 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 e

Re: Payment Gateways

2011-03-12 Thread Malcolm
61fce3c6c274b38 :-) Malcolm On Mar 8, 6:43 pm, David Zhou wrote: > I use Braintree, and it's been great. > > -- dz > > On Tue, Mar 8, 2011 at 4:40 PM, CLIFFORD ILKAY > > wrote: > > On 03/08/2011 09:59 AM, Bill Freeman wrote: > > >> And I can'

Re: How To Populate A Dropdown List

2011-02-09 Thread Malcolm MacKinnon
outs(request): forms=InvtForm2() etc. return render_to_response('order_closeouts.html', {'forms':forms}, context_instance = RequestContext(request)) in order_closeouts.html {{forms.items}}<--Select Item from complete list On Wed, Feb 9, 2011

Re: How To Populate A Dropdown List

2011-02-09 Thread Malcolm MacKinnon
I forgot to initialize the form in my view. See views.py below. Here's some sample code that works for me: in models.py class InventoryCloseouts(models.Model): prim = models.IntegerField(primary_key=True, db_column='PRIM') # Field name made lowercase. items = models.CharField(max_length=255

Re: using django for google appengine, noob to both.

2010-06-30 Thread Malcolm MacKinnon
You should look at this site: http://www.allbuttonspressed.com/projects/django-nonrel I recommend it over any other django appengine ORM I've tried. I think it can help you with some of your issues. The blog and discussion group is very act

  1   2   3   4   5   6   7   8   9   10   >