Re: add https to django

2009-03-19 Thread Vasil Vangelovski
I'd recommend you use all the power of your webserver for this (apache or nginx or whatever). There should be no specific modifications on the django site if you do it right. I think this gui has the fix for what you asked tho: http://hotsyk.com/blog/2008/11/05/https-django-and-wsgi/ On Thu,

Re: Map events in space on a django app

2009-03-19 Thread Vasil Vangelovski
If you don't need any spatial related queries (although django people uses something like that) you don't really need a spatial database. You can store geographic coordinates in either FloatFields or CharFields. Your question is more related to GoogleMaps API than django. I'm assuming you

A question about reverse url lookups for admin site in svn version

2009-07-17 Thread Vasil Vangelovski
I'm using svn trunk version of django (rev. #11263). In my project I have only one admin site registered in the urlconf. This admin site is a subcalss of django.contrib.admin.sites.AdminSite and is instantiated with the name 'admin'. I'm trying to use reverse url lookups for the admin site as

Re: A question about reverse url lookups for admin site in svn version

2009-07-17 Thread Vasil Vangelovski
project done in Java/Flex. Thanks. On Fri, Jul 17, 2009 at 4:46 PM, Michael<newmani...@gmail.com> wrote: > On Fri, Jul 17, 2009 at 10:28 AM, Vasil Vangelovski <vvangelov...@gmail.com> > wrote: >> >> I'm using svn trunk version of django (rev. #11263). In my project

Re: A question about reverse url lookups for admin site in svn version

2009-07-17 Thread Vasil Vangelovski
the url for it's index page? On Fri, Jul 17, 2009 at 9:48 PM, Vasil Vangelovski<vvangelov...@gmail.com> wrote: > Yes it does work, I've tried this with a brand new project in the same > virtualenv. Reverese resolution of urls for the AdminSite in > django.contrib.admin does work

Re: A question about reverse url lookups for admin site in svn version

2009-07-17 Thread Vasil Vangelovski
Yeah, I was confused mostly about the stuff with the colon because I didn't pay much attention when reading about namespaced urls the new docs. Thanks On Fri, Jul 17, 2009 at 10:49 PM, Michael<newmani...@gmail.com> wrote: > On Fri, Jul 17, 2009 at 4:27 PM, Vasil Vangelovski &

RequestContext current_app keyword argument

2009-07-17 Thread Vasil Vangelovski
Looking at the code for the ModelAdmin class in django.contrib.admin.options I've come accross this: context_instance = template.RequestContext(request, current_app=self.admin_site.name) in a few places. What is this current_app argument? When I try to init a RequestContext with the current_app

Strange things happening with reverse url lookups

2009-07-21 Thread Vasil Vangelovski
I've posted a question about this a few days ago and I thought I was confused about something, but it was probably some problem with the django revision at the time or I'm even more confused now. So... I have an application called epg with a model named Show and I want to provide a link for

Re: Strange things happening with reverse url lookups

2009-07-21 Thread Vasil Vangelovski
Thanx It was just my luck reading about this new feature in the URL dispatcher and trying to use it in my project moments before it was added to trunk :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: Hi people

2009-07-22 Thread Vasil Vangelovski
A good place to start is the tutorial: http://docs.djangoproject.com/en/dev/intro/tutorial01/ If you are new to python you can also check dive into python: http://diveintopython.org/ On Wed, Jul 22, 2009 at 10:52 AM, sudharsan s wrote: > > Hi i am new to django . i have

Re: Ajax-based generic views?

2009-07-22 Thread Vasil Vangelovski
What exactly do you mean by "ajax-based generic views"? Most often you'd return a JSON response to an xhr request so instead of passing a dict as a context object to render_to_response you'd return an HTTP response with the dict serialized as JSON. Follow any guidelines for making views generic,

Re: Java and Python

2009-07-22 Thread Vasil Vangelovski
You can certainly run django 1.0.2 in apache tomcat, jetty etc. See these: http://docs.djangoproject.com/en/dev/howto/jython/ http://code.google.com/p/django-jython/ It's a bit slower though (will fool anyone that it's a Java web app). On Wed, Jul 22, 2009 at 11:58 PM,

Re: Sqlite3 ok from deployment?

2009-07-22 Thread Vasil Vangelovski
I don't think it really matters if one or more processes/threads try to access it, when it get's locked EXCLUSIVE for writing only one will have access to it until the lock gets released. For a very low volume site with very few INSERT/UPDATE/DELETE queries you may not experience any difference

Re: Url Namespaces

