Re: List of available Jinja2 global symbols

2015-11-22 Thread Jirka Vejrazka
Hi there, I'm not a Jinja2 user, but standard Django templates get these variables via context processors‎. Check out https://docs.djangoproject.com/en/1.8/topics/templates/#context-processors HTH   Jirka

Re: how to mock REST calls during development?

2015-05-27 Thread Jirka Vejrazka
Hi Abraham, I guess my advantage is that my applications are quite tightly coupled, so I can set some flags in settings.py. The key point is that I'm importing class instance from my API code. That instance represents either the real endpoint or mocked endpoint based on some flags in

Re: how to mock REST calls during development?

2015-05-25 Thread Jirka Vejrazka
Hi Abraham, I needed to solve this a few months ago, decided to use https://github.com/getsentry/responses The way I did this is that I have a function that sets all required responses (using the endpoint URL and the expected response in a file). Then I detect in the application setup (apps,

Re: TIMEZONE

2015-04-08 Thread Jirka Vejrazka
Hello there, you probably need to take a look at the USE_TZ setting too. If it's True, then Django will store all times in the UTC timezone and only use the one you configured in views and templates (and a few other places). In most cases, that's what you want anyway as it's the most

Re: subprocess behave diferent in the server than in the client.

2015-03-31 Thread jirka . vejrazka
It's very likely that the actual user running the webserver process(es) does not have "ping" on the executables path... HTH Jirka -Original Message- From: dk Sender: django-users@googlegroups.com Date: Tue, 31 Mar 2015 08:12:03 To:

Re: DateTimeField: Hide clock

2014-10-23 Thread jirka . vejrazka
Look at the "date" filter in template documentation, allows you to customize the output. HTH Jirka -Original Message- From: Oskar Lyrstrand Sender: django-users@googlegroups.com Date: Thu, 23 Oct 2014 03:28:10 To:

Re: how to query max count

2014-10-13 Thread Jirka Vejrazka
Hi there, you could do it manually by counting occurrences or you could take a look at aggregation functions here: https://docs.djangoproject.com/en/1.7/topics/db/aggregation/ Do as it suits your use case. HTH Jirka On 13 October 2014 06:30, dk wrote: > I am

Re: running script in django database

2014-07-30 Thread jirka . vejrazka
Hi Mohammad, this can be easily achieved using a custom management command - check the Django documentation. HTH Jirka -Original Message- From: alghafli Sender: django-users@googlegroups.com Date: Wed, 30 Jul 2014 07:02:59 To:

Re: Full text search available on PostgreSQL?

2014-07-08 Thread jirka . vejrazka
Also, not directly tied to ModelAdmin, but you might want to take a look at django-watson. HTH Jirka -Original Message- From: Johannes Schneider Sender: django-users@googlegroups.com Date: Tue, 08 Jul 2014 09:26:07 To:

Re: Mysql DB local socket access errors with mod_wsgi

2014-05-28 Thread jirka . vejrazka
It's very likely a permissions problem. Webserver processes tend to run under a special username (e.g. www-data) with very limited permissions - it's likely that this user does not have access to the socket file. HTH Jirka -Original Message- From: Henning Sprang

Re: How to combine multiple querysets and remove duplicates?

2014-01-09 Thread Jirka Vejrazka
Hi Lewis, looks like you already got the answer - using Q() objects helps a lot. I'll just add two things that might help: - it's possible to prepare filters in advance which helps readability and code structure. I often do something similar to this: from django.db.models import Q filters =

Re: Save the user from one model to the another model

2013-12-03 Thread jirka . vejrazka
You're probably looking for something along the lines of: thread = Thread.objects.get(id=) msg = Message.objects.get(id=) thread.user.add(msg.sender) Look at add() and remove() methods in documentation (search for related managers). FYI - it's a good practice to name fields that use

Re: Best practice for server-generated downloads?

2013-10-02 Thread Jirka Vejrazka
Hi Thomas, I'm doing exactly this - allowing users to download (graphically simple) XLSx files from my web app, it also needs to be available for download weeks later. As Russell pointed out, you don't need to store data on this if you have a way of getting the same set of data later, you can

