Django Admin template error

2010-11-13 Thread Tsolmon Narantsogt
Dear comrades

i'm using Django 1.1 with Postgres.

I got a following error

ImportError: No module named urls


 212223
   {% block branding %}{% endblock %}2425{%
if user.is_authenticated and user.is_staff %}2627{% trans 'Welcome,' %}28
{% firstof user.first_name user.username %}.29
{% block userlinks %}30{% url
django-admindocs-docroot as docsroot %}31{% if
docsroot %}32{% trans
'Documentation' %}



But i already installed djangodocs on my INSTALLED_APPS (

   'django.contrib.admindocs',

)

 and in my urls.py


(r'^admin/doc/', include('django.contrib.admindocs.urls')),

(r'^admin/', include(admin.site.urls)),


So have you any solution ?


Thanks

Tsolmon.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Create User from an User extension

2010-11-13 Thread Karim Gorjux
On Sat, Nov 13, 2010 at 00:08, Steve Holden  wrote:
> When you add a Persona the UserInline lets you enter a User record, but
> the User has to be saved before the Persona. You could do this by
> extending the Persona.save() method to save the User as well.

Thanks a lot. I'll try.

-- 
K.
Blog Personale: http://www.karimblog.net

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Django Admin template error

2010-11-13 Thread Robbington
Hi Tsolmon,

Can you post your full urls.py file for me?


Rob

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: TemplateDoesNotExist

2010-11-13 Thread Robbington
Hi Lindsay,

I would be happy to sort out your problem for a small fee.

Rob

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Django Admin template error

2010-11-13 Thread Tsolmon Narantsogt
Yes

#coding:utf8

import os
from django.conf.urls.defaults import *
from django.contrib import admin
from django.conf import settings
admin.autodiscover()

urlpatterns = patterns('',
# Example:
# Uncomment the admin/doc line below and add 'django.contrib.admindocs'
# to INSTALLED_APPS to enable admin documentation:
#(r'^admin/doc/', include('django.contrib.admindocs.urls')),

# Uncomment the next line to enable the admin:

(r'^$', include('public.urls')),
#(r'^admin/doc/', include('django.contrib.admindocs.urls')),
(r'^admin/', include(admin.site.urls)),
(r'^products/$', include('products.urls')),
(r'^public/', include('public.urls')),
(r'^certificate/', include('certificate.urls')),
(r'^contactus/$','public.views.Contactus'),
(r'^aboutus/$','public.views.Aboutus'),
(r'^ourservice/$','public.views.Ourservice'),
(r'^news/$','public.views.LastNews'),
(r'^place/$','public.views.Ourplace'),

(r'^site_media/(?P.*)$', 'django.views.static.serve',
{'document_root': os.path.join(os.path.dirname(__file__), 'public/media'),
'show_indexes': False}),
(r'^admin_media_prefix/(?P.*)$', 'django.views.static.serve',
{'document_root': os.path.join(os.path.dirname(__file__),
'public/media/admin'), 'show_indexes': False}),
)

urlpatterns += patterns('django.contrib.auth.views',
(r'^accounts/login/$', 'login', {'template_name': 'login.html'}),
(r'^accounts/logout/$', 'logout', {'template_name': 'logout.html'}),
)


On Sat, Nov 13, 2010 at 6:45 PM, Robbington wrote:

> Hi Tsolmon,
>  Can you post your full urls.py file for me?
>
>
> Rob
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@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-us...@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: Django Admin template error

2010-11-13 Thread Robbington
Bit confused,

You said

"But i already installed djangodocs on my INSTALLED_APPS (

   'django.contrib.admindocs', "

and in my urls.py


(r'^admin/doc/', include('django.contrib.admindocs.urls')), "

But  in your urls.py admin docs is clearly commented out.

 #(r'^admin/doc/', include('django.contrib.admindocs.urls')),

If you are recieveing this error when visting www.yoursite/admin/doc
this is why.

Rob


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Django Admin template error

2010-11-13 Thread Tsolmon Narantsogt
oops Sorry
it's my real urls.py file


#coding:utf8

import os
from django.conf.urls.defaults import *
from django.contrib import admin
from django.conf import settings
admin.autodiscover()

