Re: Experiences with virtualenv + Django?

2011-05-23 Thread Ori Livneh
virtualenv is good at what it does, but it's not a comprehensive deployment tool. It does one thing, and I think it does it well. A really good resource is JKM's companion repository to his Django deployment workshop, replete with slides. His

Re: GET/POST

2011-05-23 Thread AJ
Just FYI: 403: http://en.wikipedia.org/wiki/HTTP_403 404: http://en.wikipedia.org/wiki/HTTP_404 On Mon, May 23, 2011 at 10:49 PM, Gabriel Gunderson wrote: > On Mon, May 23, 2011 at 8:04 PM, egilchri wrote: > > I am really new to Django. I've set up an Apache server with > > mod_wsgi,and Django

Re: Experiences with virtualenv + Django?

2011-05-23 Thread AJ
Virtualenv is amazing. I use one virtualenv setup for a project. never had any troubles. I have shared hosting with Dreamhost.com and I run my Django apps on a virtualenv. :) On Mon, May 23, 2011 at 10:12 PM, Eric Chamberlain wrote: > We run CentOS on our servers and use virtualenv for each of ou

Re: GET/POST

2011-05-23 Thread Gabriel Gunderson
On Mon, May 23, 2011 at 8:04 PM, egilchri wrote: > I am really new to Django. I've set up an Apache server with > mod_wsgi,and Django, and I've hit what is probably a common > roadblock. Welcome. Hope you enjoy your time spent with Django! > When I use "curl" to invoke a url using GET, it work

Re: Example uses of Celery

2011-05-23 Thread Brian Bouterse
Celery is great for doing work asynchronously. In web contexts asynchronous work is useful since doing heavy lifting while the user is waiting on your response doesn't lead to high perceived performance. In non-web contexts, it is useful for submitting work into "the system" and having workers ch

Re: Experiences with virtualenv + Django?

2011-05-23 Thread Eric Chamberlain
We run CentOS on our servers and use virtualenv for each of our various django projects (multiple projects on one server), we haven't had any issues, but we use fastcgi between the web server and django. On May 23, 2011, at 7:00 PM, John Crawford wrote: > I'd like to know what kind of experienc

GET/POST

2011-05-23 Thread egilchri
I am really new to Django. I've set up an Apache server with mod_wsgi,and Django, and I've hit what is probably a common roadblock. When I use "curl" to invoke a url using GET, it works just fine. But when I invoke it using POST, I get a 403 error: curl http://web1.tunnlr.com:x/wsgi-scripts/

Experiences with virtualenv + Django?

2011-05-23 Thread John Crawford
I'd like to know what kind of experience people have had, in using virtualenv (to run a particular version of Python on a VPS) with Django, and related packages? Not *just* Django (and Python), I'm fairly sure that will work, but all the other bits and pieces that tend to be required, like mod_wsgi

Example uses of Celery

2011-05-23 Thread br
I understand a lot of production systems use celery and/or cron to automate task queues and/or scheduling. I am just getting involved in a startup and will be the go-to guy for tech stuff and am interested in what types of tasks people use Celery (or a celery-like platform) for so that when simila

Get user/admin ID in admin form

2011-05-23 Thread galgal
Is there any possibility to get admin/user ID in my admin form? I need it to change queryset which displays some data. I use custom form by form = CityNewsAdminForm in admin class but have no idea how to get admin ID inside it:/ -- You received this message because you are subscribed to the Go

Re: Authenticating from a mysql database

2011-05-23 Thread Jonas Geiregat
> Hello Jonas, > > thanks again for your reply. I think migrating the database over to > django may be a good idea, however it's still being used as a legacy > authentication database for other projects. > > In case I'd decide to migrate the existing users over to the new > database, how could I

Re: Authenticating from a mysql database

2011-05-23 Thread Uwe Schuerkamp
Hello Jonas, thanks again for your reply. I think migrating the database over to django may be a good idea, however it's still being used as a legacy authentication database for other projects. In case I'd decide to migrate the existing users over to the new database, how could I make sure the pa

Model filter on date ranges