2009-07-26 Thread Vasil Vangelovski
See this: http://docs.djangoproject.com/en/dev/topics/http/urls/#defining-url-namespaces On Mon, Jul 27, 2009 at 12:13 AM, Vitaly Babiy wrote: > How does one go about registering a namespace? > I can't seem to find it in the docs. > Thanks, > Vitaly Babiy > > > >

Re: how to use form_class with generic views?

2009-07-26 Thread Vasil Vangelovski
First you create a ModelForm: from django.forms import ModelForm from myproject.myapp.models import MyModelClass class MyFormClass(ModelForm): class Meta: model = MyModelClass there you have your form_class that you need to pass to the view you want:

Re: how to use form_class with generic views?

2009-07-27 Thread Vasil Vangelovski
way, > i've tried your method and i received the error: > > 'NoneType' object is not callable > > May i know how do i solve this issue? > > Best Regards, > Eugene > > On Jul 27, 12:15 pm, Vasil Vangelovski <vvangelov...@gmail.com> wrote: > >> First you cr

Re: MS Word Characters

2009-07-28 Thread Vasil Vangelovski
Are you emailing just the rtf document you generate or sending the contents in the email body as well? The problem might be that the content encoding of the rtf or email message is not set properly. cootetom wrote: > Hello, > > I'm having some trouble with strange characters that come from MS

Re: IDE for Django and Ext JS

2009-07-29 Thread Vasil Vangelovski
There's not much benefit in using an IDE like eclipse or netbeans for Python and JS, they are also slow enough to counter productivity. I'd rather waste those CPU cycles for playing random noises in the background. --~--~-~--~~~---~--~~ You received this message

Re:

