Re: new Django-Python can't get to sqlite

2010-08-13 Thread Piotr Zalewa
Google "install sqlite/mysql $your_operating_system" If you provide more info (result of running yolk and your operating system) we will be able to help you a bit more. zalun On 10-08-13 03:15, Tom wrote: It's my first time using Django& I'm unable to get the demo going. I would like to use

Re: new Django-Python can't get to sqlite

2010-08-13 Thread Piotr Zalewa
Aug 11 20:44 shortcuts drwxr-xr-x 3 502 502 4096 Aug 11 20:44 template drwxr-xr-x 2 502 502 4096 Aug 11 20:44 templatetags drwxr-xr-x 2 502 502 4096 Aug 11 20:44 test drwxr-xr-x 4 502 502 4096 Aug 11 20:44 utils drwxr-xr-x 4 502 502 4096 Aug 11 20:44 views On Aug 13, 1:08 am, Piotr

Re: Caching JSON in Django

2010-08-25 Thread Piotr Zalewa
In such case it would better to not cache entire method, but simply the data - build the unique key per GET requests, check if the data is already stored in cache, if so - use it, else - retrieve it from database and store it in cache. from django.core.cache import cache def someview(req):

Re: Multiple django projects

2010-09-02 Thread Piotr Zalewa
On 09/02/10 17:12, commonzenpython wrote: > hey, guys > is it possible to have multiple django projects in one server ? > You can also make them using different django versions check django + virtualenv on google zalun -- blog http://piotr.zalewa.info jobs http://webdev.zalewa.info twit htt

Re: Please wait page trouble

2010-09-08 Thread Piotr Zalewa
Do you have it in the urls.py file? Would be best to paste it into pastebin or here if it's few lines only zalun On 09/08/10 23:56, Bradley Hintze wrote: > This is what I have in my please_wait.html > > src="

Re: Django v1.1

2010-09-17 Thread Piotr Zalewa
Hi Robbington. I'd suggest to use virtualenv and keep to use *only* pip that way only you have the power to change anything to update Django to a version above 1.2 simply pip -E your_virtual_environment install Django>=1.2 zalun On 09/17/10 13:02, Robbington wrote: > Hey, > > I keep getting thi

Re: [Announcement] Vim for Python and Django

2010-09-26 Thread Piotr Zalewa
Hi Antoni, Thanks for that! zalun On 09/26/10 10:36, Antoni Aloy wrote: > Hello all! > > In this list we have a recurrent thread: "What'ts the best IDE for > Django and Python development?" trespams-vim is my try to answer this > question for people who likes to have a very powerful editor and

Re: Where do you put your business logic in django? Organizing big projects in django.

2010-09-27 Thread Piotr Zalewa
http://docs.python.org/tutorial/modules.html#packages. I've no idea if there are links to Python docs in the first djangobook chapter or on the Django's Introduction page. If such feature should be explained on Django docs, every other Python feature should be there as well. We come to

Re: [Announcement] Vim for Python and Django

2010-10-01 Thread Piotr Zalewa
It is great and I'm using it - I was using minibuf before, but somehow your config convinced me to use NerdTree. One question thought - I'd like to have the 80+ characters highlighted somehow. I found this: http://stackoverflow.com/questions/235439/vim-80-column-layout-concerns but I guess it's no

Re: [Announcement] Vim for Python and Django

2010-10-01 Thread Piotr Zalewa
Answering to ,yself... Just installed vim 7.3 colorcolumn=80 is perfect for that zalun On 10/01/10 17:40, Piotr Zalewa wrote: > It is great and I'm using it - I was using minibuf before, but somehow > your config convinced me to use NerdTree. > One question thought - I'd

Django structure and git as VCS

2010-10-07 Thread Piotr Zalewa
Hi, I'm working on defining the structure of an application It will have quite a few apps, with few of them opensourced. I was thinking how to make it easier for people involved into the project. In essence front-end developer should work on one repository only - that's also goes quite nicely wi

Re: Django structure and git as VCS

2010-10-07 Thread Piotr Zalewa
uter/opus> to deploy them onto our > servers since it is connected to the app repository where their apps are > published Opus provides a self service deployment interface. You can > even test your deployments on our sandbox servers > <https://sandbox.opus.ncsu.edu/>. > &g