2011-05-23 Thread sushanth Reddy
Hi, How to get model filter on date ranges. In my project using employee doj, i need to deign a table. like employee who have joined less than three months , 3-6month, 6-12 months, 12-24 months. Depart < 3month 3-6months 6-12months 12-24months - --

Dynamic template loader with TemplateResponse

2011-05-23 Thread Brian Morton
I have some legacy code that I used to dynamically load a template based on url if it exists and render a 404 if it doesn't exist. def content(request, template_name='index'): try: return direct_to_template(request, '%s.html' % template_name) except TemplateDoesNotExist: r

Re: Implement su (i.e. substitute user) in Django

2011-05-23 Thread Joakim Hove
> Before the login call: > > user.backend = 'django.contrib.auth.backends.ModelBackend' Works like charm; thank you very much! Joakim [PS: For others reading this - the right hand side in the assignment above should indeed be a string literal, i.e. with the ''] -- You received this message be

Re: Implement su (i.e. substitute user) in Django

2011-05-23 Thread Shawn Milochik
Before the login call: user.backend = 'django.contrib.auth.backends.ModelBackend' Sorry. I copied & pasted the previous and didn't think this part was necessary. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send ema

Re: Implement su (i.e. substitute user) in Django

2011-05-23 Thread Joakim Hove
Hmmm; thank you for answering. > from django.contrib.auth import login > > (in view) > login(request, user) This was indeed simple; however I can unfortunately not get it to work. The view returns a traceback starting with: AttributeError at /su/ 'User' object has no attribute 'backend'

Multi-database and master/slave configuration

2011-05-23 Thread daniel
i have a fairly complex database configuration and think i've found a bug. i have a master/slave "default" database with an appropriate router and then 2 other data databases which also have their own django router. everything works fine on production, but when trying to run unit tests if fails wit

Testing with managed tables

2011-05-23 Thread Vincent
Whenever I try to run unit tests with my managed tables, Django insists on re creating the test database, and then the tables do not get created for testing. in providing initial data, there seems to be no place to create a table. How should I do unit testing on unmanaged tables? -- You received

Re: Implement su (i.e. substitute user) in Django

2011-05-23 Thread Shawn Milochik
from django.contrib.auth import login (in view) login(request, user) -- 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-use

Implement su (i.e. substitute user) in Django

2011-05-23 Thread Joakim Hove
Hello, for my little site there are a couple of different types of users, and the view presented to the user differs depending on what type of user this is. For me (as a super user) - it would be very convenient If I could change identity and become another user, without having to log out and log

created/modified base abstract class?

2011-05-23 Thread mhulse
In my latest project I have have a few models that need to have a created/modified date/time non-editable fields. I was wondering what would be the best way to handle this... Should create a base abstract class: https://gist.github.com/987022 ... and have the models that need those fields exte

MultiValueField and MultiWidget

2011-05-23 Thread CH
Django's documentation doesn't do a very thorough job of explaining how to use MultiValueField and MultiWidget. I've tried dissecting the one implementation [1] and haven't had good results. Would someone mind giving me a quick pointer in the right direction? My attempt is here: http://dpaste.com/

Re: Is there an HTML editor that's Django-aware

2011-05-23 Thread Shawn Milochik
I also used TextMate for a couple of years then switched to Komodo Edit. I like it a lot more. Now I'm using Ubuntu full-time at home & work, so it's also nice to have a cross-platform tool as well. As someone mentioned last week, it's possible to write macros for Komodo in Python, which is ni

Re: Is there an HTML editor that's Django-aware

2011-05-23 Thread AJ
I have been using TextMate and it works fine for me. There are many keyboard shortcuts also for various Django-HTML tags. For example: type if and press TAB and you get: {%if %} {% endif %} But I recently installed the free Komodo Edit and liked the better interface and code readability. I am

hi

2011-05-23 Thread William Hudspeth
hi On Tue, 2011-05-10 at 09:08 -0700, wilbur wrote: > I am using Django 1.2.4 with a Postgresql 8.4 backend. Before creating > my models in Django, I began with a existing Postgresql database with > tables for which I had defined integer primary keys that used an > autoincrementing sequence on tab