Re: implement gmail type address adding functionality in django

2013-08-05 Thread jirka . vejrazka
(not on a PC now) You're looking for quite common functionality - search you favourite search engine for combination of Django, Ajax and "typeahead" HTH Jirka -Original Message- From: roopasingh...@gmail.com Sender: django-users@googlegroups.com Date: Mon, 5 Aug 2013 00:50:06

Re: Getting URL root

2013-07-02 Thread Jirka Vejrazka
> I know them, but I need to programmatically get it in a way that works everywhere. Sorry, you can't. You might be able to do in in some circumstances, but not reliably "everywhere". There is too many unknowns involved if you are out of the request-response cycle (e.g. named virtual hosts, CNAME

Re: Getting URL root

2013-07-02 Thread Jirka Vejrazka
If you need it when you already have a request object, (i.e. not during initial setup/install), check out request.META options in the documentation. HTH Jirka On Tue, Jul 2, 2013 at 8:43 AM, Larry Martell wrote: > On Mon, Jul 1, 2013 at 7:55 PM, Sithembewena

Re: Model Error

2013-06-19 Thread jirka . vejrazka
Hi Nigel, You have a spelling error in the word "unicode" in the TextFile method. Cheers Jirka -Original Message- From: Nigel Legg Sender: django-users@googlegroups.com Date: Wed, 19 Jun 2013 06:51:21 To: Reply-To:

Re: Settings object has no attribute 'ROOT_URLCONF' while deploying using apache and mod_wsgi

2013-03-17 Thread jirka . vejrazka
I'd look at how you reference your settings during imports. The error message spells "Settings" with uppercase "S" which feels incorrect. HTH Jirka -Original Message- From: Navid Shaikh Sender: django-users@googlegroups.com Date: Sun, 17 Mar 2013

Re: Call Class based view from another class based view

2013-02-19 Thread Jirka Vejrazka
You have ShowAppsView.as_view()(self.request) at the end of the code you pasted below. That means that you get result of the ShowAppsView which gets immediatelly discarded ("forgotten") because you don't do anything with it. You probably want return ShowAppsView.as_view()(self.request) but

Re: Is there an easy way to popup forms?

2013-02-13 Thread jirka . vejrazka
Probably the easiest way is to use a JS/CSS framework that has a good support for popups and forms. There are a lot out there. I have personal experience with Bootstrap (one of the most popular these days) - check its documentation (look for both "popup" and "modal"), also search for available

Re: F function?

2013-01-31 Thread Jirka Vejrazka
Pro tip: if you find yourself in a similar situation again, try searching Django code for "def F(" and "class F(" - that should narrow your search a bit :) Cheers Jirka On Fri, Feb 1, 2013 at 6:14 AM, Chad Vernon wrote: > Nevermind, found it! Was having a hard

Re: Relations to unknown models?

2013-01-23 Thread jirka . vejrazka
Hi galgal, You might want to take a look at django.contrib.comments (either use it or learn from it) and/or GenericForeignKey. HTH Jirka -Original Message- From: galgal Sender: django-users@googlegroups.com Date: Wed, 23 Jan 2013 14:48:55 To:

Re: ajax

2012-12-19 Thread jirka . vejrazka
Yes -Original Message- From: Randa Hisham Sender: django-users@googlegroups.com Date: Wed, 19 Dec 2012 13:11:35 To: Reply-To: django-users@googlegroups.com Subject: ajax hey, if i wana use ajax in my django project could i use

Re: Messages Framework

2012-12-09 Thread jirka . vejrazka
You have not posted any code so it's difficult to say what you might be missing. I can only confirm that the messaging framework works very well outside of admin, requiring only a few lines of code in views (typically) and a base template. Cheers JirkA -Original Message- From:

Re: 504 Gateway Timeout

2012-11-29 Thread Jirka Vejrazka
> I'm just facing a problem with little longer runnig SQL select command, and DJago framework returns a "504 Gateway Timeout" after aprox 10 seconds. My sql command is executed on Oracle SQL database through "django.db.backends.oracle" driver. You'd have to change multiple timeouts to make this

