Re: IOError at / [Errno 13] Permission denied

2011-11-23 Thread marjenni
Thank you for your help, that sorted that issue! On Nov 22, 5:18 pm, Tom Evans wrote: > On Tue, Nov 22, 2011 at 10:35 AM, marjenni > > > > > > > > > > wrote: > > Hi all, > >   I have been writing a django app, and testing locally using > > runserver. > > > Now I am in the process of moving this

Re: Django : CSRF and variable handling in a view

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

'function' object has no attribute 'as_view'

2011-11-23 Thread youpsla
Hello, the issue here seems to be trivial, maybe I got something in my eyes, but I can't find the solution. Here is my code: urls.py url(r"magasin/(?P\d+)/evenement/new/$", EvenementCreateView.as_view(model=Evenement), name='new_evenement_magasin'), views.py: class EvenementCreateView(CreateView

Re: How-to for static files?

2011-11-23 Thread Ivo Brodien
Hi, STATIC_URL is not working in your template because the template does not get the RequestContext, which has all the variables in it. use the render shortcut [1] instead of render_to_reponse BTW: It seems you are using the development version. You should change to 1.3.1 Does this help? [1]

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

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

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

2011-11-23 Thread youpsla
Hi, thnaks for your answer. It's the same. it doesn't work. For information I use generic view for other part of the site with: url(r"magasin/(?P\d+)/supprimer/$", DeleteView.as_view(model=Magasin, success_url="/magasins/liste"), name='magasin_supprimer'), and it works fine. And has you say, dj

Re: How-to for static files?

2011-11-23 Thread Ivo Brodien
you did not read the post by Tom Evans, did you? ;) remove "django.core.context_processors.tz”, or just put: ("django.contrib.auth.context_processors.auth", "django.core.context_processors.debug", "django.core.context_processors.i18n", "django.core.context_processors.media", "django.core.context

Re: How-to for static files?

2011-11-23 Thread Ivo Brodien
show your myapp.views.py file and is it the (r'^home/$','myapp.views.homepage'), which is not working? Is it showing the html source that you expect just not rendered or something else? It is always a good idea to provide as much details as possible. But yeah, we are getting close. cheers Iv

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

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

Re: Django : CSRF and variable handling in a view

2011-11-23 Thread Nolhian
Okay thanks ! I also pass has_account=True in the view if the user is authenticated. I noticed that it evaluated it to False if it was missing, I just wanted to be sure before removing it that it was not considered to be "the best practice" to pass it anyway :) On Nov 23, 10:59 am, Ivo Brodien w

Re: Django : CSRF and variable handling in a view

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

Re: How-to for static files?

2011-11-23 Thread Ivo Brodien
ok, i think we got it. def items(request): item_list=Item.objects.all() return render(request, 'myapp/items.html', {'items_list':items_list}, content_type="text/css") you are returning html and text/css. Your HTML includes a CSS but that is a different story. The Browser will ask

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

2011-11-23 Thread youpsla
Hi again, yes I'm sure the error comes from here. Bellow is the full trace back: Environment: Request Method: GET Request URL: http://127.0.0.1:8010/magasin/ Django Version: 1.3.1 Python Version: 2.7.2 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.cont

Re: How-to for static files?

2011-11-23 Thread Guillaume Chorn
Hi, The location of my CSS file is /Users/guillaumechorn/Documents/project/myapp/static/stylesheet.css. Sorry, I may have missed you asking for this earlier. Here is my views.py: http://dpaste.com/660653/ When I hardcode the disk location of the CSS file in the template (like so: ), the CSS sho

Import error when unit testing with django.test.client on django 1.1.1

2011-11-23 Thread Erlendur Hákonarson
I am trying to set up unit tests on my project but when I try to import anything from f.e. django.test then I get this error: Traceback (most recent call last): File "C:\eclipse\plugins\org.python.pydev.debug_2.2.2.2011082312\pysrc\pydev_runfiles.py", line 307, in __get_module_from_str mod

Re: How-to for static files?