Re: Help with http basic authentication

2010-10-13 Thread Piotr Zalewa
Althought it is true, there are ways to get this data to Django. Check this (after a simple google search): http://stackoverflow.com/questions/152248/can-i-use-http-basic-authentication-with-django zalun http://jsfiddle.net/user/zalun/ On 10-10-13 01:38, Sam Lai wrote: On 12 October 2010 22:2

Re: problems using apps in main project (NameErrors)

2010-10-27 Thread Piotr Zalewa
Hi If you want to have the apps in apps folder you need to put them on the python path, so eithor modify the python path environment variable or (prefered) modify manage.py and add site.addsitedir(path('apps')) zalun On 10/27/10 14:50, wawa wawawa wrote: > Hi All, > > I've spent the last hour o

Re: problems using apps in main project (NameErrors)

2010-10-27 Thread Piotr Zalewa
just add before code: import site :) On 10/27/10 15:13, wawa wawawa wrote: > Hi Piotr, > > On 27 October 2010 15:54, Piotr Zalewa wrote: >> If you want to have the apps in apps folder you need to put them on the >> python path, so eithor modify the python path en

Re: Installing Django on Ubuntu

2010-11-15 Thread Piotr Zalewa
On 11/15/10 08:54, kelp wrote: > Hello, > So I have downloaded Django and put the folder into my /home/username/ > directory, and I ran setup.py. I played with Django a little bit, but > it turns out that I haven't actually been using the newest, stable > version of Django (1.2.3), but I have been

Re: Installing Django on Ubuntu

2010-11-15 Thread Piotr Zalewa
On 11/15/10 14:41, Flaviu Simihaian wrote: > zalun, > > I thought to get mkvirtualenv you have to install the > virtualenvwrapper shell commands: > > $ pip install virtualenvwrapper > $ export WORKON_HOME=~/VirtualEnvs > $ mkdir -p $WORKON_HOME > $ source /usr/local/bin/virtualenvwrapper.sh > >

Re: VIM as Modern Python/Dajngo IDE