Re: forum and blog for developers

2011-05-23 Thread Derek
On May 22, 7:02 pm, Paul Menzel wrote: > Am Sonntag, den 22.05.2011, 11:53 -0500 schrieb Jacob Kaplan-Moss: > > > I think you're looking forhttp://www.djangoproject.com/community/. > > Perfect. I did not know about this. I am sorry for the noise. Yeah - there is actually a ton of "stuff" (aka res

Re: Weird problem with rendering a Variable in a custom tag

2011-05-23 Thread Brice Leroy
Be careful will computing location on rendering. IPs will change in time. The pattern is not clear but expect the information to expire. As you only extract the country, it shouldn't be an issue, but if you drill down to Zip code I would commend you to store it with the comment's author (less e

Re: Intermediate table with custom to_field?

2011-05-23 Thread Carsten Fuchs
Hi all, On 18.05.2011 18:10, Carsten Fuchs wrote: [...] The intention with this table is to exactly mimic the default intermediate table that Django would create when the keyword "through" is not used in the ManyToManyField statement (manually adding the UNIQUE(...) database constraint), with

Re: How do you organize your deployment enviroment

2011-05-23 Thread Brian Bouterse
I use fabric and chef together. Usually fabric bootstraps my chef environment, and then chef takes over. I also don't use cron anymore, but instead use celery . Best, Brian On Mon, May 23, 2011 at 7:50 AM, DK wrote: > What is your optimal filesystem folder scheme? >

Re: (extendable) social network plugin

2011-05-23 Thread Leon van der Ree
Thanks for your response Matias, Unfortunately some things have come in between, but I will definitely take another look at social-auth once I've get some time and let you know about the result! Regards Leon On 20 mei, 17:52, Matías Aguirre wrote: > Excerpts from Leon van der Ree's message of F

Re: how to solve this issue: "DatabaseError at /admin/myapp, no such column: myapp.myvar"

2011-05-23 Thread roberto
It is weird that database error is in "adminaddress" and the name of the table starts with "address_". how is your "INSTALLED_APPLICATIONS" set in settings.py ? where is / are your admin.py file / s located in your project directory ? how does your directory three structure look like ? Maybe it is

Re: How do you organize your deployment enviroment

2011-05-23 Thread DK
What is your optimal filesystem folder scheme? I've used to keep everything in one directory (project-enviroment, that was itself a virtualenv directory) and then put everything there, but now I am finding hard to manage this as it became a little mess. Now I think about something like: / h

RE: [] Re: How do you organize your deployment enviroment

2011-05-23 Thread Henrik Genssen
you can also use ANT http://ant.apache.org/ and the ant-deb-task http://code.google.com/p/ant-deb-task/ to create debian packages from your source or config regards Henrik >reply to message: >date: 23.05.2011 13:26:00 >from: "Mateusz Marzantowicz" >to: django-users@googlegroups.com >subject: [

Re: Mise en place de la base de données

2011-05-23 Thread Maksymus007
bonjour,le liste est anglais langue seulement. Pozdrawiam, Maksymilian Pawlak 23-05-2011 13:25 użytkownik "mehdi ben rejeb" napisał: > Bonjour > je suis novice pour django et l'environnement python > cet environnement de travail me plaie > je viens de suivre le tuto :http://docs.django-fr.org/int

Re: How do you organize your deployment enviroment

2011-05-23 Thread Mateusz Marzantowicz
On Mon, May 23, 2011 at 9:00 AM, DK wrote: > Hi, > > I am having a django project that is being frequently deployed on clean > linux installation. After a few deployments I have noticed that this process > is very time consuming for me (every time I am preparing run scripts for > everything, con

Mise en place de la base de données

2011-05-23 Thread mehdi ben rejeb
Bonjour je suis novice pour django et l'environnement python cet environnement de travail me plaie je viens de suivre le tuto :http://docs.django-fr.org/intro/ tutorial01.html et j'ai eu un problème lors de la mise en place de la base de donnée j'ai voulu connecter avec postgressql 8.4 1-j'accede

Re: uber weird access problem from windows

2011-05-23 Thread Sam Lai
On 23 May 2011 11:15, Kenneth Gonsalves wrote: > On Sat, 2011-05-21 at 08:04 -0400, AJ wrote: >> Just out of curiosity, is it firefox 4? Is it seen with some of the >> other >> web forms too? > > just one form - I do not have access to that machine right now, but I do > not think it is ff4. Will c

Re: Parenthesis in regex in URLConf

2011-05-23 Thread Pedram
Thanks but I still have problem. My URLConf is like this: Thank you very much. Problem Solved :) On May 23, 1:39 pm, Tom Evans wrote: > On Mon, May 23, 2011 at 10:25 AM, Pedram wrote: > > Hello, > > I have a regular expression for usernames and I want to use this regex > > in my URLConf and bi

Re: How to get hold of the failed db query

2011-05-23 Thread Thomas Larsen Wessel
Thanks Michael. I have been looking into the log today. The problem is however, that the database server is a different computer which I don't have direct access to. It requires emailing another guy every time I need the log. I think that django should be able to tell when one query fails, right?

Re: Parenthesis in regex in URLConf

2011-05-23 Thread Tom Evans
On Mon, May 23, 2011 at 10:25 AM, Pedram wrote: > Hello, > I have a regular expression for usernames and I want to use this regex > in my URLConf and bind that to a view. The problem is, I have > parenthesis in my regex which should not consider as *args*. Here's my > regex: > > ^[a-zA-Z0-9]+((\.[

Parenthesis in regex in URLConf

2011-05-23 Thread Pedram
Hello, I have a regular expression for usernames and I want to use this regex in my URLConf and bind that to a view. The problem is, I have parenthesis in my regex which should not consider as *args*. Here's my regex: ^[a-zA-Z0-9]+((\.[a-zA-Z0-9]+)|(_[a-zA-Z-0-9]+))*$ Values in '()' are necessary

Re: Authenticating from a mysql database

2011-05-23 Thread Jonas Geiregat
Defining your specific user profile as described in my previous post would work. It might need some work arounds and additional methods to get it working. If possible I think migrating the database table (the login , name and password fields only) you presented to the database your django projec

Re: Authenticating from a mysql database

2011-05-23 Thread Uwe Schuerkamp
Thanks much for your reply Jonas, I'll give it a try later. SimpleUserFolder is a Zope "Product" that allows for authentication via other mechanisms than Zope's built-in user management. I'm sure there is a way to bend Django around the database tables in some way, but as i've never tried that bef

Re: Weird problem with rendering a Variable in a custom tag

2011-05-23 Thread bruno desthuilliers
On May 23, 5:37 am, stevedegrace wrote: > I developed a custom tag to look up the country of a certain IP > address using an IP to country database. It's sort of rough and ready, > but it should work. The idea is that you read the comment.ip_address, > feed it to the {% country %} tag, which then

Re: How do you organize your deployment enviroment

2011-05-23 Thread Jonas Geiregat
I'm using Fabric for my deployment it's python based although it still leans on some shell scripting. Op 23-mei-2011, om 09:00 heeft DK het volgende geschreven: > Hi, > > I am having a django project that is being frequently deployed on clean > linux installation. After a few deployments I ha

Re: How do you organize your deployment enviroment

2011-05-23 Thread Sam Walters
Hi I make a shell script as i performs the steps for the first time. Basically it means learning bash or something similar. Disadvantage is its pretty inflexible however if its exactly the same linux distro every time then its not too bad. cheers sam_w On Mon, May 23, 2011 at 5:24 PM, Malcolm B

Re: How do you organize your deployment enviroment

2011-05-23 Thread Malcolm Box
I'd heartily recommend chef - chef.opscode.com. Large library of scripts for almost any package or tool you're likely to want, scales out to lots of nodes but can be run in a simple solo mode for small deployments. Only downside is it's ruby but mostly you use the configuration language so not

How do you organize your deployment enviroment

2011-05-23 Thread DK
Hi, I am having a django project that is being frequently deployed on clean linux installation. After a few deployments I have noticed that this process is very time consuming for me (every time I am preparing run scripts for everything, configuring cronjobs, paths to log files, etc) but this