2011-11-23 Thread Guillaume Chorn
Hi, Thanks for continuing to follow up on this. Something is definitely happening now. I went ahead and put this into my views.py: from django.shortcuts import render def items(request): item_list=Item.objects.all() return render(request, 'myapp/items.html', {'item_list':item_list},

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

2011-11-23 Thread eprikazc
You might be re-defining EvenementCreateView somewhere else as a function. To check it, I would suggest you to look up all occurences of "EvenementCreateView" in your files. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: How-to for static files?

2011-11-23 Thread Guillaume Chorn
Gah! Removed it, but now when I load up the page, it just shows me HTML source code. The rest of the views work fine. Sorry for all this trouble. But at least something is happening with each change you suggest! I now have more hope than I've had in quite a while. I think we're getting close!

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

2011-11-23 Thread eprikazc
You might be overriding EvenementCreateView somewhere else. To check it I would suggest you to look up all occurencies of EvenementCreateView in your files Eugene On Nov 23, 3:47 pm, youpsla wrote: > Hi, > thnaks for your answer. It's the same. it doesn't work. > > For information I use generic

Re: How-to for static files?

2011-11-23 Thread Guillaume Chorn
Sorry, I thought I included my views.py earlier, but here it is: http://dpaste.com/660653/ It is the (r'^items/$','myapp.views.items') which is not working. It shows the expected HTML source--basically, exactly what I have in the template file, except {{ STATIC_URL }} has been changed to '/sta

Re: How-to for static files?

2011-11-23 Thread Guillaume Chorn
Oops, I guess maybe you meant since I've changed the views.py file since I last included it? Here is the newest version: http://dpaste.com/660808/ thanks, Guillaume On Wed, Nov 23, 2011 at 9:36 PM, Guillaume Chorn wrote: > Sorry, I thought I included my views.py earlier, but here it is: > > ht

cannot connect to postgresql database

2011-11-23 Thread TANYA
hello, i am new to python but want to learn a framework like django so i installed it on ubuntu but cannot connect to the postgresql databasei done know if this is postgresql problem or ubuntu problem or django? where should i ask for help to connect django to postgresql? i follow the tutoria

Re: How-to for static files?

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

Can't figure a problem with Users not being able to log in.

2011-11-23 Thread Tyrel Souza
Client emailed me this morning saying: We have had several complaints from members who are having trouble logging in. This has been going on for three weeks. When they log in they are either sent to a blank page or redirected to the login page with no . We have followed up with several of

Re: cannot connect to postgresql database

2011-11-23 Thread Simon Riggs
On Wed, Nov 23, 2011 at 1:42 PM, TANYA wrote: > hello, i am new to python but want to learn a framework like django so > i installed it on ubuntu but cannot connect to the postgresql > databasei done know if this is postgresql problem or ubuntu > problem or django? where should i ask for help

Re: How-to for static files?

2011-11-23 Thread Ivo Brodien
Great. Glad te be of help. and yes, the missing RequestContext was what was missing. And insteas of trying months for yourself just drop a few lines here on that list in the furure ;-) happy coding! On Nov 23, 2011, at 15:13 , Guillaume Chorn wrote: > IT WORKED!!! Holy cow. So my main issue

Re: Import error when unit testing with django.test.client on django 1.1.1

2011-11-23 Thread xordoquy
Hi The error is: > ImportError: Could not import settings 'DER.settings' (Is it on > sys.path? Does it have syntax errors?): No module named DER.settings > ERROR: Module: Test could not be imported (file: > C:TFSSrc_BranchDER_UnitTestingboteststestListsTest.py). You should google a bit on how to

Re: Can't figure a problem with Users not being able to log in.

2011-11-23 Thread joelryan2k
Are you running multithreaded? I had similar issues until I eliminated threads and just used multiple processes. Pinax was involved in my problem, too. On Nov 23, 9:36 am, Tyrel Souza wrote: > Client emailed me this morning saying: > >         We have had several complaints from members who are

Re: Large Queryset Calculation In Background?

2011-11-23 Thread Nan
Thanks, Tim -- that looks handy too. Can anyone comment on the database locking question? On Nov 22, 10:16 pm, Tim Chase wrote: > On 11/22/11 17:04, Nikolas Stevenson-Molnar wrote: > > > I wouldn't expect it to lock the database (though someone with more > > database expertise should address t

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

