Re: @property: 'Property' is not defined / what am I missing?

2010-12-28 Thread Aub
Hi Karen,

That was it! Very educational :) Thank you

On Dec 28, 1:59 am, Karen Tracey  wrote:
> On Mon, Dec 27, 2010 at 7:30 PM, Malte Beckmann <
>
> monolithca...@googlemail.com> wrote:
> > Hi all!
>
> > Noob issue: Trying to get the @property decorator to work. Django complains
> > "NameError: name 'Property' is not defined". What is it that I am failing to
> > import and or define? And should I have found out about it?
>
> Looks like you coded @Property, not @property. Python is case-sensitive so
> the uppercase P for property won't work.
>
> Karen
> --http://tracey.org/kmt/

-- 
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: Save uploaded file to remote machines?

2010-12-28 Thread Daniel Hilton
On 28 December 2010 07:12, Andy  wrote:
> I'm using forms.FileField() to allow users to upload photos.
>
> After a photos is uploaded, I want to save the photo to one or more
> than one remote machine(s) which are dedicated to serving images. How
> do I do that?
>
> Thanks.

Have a look at this app:
https://github.com/seanbrant/django-queued-storage

That will manage moving the file to a backend storage system (s3, SAN,
etc) and handle the movement time as well.

HTH
Dan

>
> --
> 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.
>
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
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: evalute variable inside block tag ¿is it posibl e?

2010-12-28 Thread bruno desthuilliers
On 27 déc, 19:33, Nuño Iglesias  wrote:
> > basically it does not evaluate de content of "{{audio_file}}".

The {{ varname }} syntax is only eval'd by the template engine itself,
not by templatetags.
>
> If I do this:
>         {%if song %}
>                 {% load audioplayer  %}
>                 {% audioplayer file=song  %}
>         {%endif%}
>
> it works...
> But i'm not sure why Django looks for the variable.

Because the 'audioplayer' templatetag do call back on the template API
to try and resolve this variable.

> I can't locate it in the documentation.

http://docs.djangoproject.com/en/dev/howto/custom-template-tags/#passing-template-variables-to-the-tag



> Thanks  
>
> Nuño

-- 
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: Working with static media files, {{ MEDIA_URL }} shows up blank even with settings.py set

2010-12-28 Thread Kenneth Gonsalves
On Mon, 2010-12-27 at 08:03 -0800, easylancer wrote:
> TEMPLATE_CONTEXT_PROCESSORS = (
> 'django.contrib.auth.context_processors.auth',
> 'django.core.context_processors.debug',
> 'django.core.context_processors.i18n',
> 'django.core.context_processors.media',
> 'django.contrib.messages.context_processors.messages',
> 'django.core.context_processors.request',
> ) 

actually only 'request' is not there - the others are present by default
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
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.



authentication/get_user

2010-12-28 Thread Daniel Braniss
Hi,
I'm trying to
 1- use pwd.getpwd()
 2- use my own authentication (pam based)
but it seems I'm missing the magic to get it to work. I tried out many
examples,
but none worked.

-- 
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.



Replace URLResolver?

2010-12-28 Thread Martin
Hi.

I would like to use subdomains in my URL-dispatch. Thats not supported
by Django.

Is it possible to replace Django URLResolver with my own? Must this be
done as a Middleware class?

(Why is Django URL resolver not implemented as a Middleware class?)

Input appreciated.

Thanks.

/Martin

-- 
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: Working with static media files, {{ MEDIA_URL }} shows up blank even with settings.py set

2010-12-28 Thread Lee Connell
I didn't have TEMPLATE_CONTEXT_PROCESSORS at all, I copied the code
and it did not help, MEDIA_URL is still blank. I am using django 1.2.1
on windows.

On Dec 28, 12:56 am, Kenneth Gonsalves  wrote:
> On Mon, 2010-12-27 at 08:03 -0800, easylancer wrote:
> > TEMPLATE_CONTEXT_PROCESSORS = (
> >     'django.contrib.auth.context_processors.auth',
> >     'django.core.context_processors.debug',
> >     'django.core.context_processors.i18n',
> >     'django.core.context_processors.media',
> >     'django.contrib.messages.context_processors.messages',
> >     'django.core.context_processors.request',
> > )
>
> actually only 'request' is not there - the others are present by default
> --
> regards
> KGhttp://lawgon.livejournal.com
> Coimbatore LUG roxhttp://ilugcbe.techstud.org/

