question about celery

2012-04-19 Thread Mike
I've set up a 'ghetto queue' for a django project.  The job information is 
stored in the django DB and I have a script that is run via cron which 
periodically checks the DB for new jobs and processes them.  Now I want to 
move the processing off to a different machine so I'm looking into Celery. 
 What I'm not sure about is what are the requirements of the workers.  Do 
they need to have the code they are going to run already installed or is it 
somehow pickled and sent to the worker?  My current script checks the DB 
for a job, runs the job, and then inserts the data into the django DB.  I 
guess this won't work with Celery because the remote workers won't have 
access to the django DB.  I guess the celery tasks should accept data and 
only return data - all the interaction with the database should happen on 
the web server hosting the django app, right?
Thanks
Mike

-- 
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/-/zdiVxf4FrIMJ.
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



saving a foreign key data table

2012-04-19 Thread Phang Mulianto
HI ,

I have a template which consist of fields in a master table and a foreign
key table. i want user fill the foreign key field data inline in 1 template.

and when use submit it, new data of course, i need the data to saved in the
master table, then save the foreign table with the foreignkey of the master
table id just inserted.

after some search and test i finaly get it, but need opinion is this the
best way to do this ?

here are the view code ;:

def myadmin_new_flat_page(request,
template_name="myadmin/change_data.html"):
if request.method == 'POST': # If the form has been submitted...
form = AdminFlatPageModelForm(request.POST) # A form bound to the
POST data
inlineform = AdminFlatPageMetaModelForm(request.POST) # A form
inline
postdata = request.POST.copy()
if form.is_valid(): # All validation rules pass
fp = form.save(commit=True)
fp.save()
key= request.POST.get('flatpage','nothing')
postdata['flatpage']=int(fp.pk)
key = str(request.POST)
a=str(postdata)
data={'flatpage_id':int(fp.pk),'keyword':'finest
code','description':'interested ? ' }
w='not'
inlineform=AdminFlatPageMetaModelForm(initial=data)  # this not
work ?
if not inlineform.is_valid():
   ifp = inlineform.save(commit=False)
   w='work'
   ifp.flatpage_id=fp.pk
   ifp.keyword = request.POST.get('keyword')
   ifp.description = request.POST.get('description')

   ifp.save()
messages.success(request, 'New '+ me +' Added' + str(fp.pk) +
key + a+w)
redirect=False
return
render_to_response('myadmin/please_wait.html',locals(),context_instance =
RequestContext(request) )
else:
form = AdminFlatPageModelForm()
inlineform = AdminFlatPageMetaModelForm()
button = _generate_button('new')
return render_to_response(template_name,locals(),context_instance =
RequestContext(request) )

i get manage to save the foreign table with manual assigning the fields.
then save it.

thanks before.

Mulianto

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: question about celery

2012-04-19 Thread bruno desthuilliers
On Apr 19, 11:05 am, Mike  wrote:

(...)
> Now I want to
> move the processing off to a different machine so I'm looking into Celery.
>  What I'm not sure about is what are the requirements of the workers.  Do
> they need to have the code they are going to run already installed

Yes. But you can use NFS to avoid having to keep the code in sync on
different machines.

> or is it
> somehow pickled and sent to the worker?

No.

>  My current script checks the DB
> for a job, runs the job, and then inserts the data into the django DB.  I
> guess this won't work with Celery because the remote workers won't have
> access to the django DB.

Why not ? Neither the django and/or celery processes have to run on
the same host as the SQL server, that's what the "HOST" setting is for
(https://docs.djangoproject.com/en/1.3/ref/settings/#std:setting-HOST)

FWIW, if you start to have performance issues, moving the SQL server
process to a different machine might be the first thing to do
(depending on where the issues are of course).

>  I guess the celery tasks should accept data and
> only return data - all the interaction with the database should happen on
> the web server hosting the django app, right?

Nope. Just use the right HOST setting.

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: cannot import name current_datetime

2012-04-19 Thread bruno desthuilliers
On Apr 18, 8:47 pm, asherakhet06 
wrote:
> H all!
>
> I am fairly new to programming (went over LPTHW) and now going through the
> Djangobook on the internet.  Quick beginners question:  In Chapter 3, where
> I am looking at a dynamic webpage in the 2nd example

Could you please post a link to this resource ?

> I am running into some
> problems with the current_datetime function I am trying to set up. When, in
> views.py I insert the "datetime.datetime.now()" statement and "import
> current_datetime" into my urls.py file

If your import statement is actually "import current_datetime", then
the book is wrong, Python imports dont work that way. You either
import a module then use a qualified name to access the module's
symbols, ie:

from myapp import views
now = views.current_datetime()

or import a symbol from a module and use it directly, ie:

from myapp.views import current_datetime
now = current_datetime()

of course the module (or the package containing the module) must be in
your pythonpath.

for more about the import statement, see

* http://docs.python.org/release/2.7/tutorial/modules.html

and

* 
http://docs.python.org/release/2.7/reference/simple_stmts.html#the-import-statement

> but it's been
> a real puzzle for me to be honest:/  Anybody have any tips on how to solve
> this error?  I know it is really important to be careful to copy EXACTLY as
> mentioned in the programming book(s),

Books are sometimes wrong, and sometimes a bit outdated.

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: apache2 privileges

2012-04-19 Thread bruno desthuilliers
On Apr 18, 5:12 pm, "Daniel Sokolowski"
 wrote:
> Hi Bruno,
>
> Can you expand on that, each of your sites has a user account created? Yes?

Depends on the concrete use-case but mostly, yes, each django site
will have a dedicated user account. If it's a dedicated hosting for
one customer having 2 or more sites, we either use the same user
account for all sites or (for either technical or customer-policy
reasons) one account per site.

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: cannot import name current_datetime

2012-04-19 Thread Timothy Makobu
The example works as the book describes
http://www.djangobook.com/en/1.0/chapter03/

 When, in views.py I insert the "datetime.datetime.now()" statement and
> "import current_datetime" into my urls.py file, I get the following error
> message when I try to call up the webpage via runserver.  It seems like my
> pure python script is not being picked up by the server:
>
> "ImportError cannot import name current_datetime".
>
>
>
Do it exactly as it says in the book:

from mysite.views import current_datetime

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Testing and custom filesystem

2012-04-19 Thread marue
I'm trying to test a form for uploading a userimage, but i'm pretty
stuck with a custom filesystem that just doesn't seem to react to
overriding settings for testing. The filesystem is really simple and
looks like this:

social_user_fs =
FileSystemStorage(location=settings.SOCIAL_USER_FILES,
   base_url=settings.SOCIAL_USER_URL)

In the models definition i then defined a function to return the url
for an image associated to that model:

def post_image(self):
try:
return self.image.url
except AttributeError:
return None

Now this works very well and behaves like i expect it to do. But i run
into a problem with testing:

class TestProfileImageUploadForm(TestCase):

# point the filesystem to the subfolder data of app/test/
@override_settings(SOCIAL_USER_FILES = os.path.dirname(__file__)+'/
data',
SOCIAL_USER_URL = 'profiles/')
def test_save(self):
profile = SocialUserProfile.objects.get(pk=1)
import ipdb; ipdb.set_trace()

Now the interactive debugging session gives me this:

ipdb> from django.conf import settings
ipdb> settings.SOCIAL_USER_FILES
'/Volumes/Data/Website/Backend/project/social_user/tests/data'
ipdb> settings.SOCIAL_USER_URL
'profiles/'
ipdb> profile.post_image()
'/user_files/profiles/1/profile_images/picture1-1.png'
# this is from the original settings
# the overridden settings should result in
# 'profiles/1/profile_images/picture1-1.png'
ipdb> f = file(profile.image.file)
*** IOError: [Errno 2] No such file or directory:
u'/Volumes/Data/Website/Backend/user_files/profiles/1/profile_images/
picture1-1.png'
# this is the path constructed from the original settings as well

So the settings have been overridden. It looks like my custom
filesystem is just not reacting to the override of the settings. Why
that? Any Ideas?

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Force the user to add an instance of some InlineModelAdmin when adding a model

2012-04-19 Thread Oscar Mederos
I have a UserAdmin, and I defined a UserProfileInline like this:

-
from ...  
from django.contrib.auth.admin import UserAdmin as UserAdmin_

class UserProfileInLine(admin.StackedInline):
model = UserProfile
max_num = 1
can_delete = False
verbose_name = 'Profile'
verbose_name_plural = 'Profile'

class UserAdmin(UserAdmin_):
inlines = [UserProfileInLine]
-

My UserProfile model has some required fields.

What I want is to force the user not only to enter the username & repeat
password, but also to enter at least the required fields so that the
UserProfile instance is created and associated to the User that is being
added.

If I enter anything in any field of UserProfileInline when creating the
user, it validates the form without problem, but if I don't touch any field,
it just creates the User and nothing happens with the UserProfile.

Any thoughts?
Thanks in advance.

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Force the user to add an instance of some InlineModelAdmin when adding a model

2012-04-19 Thread Daniel Sokolowski
I would suggest overriding the User's ModelForm and adding you validation as 
per any method here: 
https://docs.djangoproject.com/en/dev/ref/models/instances/?from=olddocs#validating-objects


Here is a sample code I use for UserProfile myself:

http://dpaste.com/734257/

Hope that helps.

From: Oscar Mederos
Sent: Thursday, April 19, 2012 7:24 AM
To: django-users@googlegroups.com
Subject: Force the user to add an instance of some InlineModelAdmin when 
adding a model


I have a UserAdmin, and I defined a UserProfileInline like this:

-
from ...
from django.contrib.auth.admin import UserAdmin as UserAdmin_

class UserProfileInLine(admin.StackedInline):
   model = UserProfile
   max_num = 1
   can_delete = False
   verbose_name = 'Profile'
   verbose_name_plural = 'Profile'

class UserAdmin(UserAdmin_):
   inlines = [UserProfileInLine]
-

My UserProfile model has some required fields.

What I want is to force the user not only to enter the username & repeat
password, but also to enter at least the required fields so that the
UserProfile instance is created and associated to the User that is being
added.

If I enter anything in any field of UserProfileInline when creating the
user, it validates the form without problem, but if I don't touch any field,
it just creates the User and nothing happens with the UserProfile.

Any thoughts?
Thanks in advance.

--
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Daniel Sokolowski
Web Engineer
KL Insight
http://klinsight.com/
Tel: 613-344-2116 | Fax: 613.634.7029
993 Princess Street, Suite 212
Kingston, ON K7L 1H3, Canada


Notice of Confidentiality:
The information transmitted is intended only for the person or entity to 
which it is addressed and may contain confidential and/or privileged 
material. Any review re-transmission dissemination or other use of or taking 
of any action in reliance upon this information by persons or entities other 
than the intended recipient is prohibited. If you received this in error 
please contact the sender immediately by return electronic transmission and 
then immediately delete this transmission including all attachments without 
copying distributing or disclosing same.



--
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



reportlab.platypus - frame and background image made with Canvas

2012-04-19 Thread luke lukes
Hi everyone. i'm using Reportlab to output an invoice on a simple
Django app. I've already modified the code many times and here's the
result: http://dpaste.com/734262/ .
Well, this code doesn't work. the issue seems to be on the section
from line to line 105 and line 108, on which i got the following
error:

AttributeError at /fattura/pdf/ 'dict' object has no attribute
'saveState'

removing that section the code works. though the output of line 107 is
, so the correct input object type for a Paragraph...
any suggestion/help?

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Bus Error: 10 (Intro Tutorial)

2012-04-19 Thread Harald Sigh Andertun
Hi all

I am totally new to django. Have followed the intro tutorial until part 
2, 
but when I start the development server and tries to access the admin page 
Python crashes immediately. The console prints "Bus error: 10".
I have been googling for a while now, but can't figure out why this error 
occurs.

Is it a code error, or an environment issue?

I use Python 2.6.2 and Django 1.4.0, and I have choosen sqlite3 as db.

I hope someone can enlighten me in what direction the problem might be ;)

Cheers,
Harald

-- 
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/-/8EP1qv3APR4J.
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Bus Error: 10 (Intro Tutorial)

2012-04-19 Thread David Markey
Bus error is usually a very low level problem.

Can you give a screen shot?

If you are on linux, also post dmesg.

On 19 April 2012 16:36, Harald Sigh Andertun wrote:

> Hi all
>
> I am totally new to django. Have followed the intro tutorial until part 
> 2,
> but when I start the development server and tries to access the admin page
> Python crashes immediately. The console prints "Bus error: 10".
> I have been googling for a while now, but can't figure out why this error
> occurs.
>
> Is it a code error, or an environment issue?
>
> I use Python 2.6.2 and Django 1.4.0, and I have choosen sqlite3 as db.
>
> I hope someone can enlighten me in what direction the problem might be ;)
>
> Cheers,
> Harald
>
> --
> 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/-/8EP1qv3APR4J.
> 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 options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Word Cap Form Labels