urlpatterns = patterns('',
(r'^$', include('public.urls')),
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
(r'^admin/', include(admin.site.urls)),
(r'^products/$', include('products.urls')),
(r'^public/', include('public.urls')),
(r'^certificate/', include('certificate.urls')),
(r'^contactus/$','public.views.Contactus'),
(r'^aboutus/$','public.views.Aboutus'),
(r'^ourservice/$','public.views.Ourservice'),
(r'^news/$','public.views.LastNews'),
(r'^place/$','public.views.Ourplace'),

(r'^site_media/(?P.*)$', 'django.views.static.serve',
{'document_root': os.path.join(os.path.dirname(__file__), 'public/media'),
'show_indexes': False}),
(r'^admin_media_prefix/(?P.*)$', 'django.views.static.serve',
{'document_root': os.path.join(os.path.dirname(__file__),
'public/media/admin'), 'show_indexes': False}),
)

urlpatterns += patterns('django.contrib.auth.views',
(r'^accounts/login/$', 'login', {'template_name': 'login.html'}),
(r'^accounts/logout/$', 'logout', {'template_name': 'logout.html'}),
)

But that's following the error.

No module named urls
admin/templates/admin/base.html, error at line *30*

*30  {% url django-admindocs-docroot as docsroot %}*







On Sat, Nov 13, 2010 at 9:03 PM, Robbington wrote:

> Bit confused,
>
> You said
>
> "But i already installed djangodocs on my INSTALLED_APPS (
>
>   'django.contrib.admindocs', "
>
> and in my urls.py
>
>
> (r'^admin/doc/', include('django.contrib.admindocs.urls')), "
>
> But  in your urls.py admin docs is clearly commented out.
>
>  #(r'^admin/doc/', include('django.contrib.admindocs.urls')),
>
> If you are recieveing this error when visting www.yoursite/admin/doc
> this is why.
>
> Rob
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@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-us...@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.



Using locales 'en-au' 'en-ca' 'en-nz' and 'en-za' in Django

2010-11-13 Thread Wayne Merry
Hi,

Django has en and en-gb installed as languages in it's core. If a
django project wishes to use other locales such as 'en-au' or any of
the others listed in the subject line, how would one go about this
given that a language cannot be used unless it is in the core?

Essentially, how does one go about adding these languages to the core.
en-au and en-nz can essentially be a copy of en-gb.

Regards,
Wayne

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.



Sidebar blocks

2010-11-13 Thread dgmyrs
Hi,

I am just getting started in Django, and am running into a question
about the best Django way to go about setting up sidebar type blocks.
For my site I would like to have a few sidebar items that are
dynamically driven from the database.  I am confused as to how this
fits into the views and templates.

I first thought I would setup a view for the sidebar block, and then
include it's template with the {% include %} in the base.html
template.  However, I soon realized that this just includes the
template code, but doesn't get the values fed to it by the view, since
you are not including the view, just the template html.

Then I thought I could setup the base.html as a view, but I think I
would run into the same issue.

Next thought was for each view, add the extra data needed for the
sidebar block, and override the base.html block for that area, but
this doesn't seem very practical, and doesn't feel like the Django way
of less code.

So in summary, I am looking for advice on how this sort of issue
should be approached in Django.

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-us...@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: Django Admin template error

2010-11-13 Thread Robbington
Ok,

Thanks, I was just seeing if it was a more basic error.

Unfortunately with out seeing more of your code/ error message it is
hard to diagnose the problem. I have to go out now for a few hours,
but if you post the full error message someone/or myself when I get
back maybe able to help you.

It could be a mirad of things, error in one of your views, a problem
in your settings.py(Check you ROOT_URLCONF to make sure it is pointing
to the right place)or a compatiabilty issue if you have recently
upgraded django, unless I have missed something really obvious. I have
found a few posts that resolve similar problems to get you started:

http://www.pubbs.net/201002/django/15026-no-module-named-urls.html

http://groups.google.com/group/django-users/browse_thread/thread/e54e9801e053ecd3

I hope this helps.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Sidebar blocks

2010-11-13 Thread Jason Mayfield
On Nov 12, 2010, at 11:41 PM, dgmyrs wrote:

> So in summary, I am looking for advice on how this sort of issue
> should be approached in Django.


I don't know about "should", but I often accomplish this via inclusion template 
tags.  Inclusion tags are described in the docs here:

http://docs.djangoproject.com/en/1.2/howto/custom-template-tags/#inclusion-tags

- Jason

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Input welcome for comments app idea

2010-11-13 Thread Kevin Renskers
A first version has been committed to Bitbucket:
http://bitbucket.org/bolhoed/django_disqus_comments/