-- 
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: Replace URLResolver?

2010-12-28 Thread Brian Bouterse
I don't know why the URL dispatcher doesn't support subdomains.

If I were to guess though, it would be that supporting subdomains and
virtual hosts is typically the responsibility of the web server.  I think
Django didn't want to enable folks to do in python what apache and nginx
already do so well (and in a more optimized way).

my 2 cents,
Brian

On Tue, Dec 28, 2010 at 6:43 AM, Martin  wrote:

> Hi.
>
> I would like to use subdomains in my URL-dispatch. Thats not supported
> by Django.
>
> Is it possible to replace Django URLResolver with my own? Must this be
> done as a Middleware class?
>
> (Why is Django URL resolver not implemented as a Middleware class?)
>
> Input appreciated.
>
> Thanks.
>
> /Martin
>
> --
> 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.
>
>


-- 
Brian Bouterse
ITng Services

-- 
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: Working with static media files, {{ MEDIA_URL }} shows up blank even with settings.py set

2010-12-28 Thread easylancer
Post your settings.py in a pastebin and add a link to it here. Remove
all sensitive data before posting it.

On Dec 28, 3:02 pm, Lee Connell  wrote:
> I didn't have TEMPLATE_CONTEXT_PROCESSORS at all, I copied the code
> and it did not help, MEDIA_URL is still blank. I am using django 1.2.1
> on windows.
>
> On Dec 28, 12:56 am, Kenneth Gonsalves  wrote:
>
>
>
>
>
>
>
> > On Mon, 2010-12-27 at 08:03 -0800, easylancer wrote:
> > > TEMPLATE_CONTEXT_PROCESSORS = (
> > >     'django.contrib.auth.context_processors.auth',
> > >     'django.core.context_processors.debug',
> > >     'django.core.context_processors.i18n',
> > >     'django.core.context_processors.media',
> > >     'django.contrib.messages.context_processors.messages',
> > >     'django.core.context_processors.request',
> > > )
>
> > actually only 'request' is not there - the others are present by default
> > --
> > regards
> > KGhttp://lawgon.livejournal.com
> > Coimbatore LUG roxhttp://ilugcbe.techstud.org/

-- 
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: Replace URLResolver?

2010-12-28 Thread Martin
Maybe, but it would be nice to unplug it and plug in your own.

/Martin

-- 
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: Working with static media files, {{ MEDIA_URL }} shows up blank even with settings.py set

2010-12-28 Thread Daniel Roseman
On Tuesday, December 28, 2010 3:02:44 PM UTC, Lee Connell wrote:
>
> I didn't have TEMPLATE_CONTEXT_PROCESSORS at all, I copied the code 
> and it did not help, MEDIA_URL is still blank. I am using django 1.2.1 
> on windows. 
>

You don't actually need to specify TEMPLATE_CONTEXT_PROCESSORS if you are 
not changing it from the default - which, as indicated above, already 
includes the media one.

The issue here is more likely to be that you are not using a RequestContext 
to render your template. See 
http://docs.djangoproject.com/en/1.2/ref/templates/api/#subclassing-context-requestcontext
--
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: Efficient Grouping of Database Query