2012-04-19 Thread Lee Hinde
Terrific:

.control-label {text-transform: capitalize;}

Thanks.

On Wed, Apr 18, 2012 at 10:27 PM, Jonathan D. Baker <
jonathandavidba...@gmail.com> wrote:

> Not sure about django, but this is easy to do in CSS.
>
> Sent from my iPhone
>
> On Apr 18, 2012, at 11:21 PM, Lee Hinde  wrote:
>
> The default behavior for a form label is to capitalize the first letter -
> 'Report name'. I'd like to capitalize the first letter of each word -
> 'Report Name'. Short of manually over-riding each label, is there a
> built-in way to do that?
>
> Thanks.
>
>  --
>
>

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Bus Error: 10 (Intro Tutorial)

2012-04-19 Thread Harald Sigh Andertun
I actually just found the problem (by accident)

I had forgot a comma in the urls.py

urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls))*,*
)
 ^^ here

I am surprised this mistake caused a bus error.

Thanks for the help anyway :)

- Harald


Den torsdag den 19. april 2012 17.50.16 UTC+2 skrev David Markey:
>
> Bus error is usually a very low level problem.
>
> Can you give a screen shot?
>
> If you are on linux, also post dmesg.
>
> On 19 April 2012 16:36, Harald Sigh Andertun wrote:
>
>> Hi all
>>
>> I am totally new to django. Have followed the intro tutorial until part 
>> 2, 
>> but when I start the development server and tries to access the admin page 
>> Python crashes immediately. The console prints "Bus error: 10".
>> I have been googling for a while now, but can't figure out why this error 
>> occurs.
>>
>> Is it a code error, or an environment issue?
>>
>> I use Python 2.6.2 and Django 1.4.0, and I have choosen sqlite3 as db.
>>
>> I hope someone can enlighten me in what direction the problem might be ;)
>>
>> Cheers,
>> Harald
>>
>> -- 
>> 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/-/8EP1qv3APR4J.
>> 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 options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>