2012-02-06 Thread Piotr Zalewa
Good work with adding explanations to what plugins are doing, I'm too often just add plugins. It might be worth to put your setup (basically .vim directory) on github. I did so with mine, but it's a bit bloated (https://github.com/zalun/vimSetup) I advice to use pathogen plugin and keep all

Re: Django REST

2012-03-04 Thread Piotr Zalewa
On 03/04/12 20:06, Daniel Hilton wrote: On 4 March 2012 18:35, Jani Tiainen wrote: I've been very happy with django-rest-framework. I think there exists at least django-piston to do the same. The other one to look at is django-tastypie - I've used it twice now in anger and been really happy

Re: Anyone using a javascript MVC on top of Django?

2012-04-17 Thread Piotr Zalewa
We use a very new framework called Shipyard https://github.com/seanmonstar/shipyard at Mozilla to build http://builder.addons.mozilla.org/. The goal is to have a nice framework working well with Django. MooTools style (classes etc.). A lot of requests on dev site, one file per project on produ

Re: Dynamic parameters in django URLs

2011-09-29 Thread Piotr Zalewa
On 09/29/11 11:36, Dejan Noveski wrote: Hi, I want to add dynamic urls to my site for faceting purposes. E.g: /(type)/(subtype)/(category)/ But I also want something like this to work: /(type)/(subtype)/ or /(type)/(category)/ or /(subtype)/(category)/ or just /(category)/ | /(type)/ | /(subtype

Re: django tests. where to create users

2011-11-29 Thread Piotr Zalewa
I use all solutions, depending on the needs. When I'm testing a usage of many objects I use fixtures (also with users as I'm "pretending" that users created them) When there is a test involving a user I create this object, either in test or the setUp. On 11/28/11 01:58, Gelonida N wrote: H

Re: django south and new installed app how to?

2011-12-20 Thread Piotr Zalewa
Explained here: http://south.aeracode.org/docs/commands.html#schemamigration On 12/15/11 15:58, Gijsbert de Haan wrote: Hi, I have an existing django project with south enabled using buildout. Now I want to add a new egg to get and install another django application for my project, this new app

Re: User Profile Creation

2011-12-20 Thread Piotr Zalewa
You can't do it in admin site without tinkering. If you create users inside a view (i.e. during the registration process), there is no need to use signals - you can simply create a profile with data from registration form. If you use django forms, use them with prefix kwarg, this will allow to

Re: UnicodeDecodeError

2012-01-05 Thread Piotr Zalewa
Please attach the index.html - there might be an unknown unicode character zalun On 01/05/12 12:18, Hassan wrote: Dear ALL, i am trying to do render_to_response('index.html') , and i keep geting this dont know why ? its a normal html page ??!! what to do ? UnicodeDecodeError at / 'utf8' code

Re: How to register JS event handler

2011-05-18 Thread Piotr Zalewa
Make the JS code a callable function Include JS in pages you want to use it Create a small template in which you will call the function with these values. Include it in templates you need such a thing On 05/18/11 09:44, Thomas Guettler wrote: On 17.05.2011 13:18, Michal Petrucha wrote: On Tu

Re: installing django

2011-05-24 Thread Piotr Zalewa
On 05/24/11 07:40, bh.hoseini wrote: hi there, i installed django on vista, but i don't know how to combine it with python, i read installation guide but it wasn't ussefull! : I had some troubles install Django on Win7 In the end I used cygwin - it worked fine, although it's not clean Win. I rem

Re: Our new startup site build on Django and GAE is now live!

2011-06-03 Thread Piotr Zalewa
+1k - just wanted to write the same message On 06/03/11 14:39, Rob wrote: I spent a few seconds looking for the X to close the sign up panel before seeing this: "LOCQL is a social Q&A service, so we need you to sign in instead of browse anonymously." But I *always* browse anonymously first to

Re: Seeking a Django 1.3 and syslog configuration example

2011-06-03 Thread Piotr Zalewa
In Add-ons Builder I've got something like this in log_settings.py https://github.com/mozilla/FlightDeck/blob/master/log_settings.py 'handlers': { 'syslog': { '()': logging.handlers.SysLogHandler, 'facility': logging.handlers.SysLogHandler.LOG_LOCAL7,

Re: Social Networking basics? -Raj

2011-06-21 Thread Piotr Zalewa
Do we have a group FAQ? On 06/20/11 22:44, Cal Leeming [Simplicity Media Ltd] wrote: On Mon, Jun 20, 2011 at 10:32 PM, Shawn Milochik mailto:sh...@milochik.com>> wrote: Is it just me or are we having a sudden spurt of e-mail that goes like this: Q: How do I A: You do X

Re: How to use django-profile with django registration ?

2011-06-21 Thread Piotr Zalewa
On 06/21/11 14:15, Satyajit Sarangi wrote: https://bitbucket.org/ubernostrum/django-registration This is what I am using for user registration . Once , I log in the user is not able to get into the userprofile page . Thus I installed this https://bitbucket.org/ubernostrum/django-profiles/ for us

Re: How to use django-profile with django registration ?

2011-06-21 Thread Piotr Zalewa
: I am using 1.3 This is my settings.py http://dpaste.com/556954/ This is my urls.py http://dpaste.com/556955/ On Tue, Jun 21, 2011 at 7:14 PM, Piotr Zalewa mailto:zal...@gmail.com>> wrote: On 06/21/11 14:15, Satyajit Sarangi wrote: https://bitbucket.org/__ubernostrum/d

Re: How to use django-profile with django registration ?

2011-06-21 Thread Piotr Zalewa
PM, Piotr Zalewa mailto:zal...@gmail.com>> wrote: In urls.py you've got: url(r'^accounts/', include('registration.urls')), and later: (r'^accounts/', include('userprofile.urls')), /me is no expert, but that smells lik

Re: how to set up user profile in django-registration ?

2011-06-22 Thread Piotr Zalewa
On 06/22/11 16:09, Satyajit Sarangi wrote: I am using django registration , which is not displaying any profile when I log in . Thus I am not able to login . What should I do to overcome this ? I assume you've been reading docs already. (django-registration and django user management ones, po

Re: How to use the django-users mailing list properly and doing your homework..

2011-07-01 Thread Piotr Zalewa
Everything has its place. For me it looks like that: direct help - IRC searching for solutions - tutorials, documentation, django snippets discovering new stuff - email list, StackOverflow zalun On 07/02/11 01:11, Andre Terra wrote: To be honest, I often think about how an e-mail list is actua

Re: testclient cannot find the template

2010-12-15 Thread Piotr Zalewa
Hi Kenneth, It looks like the test can't find the /success/ URL and then tries to display a 404 error, but there is o 404.html template Do you have 404.html template created? zalun On 10-12-15 01:13, Kenneth Gonsalves wrote: hi, I am trying to write a test of a view with test client. My test

Re: testclient cannot find the template

2010-12-15 Thread Piotr Zalewa
This should work, is /success working in dev server? zalun On 10-12-15 03:53, Kenneth Gonsalves wrote: On Wed, 2010-12-15 at 03:44 -0800, Piotr Zalewa wrote: It looks like the test can't find the /success/ URL and then tries to display a 404 error, but there is o 404.html template D

Re: virtualenv and deployment

2010-12-15 Thread Piotr Zalewa
Better would be to create the requirements.txt and install directly on the server (pip install ir requirements.txt) I use mod_wsgi On 10-12-15 08:48, Álex González wrote: Hi! I'm using virtualenv with --no-site-packages and now I like to do a deployment of my app... I'm using a sharing hostin

Re: Authenticate every def in views.py

2010-12-18 Thread Piotr Zalewa
I remember using a middleware with an exception list. (more than a year ago) On 10-12-18 05:35, Łukasz Rekucki wrote: On 18 December 2010 13:48, James Bennett wrote: On Fri, Dec 17, 2010 at 8:43 PM, suckerfish wrote: I've added a decorator to *each* def in views.py to require authentication.

Re: Syntax Error

2011-01-04 Thread Piotr Zalewa
what happens if you'remove the commented lines? On 01/04/11 15:22, hank23 wrote: > Can someone explain to me what the following error is trying to tell > me: > > SyntaxError at /polls/1 > invalid syntax (urls.py, line 20)Request Method: GET > Request URL: http://127.0.0.1:8000/polls/1 > Django Ve

Re: Generic views

2011-01-11 Thread Piotr Zalewa
On 01/11/11 14:02, martinez wrote: > I would like to know if I could work without generic views. > Sure you can - simply define your own in [application]/views.py Please read the doc http://docs.djangoproject.com/en/1.2/#the-view-layer zalun -- blog http://piotr.zalewa.info jobs http://webdev

Re: TestCase and fixtures

2011-01-11 Thread Piotr Zalewa
Hi Simone Try fixtures = ['myfix'] On 01/11/11 21:25, Simone Dalla wrote: > Hi! > > I'm testing my application with a TestCase class, specifing "fixtures" > attribute in my class like: > > class MyTestCase(TestCase): > fixtures = ['myfix.json'] > > > I've created the folder "fixt

Re: Need HELP urgently

2011-01-12 Thread Piotr Zalewa
I'd also take a look at XHR requests (Web Console or Firebug's Net panel) On 01/12/11 13:53, Matias Aguirre wrote: > The given answers are correct, that's your issue without doubt, create an > admin > class for your Priority model and setup a raw_id_field[1]: > > class PriorityOptions(admin.Mod