2010-12-28 Thread Daniel Roseman
On Monday, December 27, 2010 7:33:42 PM UTC, greg wrote:
>
> Hi, I'm trying to render a page with a table of records. 
>
> Each entry in the table is a 'Lift' which I need grouped by 
> weight_class and then only the top result for each lift shown. 
>
> So far example if I have something like this in the database: 
>
> weight_class | event | weight 
> 132   | bench press  | 156 
> 132   | bench press  | 165 
> 132   | deadlift  | 315 
> 132   | squat| 278 
> 148   | bench press  | 225 
> 148   | bench press  | 208 
> 148   | squat| 315 
>
> I want to render a table on the web-page like: 
>
> 132lb. Weight Class 
> 132   | bench press  | 165 
> 132   | deadlift  | 315 
> 132   | squat| 278 
>
> 148lb. Weight Class 
> 148  | bench press| 225 
> 148  | squat  | 315 
>
> Obviously I can hack together a pretty ugly method to do this 
> (separate queries for each weight class & lift) but since that is a 
> maintenance nightmare... I was wondering if there is an elegant way to 
> do this using some of django's features? 
>
> Is my best bet to just do one large query for all record setting lifts 
> and then sort them into a dictionary? 
>
> Thanks, 
>
> Greg Kerr


You just need to use the aggregation features:
http://docs.djangoproject.com/en/1.2/topics/db/aggregation/

lifts = Lift.objects.values('weight_class', 
'event').aggregate(Max('weight'))

This will give you a list of all weight_class and events, with the max 
weight for each.
--
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.



ModelForm validation

2010-12-28 Thread Axel Bock
Hi all,

I have this little problem. In my little webapp I have a data model which
defines several required fields. Depending on WHO is logged on, some of
these fields should not be changed by the user and be pre-filled (or better:
post-filled) by the application.

Currently I delete the fields out of the formset like this:
# prevent entering missions for all other bases
del missionform.fields['base']

so the field gets not rendered in the view. Which works nicely.

Unfortunately base is required, so the validation fails. Now how can I
insert the missing values into the POST data? I tried this:
if request.user.userflag.is_student:
logging.error("studen")
inst=FlownMission(
student=request.user,
base=request.user.studentinfo.current_base
)
flownmission = FlownMissionForm(request.POST, instance=inst)

which does not work at all :( . The validation fails all the time ... . I
just need to inject 2 required values somewhere in the POST data, but I have
no clue how.


Any help would be greatly appreciated, and I am a total django "newb" ... :)


Thanks & greetings,
Axel.

-- 
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: ZSI WEB SERVICE

2010-12-28 Thread benedikt
I am working on a server side implementation of a given wsdl file. So
I tried zsi to generate
the stubs. Did you have any success in incorporating a zsi soap server
into django?

I found a snippet for implementing a server with soaplib, but  this
generates its wsdl file on
demand. http://djangosnippets.org/snippets/979/
There seem to be plans to use a wsdl as input, but not in the near
future.
http://mail.python.org/pipermail/soap/2010-December/000351.html
I also found a home grown script to generate soaplib code from a wsdl
file, but
I did not test it:
http://stackoverflow.com/questions/3083186/generating-python-soaplib-stubs-from-wsdl

So after all, zsi still seems the way to go. Unfortunately I did not
find any examples on how to
make zsi and django work together, could you already provide some?
Could someone provide pointers to the right documentation, please?

Thank you and best regards,
Benedikt

On Dec 18, 5:41 pm, sami nathan  wrote:
> """__init__() must be called with TypeCode instance as first argument
> (got String instance instead) """what this error says when i overriden
> the ZSI server file (generated using wsdl2py in ZSI) i got this error
> is there any one to say what this
> error says I am trying to act as  server

-- 
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: Replace URLResolver?

2010-12-28 Thread robos85
I'm also curious how to resolve this problem. I'm planing to start small 
site, where each user has his own subdomain (profile site).
How to construct urls in that situation:)

-- 
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: Working with static media files, {{ MEDIA_URL }} shows up blank even with settings.py set

2010-12-28 Thread dmitry b
you need to be also using RequestContext in your view instead of the
regular Context.  What does your view method's return statement look
like?