Showing your Disqus comments from your templates works, saving them
still needs to be done. Also, getting the comments from code does not
work yet, which breaks (for example) django-blog-zinnia's admin site
where they show the number of comments per blog entry.

If people are interested in this project, feel free to clone the
project, send me a message, etc.

Cheers,
Kevin


On Nov 12, 12:14 pm, Kevin Renskers  wrote:
> Hi,
>
> My new Django website is as good as finished, I only have to work on
> the comments section. I know about the comments app that ships with
> Django, but I don't really like it that much. I see three options for
> comments on my website:
>
> 1) Use something like django-threadedcomments
> 2) Use Disqus or IntenseDebate
> 3) Implement my own COMMENTS_APP that extends the default Django
> comments app
>
> Option one doesn't make it a whole lot better. There is still no way
> to register, login, do good spam checking, moderation, delete your own
> comments, etc. At least not without a lot of work.
>
> Option two, use Disqus, is what I used to do on my old website. Drop
> in some javascript, and you're done. However, with django-blog-zinnia
> running the blog, there are advantages when using Django's comments
> app: they show up in the admin interface, you can get the most popular
> blog entries (by comment count), no need for javascript just to show
> how many comments an article got, etc. So that brings me to option
> three:
>
> Disqus offers a REST api. So in theory it should be possible to write
> my own comments app that extends Django's default comments app. That
> way you use all the power of Disqus, and Django's comment system still
> uses the same functions to get comments, so all admin/zinnia functions
> should still work. It just doesn't use your database to get the
> comments, instead making the calls to Disqus.
>
> Some problems I see:
> - If you call the Disqus API from Python functions, it's not a-
> synchronous. So displaying a template would be slower. Even the admin
> would be slower, because the number of comments are shown in the blog
> entries list. However, this could of course be cached, making this
> almost a non-issue.
> - The user needs to be logged in to Disqus to be able to post a
> comment. It would be great if the comments came from my comments app,
> but the form for posting a new comments came from Disqus (using the
> standard javascript "api"). As far as I can see, this is not possible,
> so logging in and getting the user's key could be difficult?
>
> I am kind of stunned that an app like this doesn't already exists. Am
> I missing something? Or is everyone okay with using the javascript way
> of including Disqus? Also, I think this would be quite a lot of work
> to make, so before I start hacking away, I am wondering if this really
> doesn't already exists, and if I am overlooking other big problems.
>
> Thanks in advance for your input,
> Kevin

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.



CI

2010-11-13 Thread Johannes Nel
Hi All

What do you guys use for CI servers? Also where can I get some
detailed info on application propagation strategies (from dev, to qa,
to uat to prod) for django

As a side note, I think the getting started documentation should be
updated to reflect the use of relative paths
http://rob.cogit8.org/blog/2008/Jun/20/django-and-relativity/

johan

-- 
j:pn
\\no comment

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Sidebar blocks