-- 
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/-/b2YP3DyFrq0J.
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Bus Error: 10 (Intro Tutorial)

2012-04-19 Thread Nikolas Stevenson-Molnar
Yes, that is very strange. Things like that should cause SyntaxErrors,
and if that was the only/last URL, you shouldn't even /need/ a comma
there. Whenever I've had bus errors, it usually ends up being a
threading problem, or a problem with a C extension.

_Nik

On 4/19/2012 8:59 AM, Harald Sigh Andertun wrote:
> I actually just found the problem (by accident)
>
> I had forgot a comma in the urls.py
>
> urlpatterns = patterns('',
> url(r'^admin/', include(admin.site.urls))*,*
> )
>  ^^ here
>
> I am surprised this mistake caused a bus error.
>
> Thanks for the help anyway :)
>
> - Harald
>
>
> Den torsdag den 19. april 2012 17.50.16 UTC+2 skrev David Markey:
>
> Bus error is usually a very low level problem.
>
> Can you give a screen shot?
>
> If you are on linux, also post dmesg.
>
> On 19 April 2012 16:36, Harald Sigh Andertun wrote:
>
> Hi all
>
> I am totally new to django. Have followed theintro tutorial
> until part 2
> , but
> when I start the development server and tries to access the
> admin page Python crashes immediately. The console prints "Bus
> error: 10".
> I have been googling for a while now, but can't figure out why
> this error occurs.
>
> Is it a code error, or an environment issue?
>
> I use Python 2.6.2 and Django 1.4.0, and I have choosen
> sqlite3 as db.
>
> I hope someone can enlighten me in what direction the problem
> might be ;)
>
> Cheers,
> Harald
> -- 
> 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/-/8EP1qv3APR4J
> .
> 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 options, visit this group at
> http://groups.google.com/group/django-users?hl=en
> .
>
>
> -- 
> 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/-/b2YP3DyFrq0J.
> 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 options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Bus Error: 10 (Intro Tutorial)