On Dec 28, 7:02 am, Lee Connell  wrote:
> I didn't have TEMPLATE_CONTEXT_PROCESSORS at all, I copied the code
> and it did not help, MEDIA_URL is still blank. I am using django 1.2.1
> on windows.
>
> On Dec 28, 12:56 am, Kenneth Gonsalves  wrote:
>
>
>
>
>
>
>
> > On Mon, 2010-12-27 at 08:03 -0800, easylancer wrote:
> > > TEMPLATE_CONTEXT_PROCESSORS = (
> > >     'django.contrib.auth.context_processors.auth',
> > >     'django.core.context_processors.debug',
> > >     'django.core.context_processors.i18n',
> > >     'django.core.context_processors.media',
> > >     'django.contrib.messages.context_processors.messages',
> > >     'django.core.context_processors.request',
> > > )
>
> > actually only 'request' is not there - the others are present by default
> > --
> > regards
> > KGhttp://lawgon.livejournal.com
> > Coimbatore LUG roxhttp://ilugcbe.techstud.org/

-- 
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: Working with static media files, {{ MEDIA_URL }} shows up blank even with settings.py set

2010-12-28 Thread Lee Connell
Thanks everyone, the problem was indeed not using the RequestContext,
using Context does not automatically include some useful variables
which are retrieved from TEMPLATE_CONTEXT_PROCESSORS that includes
MEDIA_URL as stated above.

Thanks again!

On Dec 28, 5:31 pm, dmitry b  wrote:
> you need to be also using RequestContext in your view instead of the
> regular Context.  What does your view method's return statement look
> like?
>
> On Dec 28, 7:02 am, Lee Connell  wrote:
>
>
>
>
>
>
>
> > I didn't have TEMPLATE_CONTEXT_PROCESSORS at all, I copied the code
> > and it did not help, MEDIA_URL is still blank. I am using django 1.2.1
> > on windows.
>
> > On Dec 28, 12:56 am, Kenneth Gonsalves  wrote:
>
> > > On Mon, 2010-12-27 at 08:03 -0800, easylancer wrote:
> > > > TEMPLATE_CONTEXT_PROCESSORS = (
> > > >     'django.contrib.auth.context_processors.auth',
> > > >     'django.core.context_processors.debug',
> > > >     'django.core.context_processors.i18n',
> > > >     'django.core.context_processors.media',
> > > >     'django.contrib.messages.context_processors.messages',
> > > >     'django.core.context_processors.request',
> > > > )
>
> > > actually only 'request' is not there - the others are present by default
> > > --
> > > regards
> > > KGhttp://lawgon.livejournal.com
> > > Coimbatore LUG roxhttp://ilugcbe.techstud.org/

-- 
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.



database migration

2010-12-28 Thread Emmanuel Mayssat
I have a classic database dump question

I would like to migrate from sqlite to mysql.
How can I dump and import the data?
Regards,
--
E

-- 
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.



CheckboxSelectMultiple HTML

2010-12-28 Thread Bob Hancock
I have a form:
class AddUserForm(forms.Form):
checkboxes = forms.MultipleChoiceField(required=True,
   widget=CheckboxSelectMultiple(),
   choices=check_groups())

In the template I put:

  {% for choice_id, choice_label in form.fields.checkboxes.choices %}




{% endfor %}

Which displays a list of the correct number of checkboxes but with no text. 
 I use the commented line to render choice_label as text, all the values 
appear.

How do I get the value of choice_label to appear next to the checkbox?

-- 
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.



admin interface does NOT show

2010-12-28 Thread Emmanuel Mayssat
Hello,

I followed http://docs.djangoproject.com/en/dev/intro/tutorial02/
and attempted to enable the django admin interface, but it does not show.
Actually it returns an error,


Django version 1.1.1, using settings 'komunity.settings'
Development server is running at http://127.0.0.1:8080/
Quit the server with CONTROL-C.
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/django/core/servers/basehttp.py",
line 279, in run
self.result = application(self.environ, self.start_response)
  File "/usr/lib/pymodules/python2.6/django/core/servers/basehttp.py",
line 651, in __call__
return self.application(environ, start_response)
  File "/usr/lib/pymodules/python2.6/django/core/handlers/wsgi.py",
line 241, in __call__
response = self.get_response(request)
  File "/usr/lib/pymodules/python2.6/django/core/handlers/base.py",
line 73, in get_response
response = middleware_method(request)
  File "/usr/lib/pymodules/python2.6/django/middleware/common.py",