2009-07-29 Thread Vasil Vangelovski
> The way I do it is what you allude to at the end, have a special class > on the inputs and then use the inner Media class of the widget > (http://docs.djangoproject.com/en/dev/topics/forms/media/) to provide > a javascript file that'll automatically add the widget to all of the > items with

Can I have custom validation in the admin change_list form when using ModelAdmin.list_editable?

2009-07-29 Thread Vasil Vangelovski
Is it possible to define custom validation for the form in the admin change list when using ModelAdmin.list_editable? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: how save data into more than one table?

2009-07-29 Thread Vasil Vangelovski
What exactly do you need to do? Please be more specific. On Wed, Jul 29, 2009 at 11:39 PM, Asinox wrote: > > Hi guys, i cant find a example about how ill save data in two or more > tables... somebody help me please > > Thanks > > >

Re: Can I have custom validation in the admin change_list form when using ModelAdmin.list_editable?

2009-07-29 Thread Vasil Vangelovski
That works, thanx. On Thu, Jul 30, 2009 at 12:07 AM, Alex Gaynor<alex.gay...@gmail.com> wrote: > > On Wed, Jul 29, 2009 at 5:05 PM, Vasil > Vangelovski<vvangelov...@gmail.com> wrote: >> >> Is it possible to define custom validation for the form in th

Re:

2009-07-29 Thread Vasil Vangelovski
Of course that the files specified in the class Media are accessed via GET. How else would they be accessed? It's possible to fetch a js file with additional get arguments and access those values from the js. So you can pass prePopulateString as a get parameter to the js file in class Media for

Re: I need to get psycopg2 installed on Mac OS X 10.5

2009-07-30 Thread Vasil Vangelovski
There's a package of PostgreSQL called postgresplus that comes with postgis, pgadmin etc. It's pretty easy to set up on os x: http://www.enterprisedb.com/products/postgres_plus/overview.do Installing psycopg2 after I've installed postgresplus has always worked for me with minimum effort, see

Re: Long Poll in Django

2009-07-30 Thread Vasil Vangelovski
I've used orbited with success for this purpose: http://www.orbited.org/ But getting started integrating it with your django project is not very straightforward. On Thu, Jul 30, 2009 at 11:52 AM, aleph wrote: > > Hi! > > Is it possible to use Django with longpoll technique?

Re:

2009-07-30 Thread Vasil Vangelovski
pt itself.  Sorry if this is a dumb question - > I've written various bits of javascript/jquery but haven't encountered > this. > > Margie > > > > On Jul 29, 5:51 pm, Vasil Vangelovski <vvangelov...@gmail.com> wrote: >> Of course that the files specified in the class Med

Re: custom admin actions

2009-07-30 Thread Vasil Vangelovski
You can get the model class for the modeladmin, it's the model property. So modeladmin.model will give you the model class. You can just do a check of equality modeladmin.model == OurModel. On Thu, Jul 30, 2009 at 1:22 PM, selcukcihan wrote: > > Hi, i have django 1.1 > > I

Do I need django.contrib.auth in my INSTALLED_APP when if I don't use the models from there?

2009-07-31 Thread Vasil Vangelovski
I'm making a very small project that will use the apps/models from a larger one. This will be hosted on a separate domain. Now the larger project uses the models from django.contrib.auth, but I don't need and don't want to store users in a database for this smaller one. I'll just provide my

Re: Do I need django.contrib.auth in my INSTALLED_APP when if I don't use the models from there?

2009-07-31 Thread Vasil Vangelovski
answer your question, we would need to know what apps it is using. > > Luke > luke.seelenbin...@gmail.com > > "I [may] disapprove of what you say, but I will defend to the death your > right to say it." -- Voltaire > > > Vasil Vangelovski wrote: > >> I'm

Re: Do I need django.contrib.auth in my INSTALLED_APP when if I don't use the models from there?

2009-07-31 Thread Vasil Vangelovski
ing. If none of the apps >> depend on django.contrib.auth, you won't need it, unless you want to use >> the django admin (which depends on django.contrib.auth). >> >> To fully answer your question, we would need to know what apps it is using. >> >> Luke >&

Re: How to Allow "-" character in usernames in the admin application

2009-07-31 Thread Vasil Vangelovski
You can unregister the User model and default UserAdmin from the admin site, then register it again but after changing form and add_form of UserAdmin with you custom form classes. Looking at the code for django.contrib.auth.admin will probably make things clearer for you:

Re: psycopyg setup error: no build_ext

2009-08-02 Thread Vasil Vangelovski
From that bash interaction I can assume you are running os x. The absolutely easiest way to install postgresql and psycopg2 on os x is with postgresplus. These links may help if you decide to go down that path: http://www.enterprisedb.com/products/postgres_plus/overview.do

is it possible to do a monkey patch on django.contrib.atuh.models.User to make the email field unique?

2009-08-04 Thread Vasil Vangelovski
Having this line of code: User._meta.get_field('is_staff').default = True in the models.py for one of my apps works without problems. I wonder if it's possible to make email unique and first_name,last_name unique_together by using this technique. This: User._meta.get_field('email').unique =

Re: is it possible to do a monkey patch on django.contrib.atuh.models.User to make the email field unique?

2009-08-04 Thread Vasil Vangelovski
Thanks Alex, that worked. Alex Koshelev wrote: > Hi, Vasil! > > `Field.unique` is the read only property. If you want to set > uniqueness you have to assign field's `_unique` attribute to True. > > --- > Alex Koshelev > > > On Wed, Aug 5, 2009 at 12:54 AM, V

Re: Django/ Python 3 - nervous about starting large project

2009-08-08 Thread Vasil Vangelovski
If you are writing your code in python 2.6 it will be easy to port it to python 3 later. The backwards incompatible changes introduced in python 3 are not a good reason not to write you web application with django. snfctech wrote: > Hello. > > We are researching technologies to begin what may

A question about model form inheritance

2009-10-04 Thread Vasil Vangelovski
Lets say I have one form which inherits from ModelForm and a second one that inherits from the first one. What I want to do is add 2 fields in the second form, the fields are bound to the properties of the model. Which would be the best way to do this? Example: the model has fields: name,

Re: home page menu view variables cross every view?

2010-09-07 Thread Vasil Vangelovski
You can use your own template for flatpages, see http://docs.djangoproject.com/en/dev/ref/contrib/flatpages/?from=olddocs#flatpage-templates Just make that menu a separate template and include it wherever you want. Of course your flatpages template and your other templates can inherit from the

Re: python setup.py install errors

2010-09-12 Thread Vasil Vangelovski
Is that NAS with an ARM processor? It might be caused by a bug in python 2.5: http://bugs.python.org/issue1762561 On Sat, Sep 11, 2010 at 11:26 PM, S66 wrote: > hi there, > > i tried to get the current version of django working on my NAS, but > when i run > python

Re: subclassing UserCreationForm

2010-09-24 Thread Vasil Vangelovski
> Mainly, I just don't think you're subclassing User for the right > reasons. In fact, I can't really think of anytime I would subclass > it. Usually adding a related table is a better way to go (lookup > django user profiles for example). > There are times when the builtin User model is not

Re: how do you build an html website in python?

2010-04-17 Thread Vasil Vangelovski
That website is built using django which is a web framework built in python. If you want info on how to build a website using django consult the django tutorial: http://docs.djangoproject.com/en/dev/intro/tutorial01/ and the docs: http://docs.djangoproject.com/en/dev/contents/, If you want to

Sending email via SMTP in a unit test

2010-04-23 Thread Vasil Vangelovski
Is there a way to run unit tests in such a way that email will be sent via the SMTP email backend when there's a call to send_mail in the unit test? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Sending email via SMTP in a unit test

2010-04-23 Thread Vasil Vangelovski
Yes, I'm using trunk (1.2). Thanks Russell, that helped. On Fri, Apr 23, 2010 at 1:59 PM, Russell Keith-Magee <freakboy3...@gmail.com> wrote: > On Fri, Apr 23, 2010 at 6:27 PM, Vasil Vangelovski > <vvangelov...@gmail.com> wrote: >> Is there a way to run unit tests

Re: Open source CMS (if based on Django better)

2010-05-07 Thread Vasil Vangelovski
Have a look into LFC (lightning fast CMS) http://demo.django-lfc.com/, seems to be pretty flexible. On Wed, May 5, 2010 at 9:52 PM, Jonatan.mv wrote: > What would be you recommended CMS?. Could you please give some reasons > (pro and cons)?. > > I'm investigating on these:

Overriding ForeignKey widget CSS classes in the admin

2010-05-22 Thread Vasil Vangelovski
Hi I'm trying to build the CSS class attributes for all the widgets in my ModelForm dynamically in the form's __init__ method. This seems to work for and input widgets, but doesn't work if the is for a foreign key field. From what I can see the BaseModelAdmin replaces widgets for foreign keys

A question about form inheritance and form media as a dynamic property

2010-05-25 Thread Vasil Vangelovski
I have a form class, call it MyBaseForm which defines some media as a dynamic property (by providing a media property, not defining a Media class). Then I have MyForm which inherits from MyBaseForm and overrides some widgets on it's fields, these widgets have their own media definitions. The

What would be the best way to implement a login audit?

2010-05-29 Thread Vasil Vangelovski
I'm developing an intranet application where one of the requested features is having a detailed log containing entries of IP, user and timestamp every time someone has logged in successfully. Also as a bonus feature I'd like to implement a log of failed login attempts. What would be the cleanest

Re: Serving media files with Django/Apache/Nginx

2010-06-01 Thread Vasil Vangelovski
Using the alias directive is much more easier and straighforward, for me at least. Here's an example configuration upstream django-backend { server testsite.local:4080; } server { listen 80; server_name testsite.com; location /{

Getting all the concrete model classes inheriting from a certain abstract model class

2010-06-04 Thread Vasil Vangelovski
Hi I have around 30 models inheriting from one abstract model class and the number may grow (there's a specific reason for this design decision, involving making the database easy for people to make reports from the data with other tools, namely ms access, and making it easier to make changes to

Re: How to share a session with a php application.

2010-06-05 Thread Vasil Vangelovski
It's possible if both of your applications are under the same domain. see the SESSION_COOKIE_* settings variables http://docs.djangoproject.com/en/dev/ref/settings/#session-cookie-age You can then find the current user by the sessionid from the django_* tables. On Sat, Jun 5, 2010 at 1:40 PM,

Re: error : Django with Apache and mod_python

2010-06-05 Thread Vasil Vangelovski
It seems that your application is trying to render a template that doesn't exist. And why are you using mod_python anyway? On Sat, Jun 5, 2010 at 5:49 PM, Jagdeep Singh Malhi wrote: > > MOD_PYTHON ERROR > > ProcessId:      3219 > Interpreter:    '127.0.1.1' > >

Re: How to share a session with a php application.

2010-06-05 Thread Vasil Vangelovski
from Django and > PHP ) >  also throught a cookie. > In your opinion what is the best way ? > > Thanks ^_^ > > ----- > > On Jun 5, 4:01 pm, Vasil Vangelovski <vvangelov...@gmail.com> wrote: >> set >> >> SESSION_COOKIE_DOMAIN=".mychatapp.com&quo

Re: search like google

2010-06-06 Thread Vasil Vangelovski
See haystack http://haystacksearch.org/ On Sun, Jun 6, 2010 at 9:10 AM, Odagi wrote: > Hello users, > > I'd like to implement searches like google (i.e., resolve typos or > similar words). For example, if I'm looking for the word 'manatan' the > search engine should match

Is there a way to force a template to get translated to a certain language without passing RequestContex?

2010-06-10 Thread Vasil Vangelovski
I'm rendering a template with a management command (something I need for producing documentation in my native language). So I've no request object, so no RequestContext. Is there a way I can force the template rendering process to lookup translation strings from a particular language other than

Re: Is there a way to force a template to get translated to a certain language without passing RequestContex?

2010-06-10 Thread Vasil Vangelovski
Thanks for the help. On Thu, Jun 10, 2010 at 12:49 PM, Tom Evans <tevans...@googlemail.com> wrote: > On Thu, Jun 10, 2010 at 11:39 AM, Vasil Vangelovski > <vvangelov...@gmail.com> wrote: >> I'm rendering a template with a management command (something I need >> for

Re: custom template tags with a raw query

2010-06-15 Thread Vasil Vangelovski
To use custom SQL see this for reference: http://docs.djangoproject.com/en/dev/topics/db/sql/ To create a templatetag see this for reference: http://docs.djangoproject.com/en/dev/howto/custom-template-tags/ On Mon, Jun 14, 2010 at 10:08 PM, Cole743 wrote: > Hello

Re: sessions across subdomains - required settings?

2010-06-17 Thread Vasil Vangelovski
Not really. Giving them a different secret key won't make much difference. Just make sure your site id is the same. On Thu, Jun 17, 2010 at 11:22 AM, Aljosa Mohorovic wrote: > if i have a project with domain example.com and it's deployed as 3 > wsgi apps: > -

Re: Using ForeignKey with dJango and PyAMF

2010-02-08 Thread Vasil Vangelovski
There's a bug in PyAMF: http://dev.pyamf.org/ticket/694 On Mon, Feb 8, 2010 at 5:54 PM, WC wrote: > Hi Everyone, > > I have a ForeignKey field that is always null on the Flex client.  I > have tried using select_related(), but it's still null.  Any idea what > I am doing wrong?  

Re: Creating an external url in the django admin section

2010-02-08 Thread Vasil Vangelovski
You can override the template for a specific app by first copying it to a template folder respectful to that app See this: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-admin-templates On Mon, Feb 8, 2010 at 8:16 AM, djangonoob wrote: > Hi all. >

Re: anybody tried web2py and gone back to Django?

2010-02-18 Thread Vasil Vangelovski
I've looked at it a couple of months ago. There are some great ideas behind it. Web2Py cons: 1. The first and biggest issue at the time was that there was no sufficient/accessible documentation available for free. The book was only available on scribd for free which is horrible. Now the book is

Re: Scripting Import of CSV data?

2010-02-23 Thread Vasil Vangelovski
Write a management command that downloads the CSV from email and loads it in your database. Set up a cron job that calls the management command. This is how I would do it. There may be some unnecessary complication with that approach, like figuring out which emails contain the CSVs of interest

Re: Customizing the Sites framework

2010-03-21 Thread Vasil Vangelovski
Either use model inheritance or one by one relationships with the Site model. The other solution which doesnt require changing django's code would be monkeypatching (changing the class in runtime from the models.py file of one of your apps), not a great idea. On Sun, Mar 21, 2010 at 4:43 AM,

Re: error about django and mssql

2010-04-05 Thread Vasil Vangelovski
Well, the error message is pretty concise, a connection to the database server can't be opened. See if you can connect to the same database from the same machine with another client (for example Management Studio Express) to check if all the parameters in your connection string are correct. On

Re: decorators

2010-04-05 Thread Vasil Vangelovski
It's a deprecation warning. It means that some code in facebook.djangofb uses some part of the standard library that will be gone from future releases of python (for example python 2.7). Since it's not in your code but in some package you are using, it's the responsibility of the maintainers of

Re: Hosting for Django sites

2010-04-05 Thread Vasil Vangelovski
I've nothing but positive impressions from Slicehost so far. - All their VPS plans (slices) work pretty fast and each is mostly limited by the amount of memory you need and are prepared to pay for. - Resizing a slice (changing a plan) is painless and fast. - You are the master of your own slice,

Re: How to implement i18n in javascript

2010-04-05 Thread Vasil Vangelovski
Can you be more precise about what part doesn't work? Did you include the javascript translation catalog in you HTML template with a

Re: deploying flex and django

2011-03-21 Thread Vasil Vangelovski
One option is to use flash vars to pass your django app url to your flex SWF on initialization in your HTML page. That way you don't have to rebuild your SWF for different environments. And you may use a django template to render the html that embeds your swf so you can change the url

Re: a noob in need (installing apps)

2011-04-09 Thread Vasil Vangelovski
A reusable application is a package. To use it you need to put the package name in INSTALLED_APPS and depending if it provides any models do syncdb after that (for mailer you need that). Usually there's detailed instructions on what you need to do to get up and running with a reusable app. But an

Re: Anyone seen following error

2011-04-09 Thread Vasil Vangelovski
It's a validation error for a DateTimeField On 4/10/11 12:28 AM, ydjango wrote: > I have a batch process which reads a text file and loads mysql DB > tables. I see following error occasionally in log files. Finding it > hard to trace but working on it. > This app is on older Django 1.1.2. Has