2012-04-19 Thread Harald Sigh Andertun
The syntax error was not the only problem. It helped a bit, but I still got 
bus errors.

I installed Python 2.7 and reinstalled Django-1.4 using pip insted of 
django's own setup.py install

I don't know if I've been wiser, but at least it seems to work now :-)


Den torsdag den 19. april 2012 17.36.53 UTC+2 skrev Harald Sigh Andertun:
>
> Hi all
>
> I am totally new to django. Have followed the intro tutorial until part 
> 2, 
> but when I start the development server and tries to access the admin page 
> Python crashes immediately. The console prints "Bus error: 10".
> I have been googling for a while now, but can't figure out why this error 
> occurs.
>
> Is it a code error, or an environment issue?
>
> I use Python 2.6.2 and Django 1.4.0, and I have choosen sqlite3 as db.
>
> I hope someone can enlighten me in what direction the problem might be ;)
>
> Cheers,
> Harald
>

-- 
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/-/wbphSrYwBCoJ.
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: external css and javascript files

2012-04-19 Thread dummyman dummyman
hi,,

Thank u guys . I ve fixed the static web page problem in django :)
On Tue, Apr 17, 2012 at 10:40 PM, dummyman dummyman wrote:

> thank u will try and will get back if i have further doubts
>
> On Tue, Apr 17, 2012 at 10:36 PM, Joel Goldstick  > wrote:
>
>> On Tue, Apr 17, 2012 at 12:50 PM, dummyman dummyman 
>> wrote:
>> >
>> > Hi
>> >
>> > attached is the settings.py and i ve placed my css files in static
>> directory
>> > of the app and in templates i ve given the path
>> >
>> > {{ STATIC_URL }} path
>> >
>> > On Tue, Apr 17nk  2012 at 10:13 PM, Joel Goldstick <
>> joel.goldst...@gmail.com>
>>
>> > wrote:
>> >>
>> >> On Tue, Apr 17, 2012 at 11:53 AM, dummyman dummyman <
>> tempo...@gmail.com>
>> >> wrote:
>> >> > hi,
>> >> >
>> >> > i tried it before  but didnt get d required results.
>> >> >
>> >> > On Tue, Apr 17, 2012 at 8:16 PM, Eugenio Minardi
>> >> > 
>> >> > wrote:
>> >> >>
>> >> >> Hi,
>> >> >>
>> >> >> you can find a detailed guide
>> >> >> here https://docs.djangoproject.com/en/dev/howto/static-files/
>> >> >>
>> >> >> On Tue, Apr 17, 2012 at 4:18 PM, dummyman dummyman <
>> tempo...@gmail.com>
>> >> >> wrote:
>> >> >>>
>> # Absolute path to the directory static files should be collected to.
>> # Don't put anything in this directory yourself; store your static files
>> # in apps' "static/" subdirectories and in STATICFILES_DIRS.
>> # Example: "/home/media/media.lawrence.com/static/"
>> STATIC_ROOT = ''
>> Do you want this to be blank?  It should be a path to a directory
>> (perhaps below your Project root)
>>
>> # URL prefix for static files.
>> # Example: "http://media.lawrence.com/static/";
>> STATIC_URL = '/static/'
>>
>> # URL prefix for admin static files -- CSS, JavaScript and images.
>> # Make sure to use a trailing slash.
>> # Examples: "http://foo.com/static/admin/";, "/static/admin/".
>> ADMIN_MEDIA_PREFIX = '/static/admin/'
>>
>> # Additional locations of static files
>> STATICFILES_DIRS = (
>># Put strings here, like "/home/html/static" or "C:/www/django/static".
>># Always use forward slashes, even on Windows.
>># Don't forget to use absolute paths, not relative paths.
>>"/home/temp/recommendation/templates/",
>>
>> You need to put directories where to find your files here.  You can
>> use as many as you like.  Perhaps different for js or css or whatever
>> )
>>
>> --
>> Joel Goldstick
>>
>> --
>> 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 options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Bus Error: 10 (Intro Tutorial)