line 57, in process_request
_is_valid_path("%s/" % request.path_info)):
  File "/usr/lib/pymodules/python2.6/django/middleware/common.py",
line 142, in _is_valid_path
urlresolvers.resolve(path)
  File "/usr/lib/pymodules/python2.6/django/core/urlresolvers.py",
line 303, in resolve
return get_resolver(urlconf).resolve(path)
  File "/usr/lib/pymodules/python2.6/django/core/urlresolvers.py",
line 218, in resolve
sub_match = pattern.resolve(new_path)
  File "/usr/lib/pymodules/python2.6/django/core/urlresolvers.py",
line 216, in resolve
for pattern in self.url_patterns:
  File "/usr/lib/pymodules/python2.6/django/core/urlresolvers.py",
line 245, in _get_url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/usr/lib/pymodules/python2.6/django/core/urlresolvers.py",
line 240, in _get_urlconf_module
self._urlconf_module = import_module(self.urlconf_name)
  File "/usr/lib/pymodules/python2.6/django/utils/importlib.py", line
35, in import_module
__import__(name)
ImportError: No module named admin.site.urls


and yes, I undommented the following lines in settings.py
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

and added
urlpatterns = patterns('',
[]
# 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'^admin/', include('admin.site.urls')),
#(r'^admin/', include('django.admin.site.urls')),
#(r'^admin/', include('django.contrib.admin.site')),
#(r'^admin/', include('django.contrib.admin.urls')),
#(r'^admin/', include('django.contrib.admin')),
)
 and yes, the python-django package is installed and has
/usr/share/pyshared/django/contrib/admin/sites.py

am I missing something?

-- 
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: admin interface does NOT show

2010-12-28 Thread Emmanuel Mayssat
ALMOST CORRRECT : WITHOUT THE QUOTES !

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

I was trying too hard!
--
E

On Tue, Dec 28, 2010 at 4:32 PM, Emmanuel Mayssat  wrote:
> Hello,
>
> I followed http://docs.djangoproject.com/en/dev/intro/tutorial02/
> and attempted to enable the django admin interface, but it does not show.
> Actually it returns an error,
>
>
> Django version 1.1.1, using settings 'komunity.settings'
> Development server is running at http://127.0.0.1:8080/
> Quit the server with CONTROL-C.
> Traceback (most recent call last):
>  File "/usr/lib/pymodules/python2.6/django/core/servers/basehttp.py",
> line 279, in run
>    self.result = application(self.environ, self.start_response)
>  File "/usr/lib/pymodules/python2.6/django/core/servers/basehttp.py",
> line 651, in __call__
>    return self.application(environ, start_response)
>  File "/usr/lib/pymodules/python2.6/django/core/handlers/wsgi.py",
> line 241, in __call__
>    response = self.get_response(request)
>  File "/usr/lib/pymodules/python2.6/django/core/handlers/base.py",
> line 73, in get_response
>    response = middleware_method(request)
>  File "/usr/lib/pymodules/python2.6/django/middleware/common.py",
> line 57, in process_request
>    _is_valid_path("%s/" % request.path_info)):
>  File "/usr/lib/pymodules/python2.6/django/middleware/common.py",
> line 142, in _is_valid_path
>    urlresolvers.resolve(path)
>  File "/usr/lib/pymodules/python2.6/django/core/urlresolvers.py",
> line 303, in resolve
>    return get_resolver(urlconf).resolve(path)
>  File "/usr/lib/pymodules/python2.6/django/core/urlresolvers.py",
> line 218, in resolve
>    sub_match = pattern.resolve(new_path)
>  File "/usr/lib/pymodules/python2.6/django/core/urlresolvers.py",
> line 216, in resolve
>    for pattern in self.url_patterns:
>  File "/usr/lib/pymodules/python2.6/django/core/urlresolvers.py",
> line 245, in _get_url_patterns
>    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
>  File "/usr/lib/pymodules/python2.6/django/core/urlresolvers.py",
> line 240, in _get_urlconf_module
>    self._urlconf_module = import_module(self.urlconf_name)
>  File "/usr/lib/pymodules/python2.6/django/utils/importlib.py", line
> 35, in import_module
>    __import__(name)
> ImportError: No module named admin.site.urls
>
>
> and yes, I undommented the following lines in settings.py
> # Uncomment the next two lines to enable the admin:
> from django.contrib import admin
> admin.autodiscover()
>
> and added
> urlpatterns = patterns('',
>    []
>    # 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'^admin/', include('admin.site.urls')),
>    #(r'^admin/', include('django.admin.site.urls')),
>    #(r'^admin/', include('django.contrib.admin.site')),
>    #(r'^admin/', include('django.contrib.admin.urls')),
>    #(r'^admin/', include('django.contrib.admin')),
> )
>  and yes, the python-django package is installed and has
> /usr/share/pyshared/django/contrib/admin/sites.py
>
> am I missing something?
>