2010-11-13 Thread Shawn Milochik
Another solution is to use context processors (they're in the docs).

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: CI

2010-11-13 Thread Johannes Nel
answering my own questions here:

By the looks of things I will stick with hudson for now, I found some
information on coverage tools as well (all though there seems to be no
sonar plugin, prob because nobody has been bothered to use maven for
django yet)
I also found a project called Fabric for deployment, which looks
pretty powerfull, but more investigation is needed.

If anyone has got some experience in fabric and hudson integration or
a good resource on propagation strategies will be much appreciated.

On Sat, Nov 13, 2010 at 4:56 PM, Johannes Nel  wrote:
> Hi All
>
> What do you guys use for CI servers? Also where can I get some
> detailed info on application propagation strategies (from dev, to qa,
> to uat to prod) for django
>
> As a side note, I think the getting started documentation should be
> updated to reflect the use of relative paths
> http://rob.cogit8.org/blog/2008/Jun/20/django-and-relativity/
>
> johan
>
> --
> j:pn
> \\no comment
>



-- 
j:pn
\\no comment

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Django Admin template error

2010-11-13 Thread Tsolmon Narantsogt
i can't fix that error actually i don't understand this error.

my urls.py :
#coding:utf8

import os
from django.conf.urls.defaults import *
from django.contrib import admin
from django.conf import settings
admin.autodiscover()

urlpatterns = patterns('',
(r'^$', 'public.views.index'),
(r'^public/', include('public.urls')),
(r'^products/', include('products.urls')),
(r'^partners/', include('partners.urls')),
(r'^certificate/', include('certificate.urls')),
(r'^contactus/','public.views.Contactus'),
(r'^place/$','public.views.Ourplace'),

(r'^admin/doc/', include('django.contrib.admindocs.urls')),
(r'^admin/(.*)', include(admin.site.urls)),
)

urlpatterns += patterns('django.contrib.auth.views',
(r'^accounts/login/$', 'login', {'template_name': 'login.html'}),
(r'^accounts/logout/$', 'logout', {'template_name': 'logout.html'}),
)


And my settings.py file

INSTALLED_APPS = (
# Base
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.admindocs',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
# My Own
'chonogol.public',
'chonogol.certificate',
'chonogol.partners',
'chonogol.products',
)


i'm wondering . Wha't wrong ?


On Sat, Nov 13, 2010 at 9:59 PM, Robbington wrote:

> Ok,
>
> Thanks, I was just seeing if it was a more basic error.
>
> Unfortunately with out seeing more of your code/ error message it is
> hard to diagnose the problem. I have to go out now for a few hours,
> but if you post the full error message someone/or myself when I get
> back maybe able to help you.
>
> It could be a mirad of things, error in one of your views, a problem
> in your settings.py(Check you ROOT_URLCONF to make sure it is pointing
> to the right place)or a compatiabilty issue if you have recently
> upgraded django, unless I have missed something really obvious. I have
> found a few posts that resolve similar problems to get you started:
>
> http://www.pubbs.net/201002/django/15026-no-module-named-urls.html
>
>
> http://groups.google.com/group/django-users/browse_thread/thread/e54e9801e053ecd3
>
> I hope this helps.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@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-us...@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.



Form Functionality

2010-11-13 Thread Matt
I have a very simple form with one search field. This is the current
workflow:

If POST:
   form(request.post)
   If form is valid:
  Clean form
  Use clean data to HttpResponseRedirect to a "pretty url" e.g. if
junction restaurant, forward to /junction-restaurant
else
form

render_to_response form

Then I have a view that processes /.

I am curious what you guys think about using HttpResponseRedirect to
facilitate clean urls. Am I making this too complicated?

Thanks, Matt

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Django Admin template error

2010-11-13 Thread Robbington
its an ImportError which means that it couldn't find your main urls.py
or possibly a sub urls that you are including.

Out of interest, this isnt the usual mysite.polls app kind of problem,
how did you encouter this error?

If you could post the entire error message that you are seeing
including the traceback and the url that you are trying to visit when
you get it.



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.



Static files ...

2010-11-13 Thread Jon Snidal
Hello,

First post to the group, and sorry it's on this common subject!  I
have tried to read every post on this and cannot seem to get it.  I'm
using Django 1.2.3, and therefore believe the instructions here apply:

http://docs.djangoproject.com/en/1.2/howto/static-files/

My project is in folder 'MCOd' and I have created a folder 'static'
under that into which I have placed my CSS files and images (images in
another subfolder).  To urls.py I have added:

urlpatterns += patterns('',
(r'^static/(?P.*)$', 'django.views.static.serve',
{'document_root': settings.STATIC_DOC_ROOT}),
(r'^admin/', include(admin.site.urls)),
)

To settings.py I have added:

STATIC_DOC_ROOT = '/Users/jonno/django_projects/MCOd/static'

This is what it says to do in the above referenced Django
documentation.  Nothing is mentioned about MEDIA_ROOT or MEDIA_URL, so
I have left them intact ('').  Many posts mention putting paths there,
but not the Django doc.  I didn't want to try the django-staticfiles
packages as I understand this is folded into newer versions, so I'll
deal with changes in an upgrade.  I'm really only trying to add a
little Django functionality to an existing static site, so dealing
with my vast number of static files easily is crucial.  Of course, my
plan is to generate more of my site dynamically over time.  I just
can't get past this point!  Thanks for any help -- Jon.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Static files ...

2010-11-13 Thread m1chael
Hi..

This is a common subject!

Your best bet is to just configure apache or lighthttpd to serve your
static files...

~mike

On Sat, Nov 13, 2010 at 5:24 PM, Jon Snidal  wrote:
> Hello,
>
> First post to the group, and sorry it's on this common subject!  I
> have tried to read every post on this and cannot seem to get it.  I'm
> using Django 1.2.3, and therefore believe the instructions here apply:
>
> http://docs.djangoproject.com/en/1.2/howto/static-files/
>
> My project is in folder 'MCOd' and I have created a folder 'static'
> under that into which I have placed my CSS files and images (images in
> another subfolder).  To urls.py I have added:
>
> urlpatterns += patterns('',
>    (r'^static/(?P.*)$', 'django.views.static.serve',
> {'document_root': settings.STATIC_DOC_ROOT}),
>    (r'^admin/', include(admin.site.urls)),
> )
>
> To settings.py I have added:
>
> STATIC_DOC_ROOT = '/Users/jonno/django_projects/MCOd/static'
>
> This is what it says to do in the above referenced Django
> documentation.  Nothing is mentioned about MEDIA_ROOT or MEDIA_URL, so
> I have left them intact ('').  Many posts mention putting paths there,
> but not the Django doc.  I didn't want to try the django-staticfiles
> packages as I understand this is folded into newer versions, so I'll
> deal with changes in an upgrade.  I'm really only trying to add a
> little Django functionality to an existing static site, so dealing
> with my vast number of static files easily is crucial.  Of course, my
> plan is to generate more of my site dynamically over time.  I just
> can't get past this point!  Thanks for any help -- Jon.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@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-us...@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: Sidebar blocks

2010-11-13 Thread dgmyrs
Perfect, that's exactly what I was looking for.  Thanks.

On Nov 13, 8:49 am, Jason Mayfield  wrote:
> On Nov 12, 2010, at 11:41 PM, dgmyrs wrote:
>
> > So in summary, I am looking for advice on how this sort of issue
> > should be approached in Django.
>
> I don't know about "should", but I often accomplish this via inclusion 
> template tags.  Inclusion tags are described in the docs here:
>
> http://docs.djangoproject.com/en/1.2/howto/custom-template-tags/#incl...
>
> - Jason

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Static files ...

2010-11-13 Thread Sandro Dutra
As m1chael said it's a very common subject and it's already answered several
times on this list. Simple do a searh and you'll find your answer.

2010/11/13 m1chael 

> Hi..
>
> This is a common subject!
>
> Your best bet is to just configure apache or lighthttpd to serve your
> static files...
>
> ~mike
>
> On Sat, Nov 13, 2010 at 5:24 PM, Jon Snidal  wrote:
> > Hello,
> >
> > First post to the group, and sorry it's on this common subject!  I
> > have tried to read every post on this and cannot seem to get it.  I'm
> > using Django 1.2.3, and therefore believe the instructions here apply:
> >
> > http://docs.djangoproject.com/en/1.2/howto/static-files/
> >
> > My project is in folder 'MCOd' and I have created a folder 'static'
> > under that into which I have placed my CSS files and images (images in
> > another subfolder).  To urls.py I have added:
> >
> > urlpatterns += patterns('',
> >(r'^static/(?P.*)$', 'django.views.static.serve',
> > {'document_root': settings.STATIC_DOC_ROOT}),
> >(r'^admin/', include(admin.site.urls)),
> > )
> >
> > To settings.py I have added:
> >
> > STATIC_DOC_ROOT = '/Users/jonno/django_projects/MCOd/static'
> >
> > This is what it says to do in the above referenced Django
> > documentation.  Nothing is mentioned about MEDIA_ROOT or MEDIA_URL, so
> > I have left them intact ('').  Many posts mention putting paths there,
> > but not the Django doc.  I didn't want to try the django-staticfiles
> > packages as I understand this is folded into newer versions, so I'll
> > deal with changes in an upgrade.  I'm really only trying to add a
> > little Django functionality to an existing static site, so dealing
> > with my vast number of static files easily is crucial.  Of course, my
> > plan is to generate more of my site dynamically over time.  I just
> > can't get past this point!  Thanks for any help -- Jon.
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "Django users" group.
> > To post to this group, send email to django-us...@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-us...@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-us...@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: Static files ...

2010-11-13 Thread Daniel Roseman
On Nov 13, 10:24 pm, Jon Snidal  wrote:
> Hello,
>
> First post to the group, and sorry it's on this common subject!  I
> have tried to read every post on this and cannot seem to get it.  I'm
> using Django 1.2.3, and therefore believe the instructions here apply:
>
> http://docs.djangoproject.com/en/1.2/howto/static-files/
>
> My project is in folder 'MCOd' and I have created a folder 'static'
> under that into which I have placed my CSS files and images (images in
> another subfolder).  To urls.py I have added:
>
> urlpatterns += patterns('',
>     (r'^static/(?P.*)$', 'django.views.static.serve',
> {'document_root': settings.STATIC_DOC_ROOT}),
>     (r'^admin/', include(admin.site.urls)),
> )
>
> To settings.py I have added:
>
> STATIC_DOC_ROOT = '/Users/jonno/django_projects/MCOd/static'
>
> This is what it says to do in the above referenced Django
> documentation.  Nothing is mentioned about MEDIA_ROOT or MEDIA_URL, so
> I have left them intact ('').  Many posts mention putting paths there,
> but not the Django doc.  I didn't want to try the django-staticfiles
> packages as I understand this is folded into newer versions, so I'll
> deal with changes in an upgrade.  I'm really only trying to add a
> little Django functionality to an existing static site, so dealing
> with my vast number of static files easily is crucial.  Of course, my
> plan is to generate more of my site dynamically over time.  I just
> can't get past this point!  Thanks for any help -- Jon.

You don't actually say what your problem is.

What happens point the browser directly to the address of one of your
static files? What do you see?
--
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: IE9 and dev server errors

2010-11-13 Thread BozoJoe
Here's my stack trace

[13/Nov/2010 16:01:55] "GET /accounts/login/ HTTP/1.1" 200 6544

Exception happened during processing of request from ('127.0.0.1',
2223)
Traceback (most recent call last):
  File "C:\Python27\lib\SocketServer.py", line 284, in
_handle_request_noblock
self.process_request(request, client_address)
  File "C:\Python27\lib\SocketServer.py", line 310, in process_request
self.finish_request(request, client_address)
  File "C:\Python27\lib\SocketServer.py", line 323, in finish_request
self.RequestHandlerClass(request, client_address, self)
  File "C:\Python27\lib\site-packages\django\core\servers
\basehttp.py", line 562, in __init__
BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
  File "C:\Python27\lib\SocketServer.py", line 639, in __init__
self.handle()
  File "C:\Python27\lib\site-packages\django\core\servers
\basehttp.py", line 602, in handle
self.raw_requestline = self.rfile.readline()
  File "C:\Python27\lib\socket.py", line 445, in readline

data = self._sock.recv(self._rbufsize)
error: [Errno 10054] An existing connection was forcibly closed by the
remote host



On Sep 20, 8:07 am, TheIvIaxx  wrote:
> The server will hang once this occurs.  Seems to only happen with ajax
> requests though.  Also, when it occurs, if I go into Internet Options> 
> Connection > LAN settings and simply hit Ok, then it finishes the
>
> request.  I dont change anything, just open the settings and hit ok.
> No proxy stuff in there.
>
> Chrome uses the same network stack as IE, i thought, so i'm not sure
> what the deal is.
>
> IE's even more painful to develop for :)
>
> On Sep 18, 5:02 am, Ramiro Morales  wrote:
>
>
>
>
>
>
>
> > On Fri, Sep 17, 2010 at 8:11 PM, TheIvIaxx  wrote:
> > > Hello all, I just downloaded the IE9 beta to see if everything worked
> > > as expected.  However when going to 127.0.0.1 with IE9 using the
> > > django dev server, i get:
>
> > > [Errno 10054] An existing connection was forcibly closed by the remote
> > > host
>
> > > Not sure what is going on.  Any ideas?
>
> > Does this cause any functional problem at all? Or simply.
> > is that error message printed to the console?
>
> > --
> > Ramiro Morales  | http://rmorales.net

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Django Admin template error

2010-11-13 Thread Tsolmon Narantsogt
Thanks a lot.
That's decided

On Sun, Nov 14, 2010 at 5:08 AM, Robbington wrote:

> its an ImportError which means that it couldn't find your main urls.py
> or possibly a sub urls that you are including.
>
> Out of interest, this isnt the usual mysite.polls app kind of problem,
> how did you encouter this error?
>
> If you could post the entire error message that you are seeing
> including the traceback and the url that you are trying to visit when
> you get it.
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@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-us...@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.



Automatically assume "models." prefix in models.py

2010-11-13 Thread James
Forgive a django newbie...

Maybe I'm the laziest person in the world, but sometimes I get tired
of typing "models.WhatEver" for every single model I have to write. Is
there anyway a shortcut could be added that would 'assume' the
'models.' prefix when I am defining a model?

e.g. instead of:

class SomeModel(models.Model):
something = models.SomeField(someoption=something)
# some other things

Could a shortcut be added so that I can write:

class SomeModel(models.Model):
something = SomeField(someoption=something)
# some other things



I realized that not everything I will write will have the "models."
prefix, but I think _most_ of what I write in models.py will have it.

So... I'm a being too lazy, or perhaps just stupid?

Thanks,
-james

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.