Re: Confused about model save/update

2012-11-26 Thread jirka . vejrazka
I may se the formating incorrectly (on a phone) but it looks like your save() method does nothing if self.pk already exists (i.e. model is not new) HTH Jirka -Original Message- From: Lachlan Musicman Sender: django-users@googlegroups.com Date: Tue, 27 Nov 2012

Re: Confused about model save/update

2012-11-26 Thread jirka . vejrazka
Hi there, a long shot since you have not provided your save() method. Are you calling super() there? Cheers Jirka -Original Message- From: Lachlan Musicman Sender: django-users@googlegroups.com Date: Tue, 27 Nov 2012 10:14:03 To:

Re: [Apache] Trouble deploying my web app with mod_python

2012-11-14 Thread jirka . vejrazka
Hi Isaam! Do you have a specific reason for using mod_python? This module is old and deprecated. The recommended way is to use other modules, many people use mod_wsgi which is really simple to deploy and use. HTH Jirka -Original Message- From: Issam Outassourt

Re: update the part 1 of Django Tutorial perhaps

2012-11-13 Thread Jirka Vejrazka
>The reason is that I should add in the table "django_site" of my database : domain and name, I did it : insert into django_site (domain, name) values ("ncegcolnx270", "mysite"); And it works. But this point, the Tutorial 1 doesn't say.. How can I perhaps help update the

Re: Forbidden (403)

2012-11-13 Thread Jirka Vejrazka
I may be wrong, but I don't see you using {% csrf_token %} anywhere. You're posting random snippets from your code that only loosely relate - I have trouble finding full code for the view and all components of HTML templates causing you trouble. So I'll just post a few tips: - before

Re: How to build this query

2012-11-09 Thread Jirka Vejrazka
paris_discounts = Discount.objects.filter(brand__city__name='Paris') ? Note that these are always *double* underscores and I had to make a guess that your City has an attribute "name". HTH Jirka On Fri, Nov 9, 2012 at 9:12 AM, ozgur yilmaz wrote: > Hi all, > > I

Re: Posting from HTTP to HTTPS on same domain results in CSRF failure

2012-10-31 Thread jirka . vejrazka
Hi there, I'm sorry I don't have a solution for you. However I have a warning/recommendation. Even if you don't serve the full site over https, you should make sure that forms that submit data over HTTPS are served over HTTPS. Otherwise you make it difficult for users to verify that their

Re: Easy way to make all form fields read only?

2012-10-30 Thread Jirka Vejrazka
On the UI side, you can set the "readonly" property on form fields. This will prevent the field from being edited in a browser (I think so - done that only once on a small internal project). However, we warned - if *some* of your users can edit and submit the form, you should also introduce

Re: Database setup

2012-10-30 Thread Jirka Vejrazka
Hi Markus, I don't think you mentioned what OS you use on your machine with Django. If it helps, I had this in my settings.py when connecting to MS SQL database from Linux 'mssql': { 'ENGINE': 'sql_server.pyodbc', 'NAME': 'mdb', 'USER': USERNAME,

Re: Connecting to external databases from Views.py

2012-10-24 Thread jirka . vejrazka
Hi Gregg, I've done something similar in the past - had several external databases (MS SQL and Oracle) attached to my Django project. These were backends of enterprise tools, hundreds of tables each. I used the "manage.py inspectdb" command to reverse engineer each "external" DB, manually

Re: I am in trouble

2012-09-26 Thread Jirka Vejrazka
Others have pointed at the indentation error, so I'll just add that mod_python is no longer supported and recommended - you should use mod_wsgi or similar supported module if possible at all. HTH Jirka -- You received this message because you are subscribed to the Google Groups "Django

Re: Beginner problem linking pages from homepage?

2012-09-23 Thread jirka . vejrazka
Hi Vincent, Django is telling you what the problem is - none of strings in urls.py matches the requested URL. All lines in your file say that the regular expression fas nothing before the "foo" (the "^" character says that). However the URL you are trying has "homepage/" before "foo". Hence

Re: java script alert from view after sucessfull opreation

