Re: Wording in Djang Docs: "per instance" vs "every instance"

2013-02-28 Thread Ivo Brodien
w() a new > instance object of that class is created. So the "per instance" should > be pretty much self explanatory > > On Thu, Feb 28, 2013 at 5:04 PM, Ivo Brodien <i...@brodien.de> wrote: >> Thanks Tomas, >> >> now I got it! Still the origi

Re: Wording in Djang Docs: "per instance" vs "every instance"

2013-02-28 Thread Ivo Brodien
Thanks Tomas, now I got it! Still the original usage of "per" and "every" sounds strange to me.. it should be more like "per instance within a URL pattern", but I am not a native in English, so nevermind. Thanks! On Feb 28, 2013, at 8:54 PM, Tomas Neme wrote: >> This approach applies the

Wording in Djang Docs: "per instance" vs "every instance"

2013-02-28 Thread Ivo Brodien
Hello, in the Django Docs for Class Based Views[1] it says under the green box: This approach applies the decorator on a per-instance basis. If you want every instance of a view to be decorated, you need to take a different approach. I don't quite get that, since "per instance" and "every

Re: Highlighting Active Navigation Link - correct approach?

2012-01-10 Thread Ivo Brodien
Hi, strange that nobody answered yet since I guess that almost everybody encountered the same question already. I personally did it via a custom template tag which puts out active if the current URL matches the URL pattern for a view. Cheers Ivo On Jan 9, 2012, at 7:27 , Victor Hooi wrote:

App for manage renting/booking management

2012-01-08 Thread Ivo Brodien
Hi, does anyone know of a Django app that handles the bookings and renting of a house that can be rented. I imagine something like this: - forms for booking - in the admin: - status management of the booking inquiries - sending out payment confirmations - maintaining a

Re: Is models.DateTime timezone aware ?

2012-01-08 Thread Ivo Brodien
Hi, I did not read the details of your question, but I can tell you that Django will be timezone aware in 1.4. https://docs.djangoproject.com/en/dev/releases/1.4-alpha-1/#support-for-time-zones cheers Ivo On Jan 8, 2012, at 0:40 , Matěj Cepl wrote: > I have in my first Django app this model

Re: Skip upload of existing S3 Object

2012-01-01 Thread Ivo Brodien
Hi, the form sends the picture to S3 and then S3 calls you on an URL which you specify with “ success_action_redirect”. This should point to an URL on your server where you then store the key/hash which will be provided in the URL. Your code uses POST data but S3 will put the metadata in the

Re: Why when upload PDFs, Django says the content type is "application/text"?

2011-12-25 Thread Ivo Brodien
> I was getting "application/pdf" a few days ago with same client, > server, browser, etc. If this really is the case and the code is exactly the same, maybe it depends somehow on the PDF itself? Did you check that? -- You received this message because you are subscribed to the Google Groups

Re: Confused by STATICFILES_DIRS not working

2011-12-16 Thread Ivo Brodien
Hi, I am not trying to understand what you did but just tell you how t works for me: PROJECT_PATH = os.path.realpath(os.path.dirname(__file__)) STATIC_ROOT = os.path.join(PROJECT_PATH, 'static') STATIC_URL = '/static/‘ INSTALLED_APPS = ( ... 'django.contrib.staticfiles’, ) I have no

Re: Creating websites like Amazon/Ebay using Django

2011-12-16 Thread Ivo Brodien
and keep in mind, that you don’t have to reinvent the wheel. There are open source solutions for shops: Like: http://www.getlfs.com/released-06-beta-1 cheers On Dec 16, 2011, at 11:17 , Joey Espinosa wrote: > Cata, > > Yes, Django is exactly suited for this scenario. The structure of Django

Re: 2 questions about Django