2011-11-23 Thread youpsla
Hello all, I've verified that I don't override the class. I've found the reason of the bug. When I delete "@login_required", it works. My class was in view.py: @login_required class EvenementCreateView(.): . I apologize for not have copy/paste that in my first post. I've done the test

Django and its MySQL databases

2011-11-23 Thread Daniele Procida
My old database's tables were MyISAM. On my new server, MySQL by default uses InnoDB, which I understand is preferable. However, when I ask Django tp a new table, on a database on the new server (which still contains lots of MyISAM tables imported from the old database) it creates them with for

displaying images

2011-11-23 Thread marjenni
Hi all, Again, I am sure this is a very common problem for beginners, but all help appreciated. In a python function I am building a webpage, and trying to add images to a table like this: html += " " % imageName return HttpResponse(html) Now the table is displayed fine, but images are m

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

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

Re: displaying images

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

Re: displaying images

2011-11-23 Thread Adam Stein
On Wed, 2011-11-23 at 08:31 -0800, marjenni wrote: > Hi all, >Again, I am sure this is a very common problem for beginners, but > all help appreciated. > > > In a python function I am building a webpage, and trying to add > images to a table like this: > > html += " > " % imageName > > re

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

2011-11-23 Thread youpsla
Thanks for all. Agai I apologize for not having post this "etail" in my originl post. Regards Alain -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/cvt5q

Re: Looking for my replacement (Lead Developer at a Start-up)

2011-11-23 Thread Hussein Ahmed
Hi Kurtis, Are they giving equity as part of this or is it just a hourly pay? On Nov 22, 4:41 pm, Kurtis wrote: > Hey Guys, > > I am the lead developer at fireflie.com. The site is going through a total > site-rebuild using Django. I'm taking a research position early next month > and need to fin

Re: Looking for my replacement (Lead Developer at a Start-up)

2011-11-23 Thread Kurtis Mullins
Hello Hussein, Thanks a lot for messaging me. At this time, I would only expect hourly pay. There may be an option of equity in the future but honestly I can't make that decision or give you any guarantees on that matter. We're received several great replies and are in the middle of reviewing

Re: Looking for my replacement (Lead Developer at a Start-up)

2011-11-23 Thread Kurtis Mullins
I apologize guys, I tried to use Apple Mail to respond to a post and it accidentally leaked on to here. Please disregard that message. I'm going to stick to using gmail! I apologize for releasing a first name. I don't intend on releasing any private information, in case anyone is concerned! On Wed

Re: aggregate(Sum('x')) returns None

2011-11-23 Thread M. Can Bayrak
Agree, i think sum must return decimal. Same problem with me. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/tS-EZk6nTbEJ. To post to this group, send emai

Re: Django for a large social networking or photo sharing site?

2011-11-23 Thread badlearner
@Simon: Thanks for the suggestion and reply. I have a question... I am an absolute beginner in programming, so the code I write (whilst using Django) may not be very very mature. So, do you think it would be okay (easy?) to optimize it as time passes by? This is probably related to Python, but I

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

2011-11-23 Thread Peter Bengtsson
(django version 1.3.1) To explain my set up would be very hard as it's not just plain Django but there's a bunch of other third parties involved but we'll have to try. I'm getting this traceback when running tests:: Traceback (most recent call last): File "/Users/peterbe/dev/MOZILLA/PTO/pto/

Perhaps more of a general Python question, but..

2011-11-23 Thread Jeff Heard
I have several django apps. all of which are in separate packages and can be installed seperately. I would like them all to be sub-packages of a master package named "ga" So: ga.datacube ga.pyramid ga.sensorcollection and so on. The problem is that when I install them the packages never seem t

Re: Can't figure a problem with Users not being able to log in.

2011-11-23 Thread Tyrel Souza
We bumped up our preform MPM max threads to 50 from 20, seeing if this is the problem. Our sysop is out for the week. On Nov 23, 10:43 am, joelryan2k wrote: > Are you running multithreaded?  I had similar issues until I > eliminated threads and just used multiple processes.  Pinax was > involved

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

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

Re: Perhaps more of a general Python question, but..