Re: Javascript Questions

2011-01-12 Thread Piotr Zalewa
Is it in django-admin or completely irrelevant to this mailing list? zalun On 01/12/11 20:32, hank23 wrote: > I have a text field on a page which I want to disable when the page is > loaded and enable later when the user selects an entry in a dropdown > box. First how and where do I code the call

[django-users] Custom signals

2011-01-19 Thread Piotr Zalewa
I'm trying to add custom signals to my models. I'm sure I'm missing some step. http://paste.pocoo.org/show/323618/ zalun -- blog http://piotr.zalewa.info jobs http://webdev.zalewa.info twit http://twitter.com/zalun face http://facebook.com/zaloon -- You received this message because you ar

Re: [django-users] Custom signals

2011-01-20 Thread Piotr Zalewa
Yes, that was it! pre_copy.send(type(self), instance=self, ... On 01/20/11 01:37, Łukasz Rekucki wrote: > On 20 January 2011 02:00, Piotr Zalewa wrote: >> I'm trying to add custom signals to my models. >> I'm sure I'm missing some step. >> >> http:

Re: Where Is My Javascript Code's Problem?

2011-01-24 Thread Piotr Zalewa
I think you wanted something like this to happen: http://jsfiddle.net/zalun/96vsU/ zalun On 01/21/11 21:41, hank23 wrote: > I was actually hoping to see the results of the code altering the > screen fields dynamically when I click the button to call the > javascript function. So if this won't do

Re: validate changes in m2m field in admin panel

2011-02-11 Thread Piotr Zalewa
I would use signals for that purpose On 11-02-11 10:18, bagheera wrote: Hi, i would like to perform validation on m2m field to control, if user made any changes. I'd like to disallow removing relations from m2m field, only adding them. example: model Product(models.Model): name = models.

Re: images

2011-02-15 Thread Piotr Zalewa
Learn how to serve static files For the Django 1.3+ http://docs.djangoproject.com/en/dev/howto/static-files/ For Django 1.2 http://docs.djangoproject.com/en/1.2/howto/static-files/ Good luck zalun On 02/15/11 10:00, Szabo, Patrick (LNG-VIE) wrote: > Hi, > > I just want an image to be shown in m

Re: chrome extension

2011-02-16 Thread Piotr Zalewa
On 02/16/11 05:34, Tony Lambropoulos wrote: > Should I assume that this was a silly question? > > On Mon, Feb 14, 2011 at 10:10 PM, Tony > wrote: > > Hi, > Is there any way to have a chrome extension with a backend in Django, > like for storing data server

Re: confused about ModelForm Field validation

2011-02-18 Thread Piotr Zalewa
On 02/18/11 09:44, Roman Klesel wrote: > [..] in some cases the values > stored in the tables have to be converted before the can be displayed > and also have to be converted bevore bein saved to the database. > [...] > def clean(self,value): > "convert the literal value to the db rep

South - when to start?

2011-02-18 Thread Piotr Zalewa
Where is the best moment to start with south? 1. The very beginning, as the first app added to the project? 2. At the moment when more devs will be involved? 3. When real data will start to show? I'm building a new system, I think the current model progress is about 20%, where 100% is the moment

Re: South - when to start?

2011-02-18 Thread Piotr Zalewa
g migrations for schema and data. > > Of course, this method is not good if generating sample data takes a > lot of time. In such case migrating could be better solution. > > On 18 фев, 16:24, Piotr Zalewa wrote: >> Where is the best moment to start with south? >> >

Re: Collaborative text editor with Django

2011-02-24 Thread Piotr Zalewa
On 02/23/11 08:32, Anoop Thomas Mathew wrote: > Is there any collaborative text editing application available for django. > Has anybody tried with etherpad(www.etherpad.org > ) along with django? If you'd start building it - I'd be collaborating. zalun -- blog http://pi

Re: Collaborative text editor with Django

2011-02-26 Thread Piotr Zalewa
On 02/24/11 05:07, Brice Leroy wrote: > I'm very curious to know the use case for this kind of editor. I'm using > HG and GIT to manage merging and I'm quite happy with those. > Not all code is a part of bigger infrastructure, but here it is: pair programming in jsFiddle (which is a django projec

Selunium2 and Django

2011-02-26 Thread Piotr Zalewa
Hi, I'm trying to use Selenium2 (beta 2) with Django. I'd like to use it from within unit test. I installed the django-nose-selenium and I am able to connect to the server with ./manage.py test --with-selenium It doesn't load the page if I'm using the the WebDriver. Do you have any examples

Re: autocomplete omg

2011-02-28 Thread Piotr Zalewa
Hi, Would you give us a little info about your background? Are you familiar with JavaScript (jQuery, MooTools, YUI, anything) ? Can you create a front-end example of autocomplete with a fake data on http://jsfiddle.net/ ? The rest would be a simple search in Django zalun On 11-02-28 08:52,

Re: Collaborative text editor with Django

2011-03-01 Thread Piotr Zalewa
On 03/01/11 07:45, Anoop Thomas Mathew wrote: > @piotr zalewa: > jsFiddle is of course a nice > Is jsFiddle open source?? I couldn't find its source anywhere. > http://www.facebook.com/topic.php?uid=183790024998&topic=14241 > <http://www.facebook.com/topic.php?uid=18379