2012-04-19 Thread David Markey
Could have been an abi change between python and a new library installed
with one of the OSX upgrades.



On 19 April 2012 18:33, Harald Sigh Andertun wrote:

> The syntax error was not the only problem. It helped a bit, but I still
> got bus errors.
>
> I installed Python 2.7 and reinstalled Django-1.4 using pip insted of
> django's own setup.py install
>
> I don't know if I've been wiser, but at least it seems to work now :-)
>
>
> Den torsdag den 19. april 2012 17.36.53 UTC+2 skrev Harald Sigh Andertun:
>
>> Hi all
>>
>> I am totally new to django. Have followed the intro tutorial until part 
>> 2,
>> but when I start the development server and tries to access the admin page
>> Python crashes immediately. The console prints "Bus error: 10".
>> I have been googling for a while now, but can't figure out why this error
>> occurs.
>>
>> Is it a code error, or an environment issue?
>>
>> I use Python 2.6.2 and Django 1.4.0, and I have choosen sqlite3 as db.
>>
>> I hope someone can enlighten me in what direction the problem might be ;)
>>
>> Cheers,
>> Harald
>>
>  --
> 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/-/wbphSrYwBCoJ.
>
> 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 options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



PostgreSQL Socket 5432 Error

2012-04-19 Thread Zach
Hi I am trying to setup a PostgreSQL database for Heroku. I am running
into trouble.