2012-09-17 Thread Jirka Vejrazka
> how to use java script alert from view after sucessfull opreation in view Simplest way is to set some context variable (a.k.a. "flag") in the view (e.g. "operation_successful = True") and have a piece of JS code in your template that runs only when this flag is set, e.g: {% if

Re: django.contrib.markup deprecated in 1.5 - what's the alternative?

2012-09-15 Thread Jirka Vejrazka
Hi Phil, incidentally, I was looking at this just recently. The contrib.markup was deprecated mainly due to security issues with 3rd party libraries that could not be fixed in Django itself and were compromising its security. For more, read https://code.djangoproject.com/ticket/18054 Can't

Re: sending data with HttpResponseRedirect

2012-09-12 Thread Jirka Vejrazka
If you have sessions enabled, you can use the built-in messages framework (look in contrib) to display a message on the "next" page. Alternatively, you can save (semi-) arbitrary data in the user session and retrieve it in the view that displays the "success" page. HTH Jirka -- You

Re: Django development running on 127.0.0.1:8000 not accessible from same machine

2012-08-27 Thread jirka . vejrazka
Hi nav, A long shot - do you happen to have a proxy defined in your browser? It is possible to define a proxy for *all* request (including localhost) - this would have the same effect. HTH Jirka -Original Message- From: nav Sender:

Re: What is the easy way to install DJango?

2012-08-15 Thread Jirka Vejrazka
It's easy to install Django on a Windows machine to test it out and develop code. Most of this is covered here: https://docs.djangoproject.com/en/1.4/topics/install/ In a nutshell, you need: - Python 2.x (2.7) - install it if you already have not done so - Django (start with a stable release e.g.

Re: DJANGO_DEFAULT_SETTINGS

2012-08-14 Thread Jirka Vejrazka
> right, I was being very brief in my description! > But it is the following: > I want to insert data into the database from the shell, django shell, but > the result is always that you can not import the settings because the va > riavel DJANGO_SETTINGS_MODULE is not set Did you read my previous

Re: DJANGO_DEFAULT_SETTINGS

2012-08-14 Thread jirka . vejrazka
It's always good to copy the error message you're getting. It seems that you try to run "python manage.py shell" ang getting an error that DJANGO_SETTINGS_MODULE is not set. Please follow at least a bit of the tutorial on docs.djangoproject.com which will teach you how to set this variable

Re: invoking a funcion or module as root

2012-08-14 Thread Jirka Vejrazka
Hi there, you definitely don't want to allow apache to setuid() to root as you've pointed out. You have a few options, probably the easiest one is to write a pair of scripts for each task you want your application to perform with root privileges. - the first script will only contain "sudo "

Re: merge data from multiple models

2012-07-31 Thread Jirka Vejrazka
Hi there, > As templates cannot do lookups into a dictionary Templates can do lookups into a dictionary, see https://docs.djangoproject.com/en/1.4/topics/templates/#variables (check the "Behind the scenes" section). From what you've described, I'd try to prepare the necessary data in a

Re: form.save() fails silently - how to debug?

2012-07-26 Thread Jirka Vejrazka
Sorry, I should have read your code before answering. I'm struggling to understand what you do in your clean() method. Are you sure you're returning the right set of data? Jirka -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: form.save() fails silently - how to debug?

2012-07-26 Thread Jirka Vejrazka
> Thank you for the suggestion, but unfortunately that too does not work. > > I really need to find a way to get at the source of the problem; I would > think an error message should be generated but none shows up... Are you doing some magic in model's save() by any chance? Jirka -- You

Re: rendering modelForms

2012-07-10 Thread Jirka Vejrazka
Hi Marilena, I'm also using Twitter Bootstrap and over time migrated to this template snipped that I'm including in my templates at the place where you put {{ form.as_table }} http://dpaste.com/hold/768995/ If you find it useful, great :) I'm not a web developer by nature so there may be

Re: Problem to complète the xml template

2012-07-05 Thread Jirka Vejrazka
> Hello, > http://cdm-fr.fr/2006/schemas/CDM-fr.xsd; language="fr-FR"> > {% if formations %} > > Hi there, you probably want to follow your {% if formations %} statement with: {% for formation in formations %} Check Django template documentation again - you're moving along

Re: Django 1.4 - how to display a success message on form save

2012-06-26 Thread Jirka Vejrazka
>> @Jirka - thanks. I saw something about the messaging framework and even >> tried one example which did not work. Using the messaging framework is actually very simple. You need to enable the messaging framework (see the steps here: https://docs.djangoproject.com/en/1.4/ref/contrib/messages/ )

Re: Django 1.4 - how to display a success message on form save

2012-06-26 Thread Jirka Vejrazka
Hi, have you checked the messaging framework in Django? HTH Jirka -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to

Re: Django newbie

2012-06-20 Thread Jirka Vejrazka
> experience. However when I'm trying to execute following command in > command prompt (Windows 7), I get this error. > File "", line 1 > django-admin.py startproject mysite >                                        ^ > SyntaxError: Invalid synatx Hi there, this is a typical Python

Re: How to generate secure passwords

2012-05-30 Thread jirka . vejrazka
Hi, Are you trying to create passwords on behalf of users? This is usually a bad idea. If I got your message wrong and you talk about secure password hashes, is there something specific you did not like about the current Django auth system? Or maybe you are interested in password

Re: Tutorial database problem

2012-05-27 Thread Jirka Vejrazka
Hi, you're creating your database file in /usr/bin which is intended for system executable files, not databases etc. It's highly likely that you don't even have write permissions there (unless you work using the "root" account which is a big NO-NO). Set your database file somewhere where you

Re: django connect alternate database.

2012-05-26 Thread jirka . vejrazka
Hi, search documentation for "database routers" and using() in the ORM... HTH Jirka -Original Message- From: Min Hong Tan Sender: django-users@googlegroups.com Date: Fri, 25 May 2012 22:18:23 To: Reply-To:

Re: Stuck in URL............!!! Help

2012-05-18 Thread Jirka Vejrazka
> 1. ^wikicamp/(?P[^/]+)/edit/$ > 2. ^wikicamp/(?P[^/]+)/save/$ > 3. ^wikicamp/(?P[^/]+)/$ > > The current URL, wikicamp/, didn't match any of these. All defined URL's expect wikicamp/some_page_name/ (and maybe some extras after). The requested URL has no page name, terminates right after

Re: Dajaxice is not defined!!! please heelpppp!! :(

2012-05-04 Thread Jirka Vejrazka
> i am trying to use dajax in my page and i followed all steps several times > as given hier: http://dajaxproject.com/ > > but once i click on onclick="Dajaxice.home.randomize(Dajax.process), nothing > is happening and i saw in console of firefox, there it says, "Dajaxice is > not defined". but i

Re: null field issue

2012-03-01 Thread jirka . vejrazka
Hi Marc, if I remember correctly (can't check now), the documentation clearly states that you should avoid using null=True on CharField unless you have a good reason. Your example is a textbook reason why is it recommended - having two distinct states for "empty string" (i.e. "blank" and

Re: Issues with "startproject"

2012-01-03 Thread Jirka Vejrazka
> I was able to get the django-admin.py file to be located and I no > longer had an error with startproject not executing but there was a > random issue with the name of my file. At this point I have no idea > what the problem is. > > http://madtrak.com/error.png Hi there, you are missing the

Re: Boolean test on queryset

2011-11-28 Thread Jirka Vejrazka
Hi Adam, I tend to use: if examples.count(): ...something... HTH Jirka -- 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

Re: QuerySet: "if obj in queryset" can be very slow

2011-11-02 Thread Jirka Vejrazka
> queryset=MyModel.objects.all() > obj=MyModel.objects.get(id=319526) Thomas, if the second line works for you (i.e. does not raise MyModel.DoesNotExist exception), then obj is in queryset by definition. What are you trying to achieve? Jirka -- You received this message because you

Re: Django ORM - Am I trying to do the impossible?

2011-10-21 Thread Jirka Vejrazka
I thought I missed something :) First of all, nothing stops you from writing raw SQL query if you had one in mind. It might be more sensible than trying to massage the ORM too much. If you insist on ORM, but something along these lines *might* work (I really don't have the opportunity to test it

Re: Django ORM - Am I trying to do the impossible?

2011-10-21 Thread Jirka Vejrazka
Hi there, I may be missing something obvious here, but have you tried thinking about it the other way round? The below is just an untested hint: class Team(models.Model): def get_status(self): team_status = AssignmentUpdate.objects.filter(assignment__team=self).latest().status return

Re: time part of datetime not saved

2011-09-05 Thread Jirka Vejrazka
OK - I can't see anything wrong with your code that'd jump at me. Can you check your database table format? Maybe you've declared your model fields as models.DateField first and then changed to DateTimeField without changing the underlying table? Just a guess :) Jirka -- You received this

Re: time part of datetime not saved

2011-09-05 Thread Jirka Vejrazka
Can you tell us what is the "[0:6]" supposed to be doing in your time conversion funcions? -- 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

Re: Unable to have a template NOT show up

2011-09-01 Thread Jirka Vejrazka
Yves, this: ^polls/ ^polls/$ ^polls/ ^polls/(?P\d+)/$ ^polls/ ^polls/(?P\d+)/results/$ ^polls/ ^polls/(?P\d+)/vote/$ suggests that you did not follow the tutorial closely. Django keeps telling you what's wrong - your urls.py in your application (pools) duplicates the word "polls" in (most

Re: Password Field Not being encrypted

2011-08-30 Thread Jirka Vejrazka
Raj, PasswordInput deals with browser forms to make sure that a password can't be seen in the form by someone looking over user's shoulder. But it does nothing to encrypt passwords in database. Why don't you check out django.contrib.auth.models for inspiration about encrypting passwords if

Re: Unable to work with Django API

2011-08-26 Thread Jirka Vejrazka
Hi there, your database is not set up properly - are you sure you went through the "database setup" section of the tutorial? HTH Jirka -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Installation

2011-08-26 Thread Jirka Vejrazka
Prem, your Django does *not* have to be on your PATH, but it either has to be in your PYTHONPATH or there must be a link from your Python site-packages directory. The easiest way is to add c:/Django-1.0.4 (notice the forward slash) to your Windows PYTHONPATH environment variable (or create

Re: How do I select which user/password to use for DB connection after Django app was started?

2011-08-18 Thread Jirka Vejrazka
> I.e. I want to set up database connection after Django app has started > *when I want it*. > Is there a way to do it? No. At least not easily. Django is a web framework and is expected to run on a web/application server with a single-user connection to a target database. That's typical for web

Re: How to avoid repeated "context_instance = RequestContext(request)" args when rendering?

2011-08-16 Thread Jirka Vejrazka
>> > ... I'm hoping some standard solution >> > already exists.)  Sorry to be so long winded. Hi there, in older Django versions, you can use direct_to_template from generic views to automatically use RequestContext. I'm using it to save a line or two per view. Not a magic solution, but

Re: database requests

2011-07-14 Thread Jirka Vejrazka
> how can i get the queries being passed while a page is being > requested? i mean when a view is requested the database queries being > sent. Hi, it's difficult to figure out what you need from your question, but I'll make a wild guess that you need this:

Re: Inspecting objects

2011-07-13 Thread Jirka Vejrazka
> Thank you all for your help!!! I know I'm a bit late to the party (blame timezones :), but thought I'd put my 2 cents worth in :) For inspecting models from command lines (usually when working with models from legacy databases) I often use model_to_dict which is "hidden" in

Re: Problem with Tutorial 1 - Django Version = 1.3

2011-06-30 Thread Jirka Vejrazka
> class Poll(models.Model): >    question = models.CharField(max_length=200) >    pub_date = models.DateTimeField('date published') > def __unicode__(self): >        return self.question > > class Choice(models.Model): >    poll = models.ForeignKey(Poll) >    choice =

Re: Get MAC from diferent fields

2011-06-14 Thread Jirka Vejrazka
Hi there, Django is just a Python package. Forget for a moment that you use Django for database connection and solve your "how do I recognize a MAC address?" problem just as you'd solve it in pure Python. There is nothing wrong with the MAC addresses in your example - why do you say these are in

Re: Django Admin site and password field

2011-05-12 Thread Jirka Vejrazka
I have not done it myself, but you might need to specify custom widget for your field. Take a look at PasswordInput widget here: http://docs.djangoproject.com/en/1.3/ref/forms/widgets/ HTH Jirka -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Help! Database is locked! Windows developing envrionment, sqlite3, djcelery and djkombu

2011-05-07 Thread Jirka Vejrazka
Or any other database that you would be familiar with or could easily get help for. SQLite3 is great for single-process tasks and simple development. It can't however handle simultaneous writes (other databases supported by Django can handle simultaneous writes) As you use multiple

Re: ANN: DSE v2.0.0-Beta - DSE uses 1.8% of the time compared to the Django ORM updating 100.000 records.

2011-05-03 Thread Jirka Vejrazka
Thanks for DSE! I tried it earlier (version 0.6 I think). While I really liked the speed improvement, there were 2 areas that did not suit me too well: - error detection - I needed reliability more than speed and I was not comfortable with situations like "the IntegrityErrror is somewhere in

Re: cx_Oracle error: ImproperlyConfigured

2011-04-29 Thread Jirka Vejrazka
Have you checked permissions? -- 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...@googlegroups.com. For more

Re: logout problem - NameError - newbie

2011-04-23 Thread Jirka Vejrazka
Hi did you notice in tutorial (or docs) that view names in urls.py are usually strings, not functions? So, if you use 'farewell' in urls.py, you should be fine. HTH Jirka On 22/04/2011, Marg Wilkinson wrote: > Hi, > > I'm a total newbie slogging my way through

Re: cx_Oracle error: ImproperlyConfigured

2011-04-22 Thread Jirka Vejrazka
Are you getting this error only when using the app through a web server? Have you verified that the web server does have ORACLE_HOME and LD_LIBRARY_PATH correctly defined? (e.g. by logging it using os.environ). Are you sure that the user that is used to run your webserver has permissions to read

Re: cx_Oracle error: ImproperlyConfigured

2011-04-22 Thread Jirka Vejrazka
Hi Kamal,   checking my install history, this is what I had to do to use cx_Oracle on Ubuntu Server: $ /usr/local/oracle/instantclient_11_2$ ln -s libclntsh.so.11.1 libclntsh.so $ WITH_UNICODE=1 ORACLE_HOME=/usr/local/oracle/instantclient_11_2 python setup.py build $ sudo bash # WITH_UNICODE=1

Re: Unexplainable delay when binding request.POST to form

2011-04-18 Thread Jirka Vejrazka
> I'm getting 20-30 seconds delay when trying to bind request.POST data > to form. Hi Toni, it's a very long shot, but similar delays are often related to DNS issues. Is there anything in your code or data that might be using domain name? It *might* be possible that some part of your code

Re: Please Help a django Beginner!

2011-04-15 Thread Jirka Vejrazka
I use Djano ORM for a lot of my backend processing where no web is involved. Just make sure that DJANGO_SETTINGS_MODULE is defined in your environment and you can use pretty much any part of Django in your own code/scrits/whatever. HTH Jirka On 15/04/2011, Aviv Giladi

Re: SQL Server

2011-04-15 Thread Jirka Vejrazka
Mike, I use exactly the same setup. Look up the "django-odbc" package. This will be quite easy to use and setup, but there are some unresolved bugs in that package related to multi-db support. Most of them have patches attached to their tickets. Cheers Jirka On 15/04/2011, Mike Kenny

Re: __unicode__ in tutorial part 1

2011-04-12 Thread Jirka Vejrazka
> IndentationError: unexpected indent > > I don't know what's wrong - Can You help me? It's exactly what it says - indentation is important in Python and number for spaces (or tabs) on that line does not match the rest of your file. Or you mixed tabs and spaces. HTH Jirka -- You

Re: Deploying django. Please specify the steps.

2011-03-11 Thread Jirka Vejrazka
OK - I'm going to ask the obvious question here - have you made sure that Apache web server user can read ALL your configuration files? The log reveals that there are permission problems on .htaccess file that is stored in your home directory (where Apache can't reach by default). I'm going to

Re: Why does Django Fail on Date Field?

2011-03-10 Thread Jirka Vejrazka
Will this answer your question? >>> import datetime >>> datetime.datetime(year=, month=00, day=00) Traceback (most recent call last): File "", line 1, in ValueError: year is out of range Jirka -- You received this message because you are subscribed to the Google Groups "Django

Re: Error 503 Service Unavailable from 127.0.0.1

2011-03-10 Thread Jirka Vejrazka
Most likely, you have a proxy defined in your browser and "bypass proxy for local machines" is not checked. Cheers Jirka On 09/03/2011, pjstunna wrote: > Hi, > > I just recently discovered Django and I'm following the Django > tutorial as it is written on the

Re: Why does Django Fail on Date Field?

2011-03-08 Thread Jirka Vejrazka
Well, we're missing the bit where you tell us what error are you getting. I don't know about others, but my crystal ball is a bit dusty these days. The models.py snippet you posted is obvious result of inspectdb output, which *may* need some manual tweaking. But it's difficult for us to guess as

Re: Django ORM query modelling question

2011-03-01 Thread Jirka Vejrazka
Hi Carsten, this does not seem to me like something you would be able to do using SQL (or Django ORM) only. I would guess that you'll have to write a bit of Python code that will walk through the entries and detect those that are different from "previous" Cheers Jirka -- You received

Re: urls.py usage

2011-02-28 Thread Jirka Vejrazka
> AlreadyRegistered at /blog/ > The model BlogPost is already registered That you have duplicate registration of one model in your admin.py somewhere (I believe, I may be wrong). Cheers Jirka -- You received this message because you are subscribed to the Google Groups "Django users"

Re: How to properly implement counter?

2011-02-10 Thread Jirka Vejrazka
I don't have much experience with this, but it looks like a good use case for signals and atomic counters using memcached. Just my 2 cents Jirka -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: matching a domain name in urls.py

2011-02-03 Thread Jirka Vejrazka
> I am building an app that passes a domain name to urls.py like so   "/ > sites/domain.com/' > > but I cannot get my urls.py to match the 'domain.com'  it only seems > to match if i just use domain without the dot > > I have tried > >    (r'^zones/^[^/]+/', get_domain), >    (r'^zones/(?P\w+)/',

Re: working django with existing database

2011-01-30 Thread Jirka Vejrazka
> i've tried inspect-db but i still have no vitctory Err, what exactly does that mean? Did you get an error message? > it's get error while i recompile back it to oracle by syncdb Again - difficult to help you if you don't say *what* error. > errr...and something i don't know, if i syncdb,

Re: working django with existing database

2011-01-30 Thread Jirka Vejrazka
Search documentation for "inspectdb" HTH Jirka On 30/01/2011, arief nur andono wrote: > is there anybody could save my time to make django work with existing > database so i need only create the sql in model (not have to define > table and field in models.py) >

Re: How to format a datetime in a webpage?

2011-01-28 Thread Jirka Vejrazka
>         {{record.ComplaintTime|time:"Y-m-d > H:i"}} >From the documentation: "The time filter will only accept parameters in the format string that relate to the time of day, not the date (for obvious reasons). If you need to format a date, use the date filter." So, you need to use:

Re: Is there a tool to check which views are used?

2011-01-27 Thread Jirka Vejrazka
Unless someone comes up with a smarter idea (I'm sure they will :), I'd take website logs for the last month or so (depending on your site), build a list of all successful requests URL's on your site and then map those to views on your site using standard URL resolver. That should tell you what

Re: "CSRF verification failed" when sending simple GET request using curl

2011-01-19 Thread Jirka Vejrazka
> However, when I tried this: > >    $ curl -d "name=Bob" http://localhost:8000/demo/test curl -d sends data using POST method, not GET method (see curl documentation). Django expects CSRF token in all POST requests, check http://docs.djangoproject.com/en/dev/ref/contrib/csrf/ HTH

  1   2   >