2011-11-23 Thread DrBloodmoney
On Wed, Nov 23, 2011 at 2:01 PM, Jeff Heard wrote: > I have several django apps. all of which are in separate packages and can be > installed seperately.  I would like them all to be sub-packages of a master > package named "ga" So: > ga.datacube > ga.pyramid > ga.sensorcollection >  and so on.  T

Re: Perhaps more of a general Python question, but..

2011-11-23 Thread Jeff Heard
Okay, I did this, but I also have stuff that I'm adding to the django.contrib namespace, or at least I did. I created the following: django/ __init__.py # empty contrib/ __init__.py # empty and in my packages line in setup.py I had just ['django']. Now I seem to have overwritten all of

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

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

Re: Django for a large social networking or photo sharing site?

2011-11-23 Thread Mario Gudelj
I'd suggest you to learn 2.x, since django doesn't run on 3. I would just get into it. Make sure you learn pure basics of programming and Python and then just start with that first django Polls tutorial and make sure you understand every line of code as you go along. Finish few tuts, first 7 chapte

Re: Large Queryset Calculation In Background?

2011-11-23 Thread Nikolas Stevenson-Molnar
What database are you using? You should be able to find information in the documents about the locking behavior for that database. Compare that with the operations your running and determine whether they would result in an exclusive lock. >From your pseudocode, it looks like you're performing a po

django testing: adapt some vars in settings.py if testing

2011-11-23 Thread Gelonida N
Hi, I just started reading about django testing. Now I have a small question. Whe running tests I would like to change a few variables in settings.py, but keep all the rest identical. Example: - I might like ot change the media directory - I might like to use another db engine How can I achie

Re: Django : CSRF and variable handling in a view

2011-11-23 Thread Nolhian
Thanks again, Indeed that is nice to know ! Unfortunately I guess I'm still bound to use request.user.is_authenticated() in my view in this case : def index(request): if request.user.is_authenticated(): return render_to_response('index.html', {'has_account': True})

Hiring: Kickass Python & Web Developer Budapest

2011-11-23 Thread Agnes File
Job Description of the full time position: Develop business logic middleware for an internet media content streaming and download system. This middleware provides API for - mostly - mobile client apps, and connects to several backends for accessing content, authentication etc. Job also involves imp

Re: django testing: adapt some vars in settings.py if testing

2011-11-23 Thread Mike Dewhirst
There was a great solution to this posted just yesterday ... import sys if 'runserver' in sys.argv: DEBUG = True else: DEBUG = False ... which suggests if 'test' in sys.argv: do this On 24/11/2011 9:53am, Gelonida N wrote: Hi, I just started reading about django testing. Now

Re: django testing: adapt some vars in settings.py if testing

2011-11-23 Thread Gelonida N
Hi Mike, Yes this idea is simple enough. I just wondered whether there isn't a tiny risk of finding 'test' as a paramter of one of the option in some esotheric cases. For what I am doing the solution should be absolutely fine. With my habit of using ./manage.py I could even change it to if sys.

Re: Django : CSRF and variable handling in a view

2011-11-23 Thread DrBloodmoney
> If I don't check anywhere in the view if a user is authenticated, he > can still use the form to post data and my goal is that if a user is > authenticated he can't ( in the template if a user is authenticated it > doesn't display the form ). > I'm aware that it kind of defy the DRY principle bec

Re: Django : CSRF and variable handling in a view

2011-11-23 Thread Nolhian
> This seems all sorts of wrong to me. Why couldn't the user just log > out and then post? Seems like an odd workflow, but I don't know your > business-case here. Yes the user can just log out and then post but since this is a sign- up form it would seem logical to not be able to sign-up if the us

Named URLs Error

2011-11-23 Thread eeyore
This seems like a very simple problem but I can't figure out why it doesn't work. What I am trying to do is to link to a particular view via a named url. /urls.py -- urlpatterns = patterns('', (r'^products/', inc

Re: cannot connect to postgresql database

2011-11-23 Thread TANYA
I follow this page http://www.djangobook.com/en/2.0/chapter02/ but didnt install django in /home/tanya/. I put it in different place /home/tanya/learndjango/Django-1.3.1 but I start project in "learndjango". I install Postgresql with apt-get so Postgresql is not in this same folder. The page says "