I installed PostgreSQL(9.0) from EnterpriseDB on OS X 10.6. However,
when I do a simple

 $ psql -U postgres

I get this error message.

 psql: could not connect to server: No such file or directory
 Is the server running locally and accepting
 connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.
5432"?

I am getting the same message when I do a syncdb.

Any ideas what could be causing this.  Thank you so much!

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: PostgreSQL Socket 5432 Error

2012-04-19 Thread Russell Keith-Magee
On Friday, 20 April 2012 at 6:04 AM, Zach wrote:
> Hi I am trying to setup a PostgreSQL database for Heroku. I am running
> into trouble.
> 
> I installed PostgreSQL(9.0) from EnterpriseDB on OS X 10.6. However,
> when I do a simple
> 
> $ psql -U postgres
> 
> I get this error message.
> 
> psql: could not connect to server: No such file or directory
> Is the server running locally and accepting
> connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.
> 5432"?
> 
> I am getting the same message when I do a syncdb.
> 
> Any ideas what could be causing this. Thank you so much!
> 
Well, the error message asks you:
> Is the server running locally and accepting
> connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.
> 5432"?



Is it? I'm going to go out on a limb and say "No, it isn't". 

Just because you've installed Postgres doesn't *necessarily* mean you've 
started the Postgres server. If the server isn't running, you won't be able to 
connect to the server, which is what psql (and syncdb) is trying to do.

Yours,
Russ Magee %-)

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: PostgreSQL Socket 5432 Error

2012-04-19 Thread Jeff Heard
The other possibility is that you need to build psycopg2 from scratch and set 
the pg_config option in setup.cfg. I have to do this with the brew build of pg 
because the socket is elsewhere



On Apr 19, 2012, at 7:32 PM, Russell Keith-Magee  
wrote:

> On Friday, 20 April 2012 at 6:04 AM, Zach wrote:
>> Hi I am trying to setup a PostgreSQL database for Heroku. I am running
>> into trouble.
>> 
>> I installed PostgreSQL(9.0) from EnterpriseDB on OS X 10.6. However,
>> when I do a simple
>> 
>> $ psql -U postgres
>> 
>> I get this error message.
>> 
>> psql: could not connect to server: No such file or directory
>> Is the server running locally and accepting
>> connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.
>> 5432"?
>> 
>> I am getting the same message when I do a syncdb.
>> 
>> Any ideas what could be causing this. Thank you so much!
>> 
> Well, the error message asks you:
>> Is the server running locally and accepting
>> connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.
>> 5432"?
> 
> 
> 
> Is it? I'm going to go out on a limb and say "No, it isn't". 
> 
> Just because you've installed Postgres doesn't *necessarily* mean you've 
> started the Postgres server. If the server isn't running, you won't be able 
> to connect to the server, which is what psql (and syncdb) is trying to do.
> 
> Yours,
> Russ Magee %-)
> 
> -- 
> 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 options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Audio Streaming from server

2012-04-19 Thread atul khairnar
Hi,
I am writing an Internet Radio App. But when i start the app from the
localhost, it does not stream the audio. Streaming just stops. I tried to
use Icecast2 media streaming server, even it is not working. Or may be I am
not using it properly.
SO I wanted to ask how to stream audio from server to the client? Please
Help


-- 
Atul Khairnar
College of Engineering , Pune, India.

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.