-- 
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: Replace URLResolver?

2010-12-28 Thread Sam Lai
On 28 December 2010 22:43, Martin  wrote:
> Hi.
>
> I would like to use subdomains in my URL-dispatch. Thats not supported
> by Django.
>
> Is it possible to replace Django URLResolver with my own? Must this be
> done as a Middleware class?

No, you can't really replace the default URLResolver without changing
any code in Django - lines 100-101 in django/core/handlers/base.py
(http://code.djangoproject.com/browser/django/trunk/django/core/handlers/base.py).
And even if you did, you would only be given the path_info of the
request, not the entire request object itself.

Your only option is middleware.

> (Why is Django URL resolver not implemented as a Middleware class?)

Besides what Brian said, it is probably for the same reason why regex
is the only way to specify URLs - there wasn't a need for anything
else when it was first designed, and given the current solution works
for nearly all cases, there have been minimal attempts to change it.

At some point, I'm considering rewriting the entire URL
resolution/reversal system to make it more modular, and submitting it
as a patch. (I bumped up against another limitation of it and had to
hack around it by changing Django code.) Don't hold your breath for
inclusion in a Django release any time soon though; as such a critical
part of Django, it'll probably be a while before it makes it into
trunk.

> Input appreciated.
>
> Thanks.
>
> /Martin
>
> --
> 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: database migration

2010-12-28 Thread Michael P. Soulier
On 28/12/10 Emmanuel Mayssat said:

> I have a classic database dump question
> 
> I would like to migrate from sqlite to mysql.
> How can I dump and import the data?

See the manage.py dumpdata/loaddata commands.

Mike


signature.asc
Description: Digital signature


Re: database migration

2010-12-28 Thread nfbueno78
see if this url could help you: 
http://www.maxkpage.com/blog/free-sqlite-to-mysql-converter-super-easy/

On Dec 29, 7:37 am, Emmanuel Mayssat  wrote:
> I have a classic database dump question
>
> I would like to migrate from sqlite to mysql.
> How can I dump and import the data?
> Regards,
> --
> E

-- 
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: database migration

2010-12-28 Thread Emrah Unal

within the main project directory in linux

python manage.py dumpdata > data.json

command will dump your data to a json file

change settings.py to use mysql, after that

python manage.py syncdb

this will create tables followed by

python manage.py loaddata data.json

will load everything back

cheers



On 12/29/2010 01:37 AM, Emmanuel Mayssat wrote:

I have a classic database dump question

I would like to migrate from sqlite to mysql.
How can I dump and import the data?
Regards,
--
E



--
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: database migration

2010-12-28 Thread Torsten Bronger
Hallöchen!

Michael P. Soulier writes:

> On 28/12/10 Emmanuel Mayssat said:
>
>> I have a classic database dump question
>> 
>> I would like to migrate from sqlite to mysql.
>> How can I dump and import the data?
>
> See the manage.py dumpdata/loaddata commands.

I don't recommend that.  If the database exceeds a certain size (and
"certain" is MBs, not GBs), this simply fails.

Tschö,
Torsten.

-- 
Torsten Bronger, aquisgrana, europa vetus
   Jabber ID: torsten.bron...@jabber.rwth-aachen.de
  or http://bronger-jmp.appspot.com

-- 
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.