2011-12-14 Thread Ivo Brodien
> 1) Can I make a site like this one (http://www.tamarawobben.nl) with > Django. > Till now I find no solution which I can have different numbers of > articles on pages. Yes, of course you can. You can almost do anything with Django as django to put it simply mainly will output HTML Code which

Re: Website Statistics - What should I use to have Google Analytics in Django?

2011-12-01 Thread Ivo Brodien
>> Out of curiousity: > > Is there anything similiar which does work well in an intranet > environment or an environment, where one does not want to send data to a > third party server? Not Django but Piwik (MySQL, PHP) can do this. http://piwik.org/ -- You received this message because you

Re: A view associated with a lot of urls

2011-11-30 Thread Ivo Brodien
> Well I agree that if the category doesn't exist he will get a 404. But > if the Category exists and there are no items in the 'table', it will > not be empty, it will also raise a 404 too. That's why I wrote : > >> However with that, there is no way for example to make a difference >> between

Re: A view associated with a lot of urls

2011-11-30 Thread Ivo Brodien
> I don't quite understand what you mean here. You want me to create a > CategoryModel of which all my Category models should be derived ? If > that's it, how can it help me to determine if URL is valid or not, I > can't see how that works. Sorry, it was DrBloodmoney, who wrote this: > class

Re: A view associated with a lot of urls

2011-11-30 Thread Ivo Brodien
Hi, > That's why I'm > considering checking at the beginning of the view with a list/dict > filled with category names and one filled with item names to make sure > that the category is in the list/dict and same for the item before > hitting the database, and if not respond with a 404. As

Re: Authentication backend

2011-11-25 Thread Ivo Brodien
Hi, You provided no code, no question, no error, would be a miracle if somebody would be able to help you. Cheers Ivo On Nov 25, 2011, at 6:29, shaini sasidhar wrote: > Hi... > > I had configured Django admin site with MySQL database and it > works fine..But

Re: iterating through lists in templates

2011-11-25 Thread Ivo Brodien
{% for image in images %} {{ image }} If you need numbers there are counters for for-loops On Nov 25, 2011, at 14:18, marjenni wrote: > {% for i in numberOfImages %} -- You received this message because you are subscribed to the Google Groups "Django users"

Re: iterating through lists in templates

2011-11-25 Thread Ivo Brodien
You should pass a list of images to the template and iterate over this list. On Nov 25, 2011, at 14:18, marjenni wrote: > Hi all, > Why does this not work? > >{% for i in numberOfImages %} > > {{ images.i}} > > numberOfImages is the

Re: Reverse and variables in template

2011-11-24 Thread Ivo Brodien
Don't use brackets around the variables. On Nov 25, 2011, at 1:48, youpsla wrote: > Hello, > > The following line in my template return an error: > Modifier > > Error is: > Could not parse the remainder: '{{' from '{{' > > If i use (has view in the doc): > Modifier > it

Re: Installation of Django

2011-11-24 Thread Ivo Brodien
> windows users have extracted your command will look like this: ... > to execute the .tar file. as tom mentioned, you have to use 7zip two times. the tar file is another archive (like .zip, .gz ) which you have to decompress and then you have the django directory and you can go on with

google always finds development version first

2011-11-24 Thread Ivo Brodien
Hi, although I know i should bookmark things, but often I find myself googling for some django docs and google always shows the development version. Wouldn’t it be more useful, if the docs of the latest release would be shown first? I understand it might be googles algorithms of showing the

Re: Seeking example of django.contrib.staticfiles usage

2011-11-24 Thread Ivo Brodien
> 3) Have django.contrib.staticfiles to serve static content (perhaps > non-optimally) from the Django runtime. this is just for developing purposes. 1) 2) are the ways to go. > Is there a simple example of #3 (the only one that lets me package up > a complete "app")? > > I've read: >

Re: Django : CSRF and variable handling in a view

2011-11-24 Thread Ivo Brodien
gt; again ( which would be a nonsense and in my opinion a flaw ),this is > my signup form view which is located at /subscribe/. > > Is it better with these explications or does the approach I'm taking > still feel weird ? > > Nolhian > > On Nov 24, 1:37 pm, Ivo Brodien <i..

Re: Django : CSRF and variable handling in a view

2011-11-24 Thread Ivo Brodien
DrBloodMoney is right, It is kind of odd how you are solving the problem but it might me kind of right depending on what you are trying to do. Considering how most of the websites work you should do this. In all the templates include another template which does this: {% if not

Re: Named URLs Error

2011-11-24 Thread Ivo Brodien
forget my previous post, it is wrong. > /templates/products/index.html > -- > Products > > Error > -- > In template

Re: Named URLs Error

2011-11-24 Thread Ivo Brodien
Not sure but I think you have to put {% load tags %} in your template. On Nov 24, 2011, at 6:07 , eeyore wrote: > This seems like a very simple problem but I can't figure out why it > doesn't work. > > What I am trying to do is to link to a particular view via a named > url. > > > /urls.py

Re: Very strange KeyError on 'PORT' in db/backends/mysql/base.py

2011-11-23 Thread Ivo Brodien
just another wild guess: in django/db/utils.py Line 84: for setting in ('NAME', 'USER', 'PASSWORD', 'HOST', 'PORT'): conn.setdefault(setting, ‘’) It looks like PORT is set to ‘’ instead of 3306 if missing. But still it should be in the dict. really strange, yes. -- You

Re: Very strange KeyError on 'PORT' in db/backends/mysql/base.py

2011-11-23 Thread Ivo Brodien
> * Colleagues have been unable to reproduce this using very similar stacks > which could mean it's OS related to threading or something really low-level. > Sigh... maybe I did a wrong search, but I did grep -r '3306’ . inside the django directory and could not find a place where the

Re: displaying images

2011-11-23 Thread Ivo Brodien
Hi, did you read and do the tutorials? If not do it and you will learn a lot. [1] In the tutorial you would learn that you would not want to write HTML code inside a view (function) but in a HTML template. You should also read about how to server static media.[2] [1]

Re: 'function' object has no attribute 'as_view'

2011-11-23 Thread Ivo Brodien
> I've done the test with another class, it's the same. Then I think > @login_required works only for function and not for Class. https://docs.djangoproject.com/en/dev/topics/class-based-views/#decorating-class-based-views explains how to use decorators for classes. -- You received this

Re: How-to for static files?

2011-11-23 Thread Ivo Brodien
sue was just not using RequestContext, > right? Either way, thank you SO much. I have been stuck at this point for > months! I can now TRULY begin working on my website. Wow. Thank you. So. > Much. > > best, > Guillaume > > On Wed, Nov 23, 2011 at 9:53 PM, Ivo Brod

Re: How-to for static files?

2011-11-23 Thread Ivo Brodien
e expected HTML source--basically, exactly > what I have in the template file, except {{ STATIC_URL }} has been changed to > '/static' and all of the template tags have been replaced by actual values. > So yes, I think that it's just not rendered. What could cause this? > > thanks,

Re: Django : CSRF and variable handling in a view

2011-11-23 Thread Ivo Brodien
no problem. > I also pass has_account=True in the view if the user is authenticated. in this case in your template you can just do: {% if user.is_authenticated and user.is_active %} That is the advantage of using RequestContext. -- You received this message because you are subscribed to the

Re: 'function' object has no attribute 'as_view'

2011-11-23 Thread Ivo Brodien
yeah, very strange. > url(r"magasin/(?P\d+)/evenement/new/$", > EvenementCreateView.as_view(model=Evenement), > name='new_evenement_magasin'), and you are sure the error is caused by the line above? Commenting it out and works? Just asking, since you did not provide the whole error description?

Re: How-to for static files?

2011-11-23 Thread Ivo Brodien
ite a while. I > think we're getting close! =) > > thanks, > Guillaume > > On Wed, Nov 23, 2011 at 8:08 PM, Ivo Brodien <i...@brodien.de> wrote: > you did not read the post by Tom Evans, did you? ;) > > remove "django.core.context_processors.tz”, > > or j

Re: How-to for static files?

2011-11-23 Thread Ivo Brodien
.framework/Versions/2.7/lib/python2.7/site-packages'] > Did something happen to my context.py file? Here it is: > > http://dpaste.com/660778/ > > Also, as you can see from the error message above, I am currently using > Django 1.3.1. > > > thanks, > Guillaume > >

Re: 'function' object has no attribute 'as_view'

2011-11-23 Thread Ivo Brodien
does this work? ... (r"magasin/(?P\d+)/evenement/new/$",EvenementCreateView.as_view(model=Evenement,)), ... I haven’t used Class based Views yet, but everytime they show up in the docs it is always without using the url function and giving a name. So this is just a wild guess. It seems like

Re: How-to for static files?

2011-11-23 Thread Ivo Brodien
the CSS shows up if I open the template file directly > using a browser. But it still doesn't show up when loading up the page on > the development server. > > thanks, > Guillaume > > On Wed, Nov 23, 2011 at 9:57 AM, Ivo Brodien <i...@brodien.de> wrote: > Hi,

Re: Django : CSRF and variable handling in a view

2011-11-23 Thread Ivo Brodien
> What about passing a variable set to False ? Should I still pass it > like so : > return render(request,'index.html', {'form': form, > 'has_account':False}) > Or is it useless to pass it ? Since you hardcode it to be False, yes it useless also to check in the template. If the variable is

Re: How-to for static files?

2011-11-22 Thread Ivo Brodien
t; > And here is my urls.py file: > > http://dpaste.com/660568/ > > Let me know if anything else is needed, such as the views.py file or > something. > > thanks, > Guillaume > > On Wed, Nov 23, 2011 at 7:33 AM, Ivo Brodien <i...@brodien.de> wrote: > In your

Re: How-to for static files?

2011-11-22 Thread Ivo Brodien
ee if it worked and it didn't. I checked the page source again and it's > still looking for /view/stylesheet.css. Am I missing something else? > > thanks, > Guillaume > > On Tue, Nov 22, 2011 at 10:42 PM, Ivo Brodien <i...@brodien.de> wrote: > >> Finally,

Re: How-to for static files?

2011-11-22 Thread Ivo Brodien
Does your generated HTML source say: ?? In your settings the TEMPLATE_CONTEXT_PROCESSORS should have: “django.core.context_processors.static” The CSS File should go into a folder: myapp/static/stylesheet.css > urlpatterns += staticfiles_urlpatterns() I think you don’t need this. If you

Re: How-to for static files?

2011-11-22 Thread Ivo Brodien
>> "django.core.context_processors.tz", > > ISTR that this context processor (tz) only exists in trunk. So if he > puts this literal block in, he will almost certainly have other > issues. True. sorry, since this is the default it should be there anyways. my mistake. And yes, it was copied

Re: How-to for static files?

2011-11-22 Thread Ivo Brodien
> Finally, I have another question. In my settings.py file, there is actually > no section for TEMPLATE_CONTEXT_PROCESSORS. I have noticed in the > documentation yes. put this in there: ("django.contrib.auth.context_processors.auth", "django.core.context_processors.debug",

Re: Editable datagrid

2011-11-21 Thread Ivo Brodien
> Can't this be done in django itself? Without resorting to java, ajax > and other fancy stuff? Yes, it does. Did you try the tutorials? the admin is probably what you are looking for but should only be used by staff. -- You received this message because you are subscribed to the Google

Re: copy entire data base to another host

2011-11-20 Thread Ivo Brodien
Hi, no problem. > Thanks a lot. Yes this is definitely an option if source and target host > the same database engine. > > > The reason why would I like to avoid this approach and why I tried to > stick with django commands is, that above approach will not work if I > want to dump a postgres

Re: copy entire data base to another host

2011-11-20 Thread Ivo Brodien
hi, on MYSQL I just do this to copy a MySQL DB to my local machine which runs in MAMP on Mac OS X. Something similar should be possible with PostgreSQL as well. ssh USERNAME@SERVER "mysqldump -u USERNAME_REMOTE -p'DB_PASSWORD_REMOTE' --single-transaction DB_NAME | gzip -c" | gunzip -c |

Re: Custom admin changelist queryset

2011-11-18 Thread Ivo Brodien
Both Bar and Foo obviously have a featured table and are somehow very common since you want them to be displayed in on list - which also makes only sense if they share the same attributes cause otherwise you would have empty columns depending on the model of the row your are showing. Maybe

Re: Custom admin changelist queryset

2011-11-17 Thread Ivo Brodien
Well the admin.ModelAdmin expects to be working, for one model only (knowing about its table structure). Can you tell us what you goal here is? Probably you want to show more information than there is in one model? You can create methods in your model and use them to show more information like

Re: controlling user access

2011-11-17 Thread Ivo Brodien
Do you want to use the admin for administration? You should not, since the admin is designed to be used by people that can be trusted, although it can be done, by overriding queryset method of the ModelAdmin. As stated before, make a page where a user selects the business and afterwards you

Re: Manage exception from external services in a form

2011-11-16 Thread Ivo Brodien
Hi, As stated in the answer on SO you should write a custom clean method for your field. Bye On Nov 16, 2011, at 5:31, youpsla wrote: > Sorry, > > I've not search enough, > > I think this post : >

Re: Why does collectstatic finds static files in admin 'media' directory?

2011-11-15 Thread Ivo Brodien
and allow the files to remain in "media" rather than "static". > > Regards > Phil > > On 15/11/2011 16:34, Ivo Brodien wrote: >> Hi, >> >> on 1.3.1. I ran: >> >> ./manage.py collectstatic --dry-run >> >> and it fou

Why does collectstatic finds static files in admin 'media' directory?

2011-11-15 Thread Ivo Brodien
Hi, on 1.3.1. I ran: ./manage.py collectstatic --dry-run and it found files in: django/contrib/admin/media/ which is fine, but I am wondering, why these files are found since the docs says, that the default folder apps have to store there static assets is a folder called “static”. I haven’t

Re: Automatically direct unauthenticated users to homepage

2011-11-15 Thread Ivo Brodien
Hi, these views are protected by @login_required view, right? If so, users that are not logged in should be redirected to the login view. If you are not using the decorator, how are you handling users that are not logged in these different views? You are probably doing something against the

Re: What's the best way to display user information in the base template?

2011-11-15 Thread Ivo Brodien
Hi, you are basically asking how views and templates work in django. I suggest start with the django tutorials [1] and then you will understand that what you are trying to do is nothing special. You might want to use a decorator called “@login_required” vor your views which show user info.

Re: Network configuration with django webpage

2011-11-12 Thread Ivo Brodien
You will have to make some system calls from your django views (in python of course) Cheers On Nov 12, 2011, at 6:22, Ganesh Kumar wrote: > Hi guys, > > I am new to django, I want to create a simple page to configure > network configuration, > to configure ip address and

Re: models.FileField versus forms.FileField

2011-11-10 Thread Ivo Brodien
Hi, > But to clarify it seems like the forms.fileField can be used in a model in > place of models.filefield, as in the code below. > class UploadFileForm(forms.Form): >title = forms.CharField(max_length=50) >file = forms.FileField() In your code you are using only forms, no models

Re: Editing objects from the admin site isn't working

2011-11-09 Thread Ivo Brodien
Can you see the edits in your DB? Did you write code for the admin of that model yourself ? On Nov 9, 2011, at 17:05, Tim Ogilvie wrote: > I'm running into a problem editing from the admin site. I'm able to > successfully create new objects but edits aren't being saved.

Re: models.FileField versus forms.FileField

2011-11-09 Thread Ivo Brodien
Hi, well they are different things. models.FileField is used to define a field of a model (usually to store in a DB, metadata in this case) The forms.FileField defines a field in a HTML form which can receive File uploads and then can be used to do sth on the server. I think you will get the

Re: Django as a Standalone Desktop Application

2011-10-21 Thread Ivo Brodien
Hi, > Could you tell us more about the utility you want to create? It sounds like > Django might not be the appropriate tool in this case. well it is quite simple. The user will have to provide some metadata for every week of the year. This then gets printed to a monthly view with the 4

Django as a Standalone Desktop Application

2011-10-21 Thread Ivo Brodien
Hi, I want to write a little utility for somebody and I would like to use Django to develop it. At the moment the utility does not need/or never will have to be running on a web server. I would like to build a little standalone desktop app, so that I can send the Django App and everything

Re: Creating simple view app based on Admin site

2011-06-24 Thread Ivo Brodien
Some time ago I ran into similar questions and what I found out is: the bottom line: the admin is intended for admins and stuff, not users. That is people you trust, so you should never enable admin access for regular users. So I guess you are on the right way with copying from the admin views

Re: django 1.3 timing out on empty POST request

2011-06-24 Thread Ivo Brodien
On Jun 24, 2011, at 2:40 AM, mehdi ait oufkir wrote: > block = getattr(request, POST, { }) shouldn’t it be: block = getattr(request, ‘POST', { }) ? What are you trying to do? Can you post the rest of the view function? -- You received this message because you are subscribed to the

Re: Field Type for S3 Storage?

2011-06-16 Thread Ivo Brodien
> How does the |mageField know the dimensions of the image? Nevermind. Just saw that the file gets opened for the dimension by looking at the source code. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Field Type for S3 Storage?

2011-06-16 Thread Ivo Brodien
hello, I am planing a django application, which manages photos that are stored in a S3 Bucket. With boto and django-storages I can declare an ImageField and images get uploaded to S3 easily. But I want to make a mobile client use an API to upload photos directly to S3 (using signed Forms)

Re: syncdb doesn't create UserProfile table

2011-06-16 Thread Ivo Brodien
> In the paragraph preceding this link it explicitly states to use > OneToOneField. The Django documentation is canonical, if it says one > thing, and elsewhere on the internet says something else, the internet > is wrong. The internet is often wrong. > > The difference between a

Re: syncdb doesn't create UserProfile table

2011-06-16 Thread Ivo Brodien
>> Actually, I've read that ForeignKey is now the way to specify it. > > unique foreign key *was* the correct way as onetoone was broken. This is > no longer true. where is the most up to date info on this? In the dev docs about storing additional user info on djangoproject.com there is a

Should/Can I use API methods for other views? (django-piston)

2011-06-16 Thread Ivo Brodien
I was wondering if I can/should access the API methods I use with django-piston. Lets say I want to get some objects belonging to a user in the read API method. On a web request that does not use the API call but is a simple request from a browser client should my view than call the read method

Re: syncdb doesn't create UserProfile table

2011-06-16 Thread Ivo Brodien
an idea: Do you have a __init__.py in every subfolder? also the models and userprofile folder under calltracking_main ? On Jun 16, 2011, at 10:10 AM, Benedict Verheyen wrote: > Hi, > > > The syncdb command doesn't want to create the UserProfile table. > Also when I was trying to get this

Re: unique constraint

2011-06-15 Thread Ivo Brodien
https://docs.djangoproject.com/en/1.3/ref/models/options/#unique-together On Jun 15, 2011, at 9:40 AM, Tobias Ottenweller wrote: > hi, > > a had a look at the django documentation but I could not find a way to do > something like this in django: > > > CREATE TABLE test_table ( >id

Printing admin is strange except in Safari

2011-06-15 Thread Ivo Brodien
Hello, I have an admin action which produces a table of selected items. I used the admin base_site template so I have the ability to go back easily. I did: {% extends "admin/base_site.html" %} ... {% block content %} {% for participant in participants %} ...

Re: GET vs POST for read-only views

2011-06-14 Thread Ivo Brodien
> thanks - in 15 years of web programming I have never used get - maybe > time to start now. ?? that would mean, that none of your website was ever reachable by entering the URL in a browser. Remember: all links you put on a webpage will be GET requests made by the browser, when you click on

Re: imagefield problem .....

2011-06-13 Thread Ivo Brodien
> On Jun 13, 2011, at 5:57 PM, Pankaj Singh wrote: > >> yes even in get_image_url it will be >> >> return os.path.join(settings.MEDIA_URL, 'news', >> self.image.name.split('/')[-1]) > writing that function is not necessary. from:

Re: imagefield problem .....

2011-06-13 Thread Ivo Brodien
On Jun 13, 2011, at 12:52 PM, Pulkit Mehrotra wrote: > problem in using the address stored in imagefield you should describe your problem a little better! But I guess the URL is not working? You shouldn’t use STATIC_URL but MEDIA_URL for the prefix in your template. STATIC_URL is for static

Re: How to disable security hash in django comments

2011-06-06 Thread Ivo Brodien
search for csfr excempt decorator. On Jun 6, 2011, at 4:35 PM, Ján Vorčák wrote: > Hi, > > I'd like to ask you about one problem. > I need to remove security hash django comments module. I need to allow > posting to my app from external application just by posting the post > request. > How can

Re: Need some help with MySQL and on OSX

2011-06-06 Thread Ivo Brodien
> MAMP. about as easy as it can get. > http://www.mamp.info/de/index.html But you will still need to install somehow MySQLdb and that is the main problem. I don’t know about homebrew, but I remember that I had troubles getting MySQLdb to work but I eventually did with the help of various

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

2011-06-02 Thread Ivo Brodien
Hey Malcom, thanks for the answer. Glad, I was more or less on right way. >> How would I authenticate against the Django site? > > Your choices are either to use username/passwords or OAuth. If you're using > username/passwords you can hook straight into the standard Django > authentication

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

2011-05-31 Thread Ivo Brodien
Thanks for sharing your opinion! Your approach is probably good for many website/applications, but since I want to make use of InApp Purchases and Camara Overlays and Custom Controls, I don’t think this is the right way to go. I was impressed by PhoneGap though... 2 or 3 years ago I was seeing

Re: How to I create download link of some file using django

2011-05-31 Thread Ivo Brodien
you are welcome! > I have another question here. It seems that django.contrib.staticfiles > can be used to handle some static files during the 'debug' mode while > using the embedded 'runserver' from django. However, would it be > possible if I just develop my website using the system's Apache

Re: How to I create download link of some file using django

2011-05-31 Thread Ivo Brodien
> I am a bit confused about how to set the MEDIA_URL variable here. > Currently, I am testing the web using Django embedded webserver and > doesn't have a proper url yet. Should my MEDIA_URL be something > like... http://my_machine_name:8000/media/ yes, but so in your template you do: > ### in

Re: How to I create download link of some file using django

2011-05-31 Thread Ivo Brodien
Hi did you read this documentation about serving static files? In generally you don’t want serve files through django, but through your actual webserver (e.g. Apache, nginx, lighttpd...). However during development you can make django serve them. See: Serving static files in development

How to create user on mobile app for Django site?

2011-05-31 Thread Ivo Brodien
What is the correct way to do the following: 1) Mobile App from which a user can create a user/profile on the Django site 2) Allow authenticated users to create on the site and query personalized data from the site This is what I guess I have to do: 1) Create a REST API (probably with e.g.

Re: Caught KeyError while rendering: u'objects_name'

2011-02-13 Thread Ivo Brodien
Hi, when the admin is deleting an object it gathers a list (calling all unicode methods) of other foreign key objects and displays them as a warning that they will also be deleted. I think the error occurs in: > class Disposition (models.Model): > [] >def __unicode__(self): >

Re: Admin URL validation too strict?

2011-02-10 Thread Ivo Brodien
I just checked and my admin accepts (and correctly validates it) the port inside a URL. In django.core.validators.py you can see, that the port is accepted. On 10.02.2011, at 22:55, ringemup wrote: > > Er, Correction > > It's not an anchor that's causing problems, but a port

new Admin class for each pre-filtered change list?

2011-02-09 Thread Ivo Brodien
I am using the following code, so that I can have different change lists that depend on some variable. The way the stuff member does not have to manually apply the filter each time he/she enters the list: class CourseApplicationAdminS12(CourseParticipantAdmin): year = 2012 def

Re: imported tuples/variables don't get translated

2011-02-08 Thread Ivo Brodien
hey Marcos, > Are you doing: from django.utils.translation import ugettext_lazy as _ ? > or: from django.utils.translation import ugettext as _ ? > > The first one shoud work. Indeed I used ugettext instead of ugettext_lazy Thanks! -- You received this message because you are subscribed to

imported tuples/variables don't get translated

2011-02-08 Thread Ivo Brodien
If I import some tuple which is used for choices in a forms.RadioSelect widget, then the choices don’t get translated models.py: BOOL_CHOICES = ((True, _(u'Yes')), (False, _(u'No'))) forms.py: from models import BOOL_CHOICES 1) does work an translates the choices

Re: model names

2011-02-06 Thread Ivo Brodien
On 06.02.2011, at 18:01, Bobby Roberts wrote: > yeah i tried that already and it didn't work did you also define the meta class for the Admin class? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: user full name in template

2011-02-04 Thread Ivo Brodien
> Don't forget the login_required decorator, because if an anonymous > user try to get that page he will get an exception (I think, didn't > try that) No, they will be redirected to login and after login they come back to the original page, if the form considers the ’next’ field. How nice is

Delete/Update Memcache in 1.2.4?

2011-02-03 Thread Ivo Brodien
Which key is used in 1.2.4 to create the memcache keys? I am having some html in my database whose keys I want to delete from the memcache after they have been saved (or via admin actions) I don’t know how to get their keys and even doing a cache.clear() in the action and console did not

Re: store superuser permamently

2011-02-03 Thread Ivo Brodien
> What do I have to do to avoid having to define a superuser each time? you can dump the data of the auth app and than load it again. s.th. like this: ./manage.py dumpdata --indent=4 auth > fixtures/auth.json ./manage.py dumpdata --indent=4 sessions > fixtures/sessions.json you can do a

Re: Memcache configured, but not used !?

2011-02-03 Thread Ivo Brodien
On 03.02.2011, at 13:38, Tom Evans wrote: > You don't specify what version of django you are using. I suspect you > are referring to the trunk/1.3 docs, and using 1.2. In 1.2, the cache > is controlled by settings.CACHE_BACKEND, which defaults to locmem if > omitted. You are right I am using

Re: Memcache configured, but not used !?

2011-02-03 Thread Ivo Brodien
On 03.02.2011, at 13:39, Xavier Ordoquy wrote: > I'm not sure it is. > Can you make sure you are using django 1.3 ? > in the shell do: > import django > print django.VERSION > > If it says 1, 2, whatever, your configuration isn't correct as CACHES is for > 1.3 > > Xavier. ahh! ok. I was

Re: Memcache configured, but not used !?

2011-02-03 Thread Ivo Brodien
Hi! > I assume you configured the cache backend to point to memcache, didn't you ? yes :) in my settings.py I have CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.dummy.DummyCache', } } try: from local_settings import * except ImportError:

Re: Django SQL Query does not stop

2011-02-03 Thread Ivo Brodien
t often runs way faster if the query is simplified. > > Regards > Chris > -Original Message- > From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On > Behalf Of Ivo Brodien > Sent: 01 February 2011 23:49 > To: django-users@googlegroups.co

Memcache configured, but not used !?

2011-02-03 Thread Ivo Brodien
I did the following to enable memcache: 1 ) install memcache and it is running with default values: /usr/bin/memcached -m 64 -p 11211 -u nobody -l 127.0.0.1 2) put a decorator over my view @cache_page(60 * 2) 3) enable cache panel in debug toolbar The Problem is, that the edebug panel says 0

Re: Django SQL Query does not stop

2011-02-01 Thread Ivo Brodien
and it made the optimizer search a long process. So at the moment a value of 3 is fine. On 01.02.2011, at 21:20, Ivo Brodien wrote: > The Change List that I am calling is a Intermediate Table if that is of any > interest. > > Is it possible that there is some sort of circular

Re: Django SQL Query does not stop

2011-02-01 Thread Ivo Brodien
The Change List that I am calling is a Intermediate Table if that is of any interest. Is it possible that there is some sort of circular inner joints or something? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: Django SQL Query does not stop

2011-02-01 Thread Ivo Brodien
On 01.02.2011, at 16:55, Tom Evans wrote: > In the mysql shell: > > EXPLAIN SELECT ... unfortunately same problem. CPU turns to 100% and it is stuck. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Django SQL Query does not stop

2011-02-01 Thread Ivo Brodien
When I am in admin and I access of a certain model, Django calls mysql with an Query which increases mysql CPU load to 99% and it never returns. If I copy the the SQL Query right into mysql the same thing happens, so it is actually kind of a mysql problem, but since Django created the query, I

  1   2   >