Getting Access to Object in Admin Panel

2012-12-29 Thread donarb
You can code a string that references the __unicode__ method:

  list_display = ('__unicode__', ...

-- 
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/-/t0v9rTmcTeUJ.
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: loaddata deserializationerror: maximum recursion depth exceeded while calling a Python object

2012-12-29 Thread donarb
And your __unicode__ method is incorrect as well. You should be returning 
self.restaurant.

-- 
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/-/bsJoTGDbveYJ.
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: Admin page not found error

2012-12-29 Thread Shahjalal Hossain
Hi,

I have done what you said, delete sqlite.db, re-write absolute path, and run 
sync db. Now, it is showing following error. Is it possible, I have done 
something wrong in my Django installation? Do I need to reinstall Django, 
again? How can I check my django installation was ok? Is there any permission 
problem in my Django library file? Or should I need to do something else. I am 
very new in Django that's why I am asking this kind of question.

Sorry, for this kinds of pain. Thanks in advance.



Creating tables ...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table django_content_type
Creating table django_session
Creating table django_site
Creating table django_admin_log
Creating table polls_poll
Creating table polls_choice

You just installed Django's auth system, which means you don't have any 
superusers defined.
Would you like to create one now? (yes/no): yes
Traceback (most recent call last):
  File "/Users/shahjalal/Documents/Aptana Studio 3 Workspace/mysite/manage.py", 
line 10, in 
execute_from_command_line(sys.argv)
  File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", 
line 443, in execute_from_command_line
utility.execute()
  File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", 
line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Library/Python/2.7/site-packages/django/core/management/base.py", line 
196, in run_from_argv
self.execute(*args, **options.__dict__)
  File "/Library/Python/2.7/site-packages/django/core/management/base.py", line 
232, in execute
output = self.handle(*args, **options)
  File "/Library/Python/2.7/site-packages/django/core/management/base.py", line 
371, in handle
return self.handle_noargs(**options)
  File 
"/Library/Python/2.7/site-packages/django/core/management/commands/syncdb.py", 
line 110, in handle_noargs
emit_post_sync_signal(created_models, verbosity, interactive, db)
  File "/Library/Python/2.7/site-packages/django/core/management/sql.py", line 
189, in emit_post_sync_signal
interactive=interactive, db=db)
  File "/Library/Python/2.7/site-packages/django/dispatch/dispatcher.py", line 
172, in send
response = receiver(signal=self, sender=sender, **named)
  File 
"/Library/Python/2.7/site-packages/django/contrib/auth/management/__init__.py", 
line 73, in create_superuser
call_command("createsuperuser", interactive=True, database=db)
  File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", 
line 150, in call_command
return klass.execute(*args, **defaults)
  File "/Library/Python/2.7/site-packages/django/core/management/base.py", line 
232, in execute
output = self.handle(*args, **options)
  File 
"/Library/Python/2.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py",
 line 70, in handle
default_username = get_default_username()
  File 
"/Library/Python/2.7/site-packages/django/contrib/auth/management/__init__.py", 
line 105, in get_default_username
default_username = get_system_username()
  File 
"/Library/Python/2.7/site-packages/django/contrib/auth/management/__init__.py", 
line 85, in get_system_username
return getpass.getuser().decode(locale.getdefaultlocale()[1])
TypeError: decode() argument 1 must be string, not None
Finished "/Users/shahjalal/Documents/Aptana Studio 3 Workspace/mysite/manage.py 
syncdb" execution.



On Dec 29, 2012, at 8:19 PM, Ryan Blunden wrote:

> I added a record to the django_site table (which Django on the first syncdb 
> run for the Sites app) and then I could view the admin fine.
> 
> So you can either try this or just delete the sqlite.db file and run syncdb 
> again which will also fix the problem.
> 
> Also, you don't need to specify the database path as an absolute path. It's 
> relative to the Django project root folder so just "sqlite.db" would be fine.
> 
> Happy coding.
> 
> Cheers,
> Ryan
> 
> On 29/12/2012, at 12:14 AM, Shahjalal Hossain  
> wrote:
> 
>> 
>> 
>> On Friday, December 28, 2012 9:29:50 AM UTC+1, Shahjalal Hossain wrote:
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> Hi, I am new at Django. I am learning Django from instruction manual "a 
>> basic poll application". I was doing step by step. But, at a certain point I 
>> stacked. 
>> 
>> It does not shows admin page as "2.4 Writing your first Django app, part 2". 
>> I have done all the steps, like uncomment settings.py and urls.py and run 
>> the syncdb. I am writing on code on Aptana Studio 3. For convenient, I have 
>> given some images. and source files.
>> 
>> Thanks, in advance.
>> 
>> settings.py
>> 
>> INSTALLED_APPS = (
>> 'django.contrib.auth',
>> 'django.contrib.contenttypes',
>> 'django.contrib.sessions',
>> 'django.contrib.sites',
>> 'django.contrib.messages',
>> 'django.contrib.staticfil

Re: loaddata deserializationerror: maximum recursion depth exceeded while calling a Python object

2012-12-29 Thread donarb
Not sure if it's related to your problem, but you should never create function 
names like __period__. Names such as those are reserved for Python internals.

-- 
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/-/BeMmAD5_nfgJ.
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: virtualenv setup

2012-12-29 Thread Sam Lai
It looks like you haven't installed Django in your virtualenv. In your
virtualenv directory, look in lib/python2.x/site-packages and see if there
is a Django directory in there.

You can also try sourcing your venv, then running Python, and entering in
the following statement to see if Python can find Django -

import django

If it can't, try the following statements in the Python shell and see if
your venv's site-packages directory is in the system path -

import sys
sys.path

Finally, try the following command in your usual shell and make sure it is
referring to the right Python executable (it should be referring to the one
in your venv/bin directory) -

which python


On 30 December 2012 09:23, Phil  wrote:

> Hi,
>
> Thanks for reply. Yeah I activated the source(terminal has "venv" beside
> my username). I followed instructions here(so I pip installed django etc
> after getting virtualenv up and running)...
>
> https://devcenter.heroku.com/articles/django#prerequisites
>
> If I runserver thats when I get the error. If I runserver without
> activating source it works fine but that would be using my system wide
> python. Just need to figure out how to get it to recognise the virtualenv
> python.
>
>
> On Saturday, December 29, 2012 10:16:45 PM UTC, quinonesvictor wrote:
>
>> Hi Phil
>>
>> sorry for the question, but, did you activate your virtualenv source?
>> $ source bin/activate (?)
>>
>> Anyway, I'd try to install django via pip once you I have my virtualenv
>> created and activated.
>>
>> Cheers
>>
>> On Sat, Dec 29, 2012 at 7:01 PM, Phil  wrote:
>>
>>> Hi,
>>>
>>> I have python/django working system wide. But am currently looking into
>>> using Heroku for a new project so am trying to get virtualenv setup for the
>>> first time. When I run "django-admin.py startproject whatever" it creates
>>> the project ok, but then when I run "python manage.py runserver 8080" from
>>> the project folder I get the following error...
>>>
>>> ImportError: No module named django.core.management
>>>
>>> Is it because at the top of my "manage.py" it is pointing to my system
>>> wide python(#!/usr/bin/env python) instead of my virtualenv one? If so how
>>> do I fix this? I tried changing the path at the top of the manage.py file
>>> but didn't seem to do anything.
>>>
>>> --
>>> 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/-/n4-**fu8ioveIJ
>>> .
>>> To post to this group, send email to django...@googlegroups.com.
>>> To unsubscribe from this group, send email to django-users...@**
>>> googlegroups.com.
>>>
>>> For more options, visit this group at http://groups.google.com/**
>>> group/django-users?hl=en
>>> .
>>>
>>
>>
>>
>> --
>> Quiñones Victor Manuel
>> Tel: +54 0362 15 4 880839
>> Resistencia - 3500
>> Argentina
>>
>  --
> 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/-/Gb4JYmpcK-0J.
>
> 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.



Replicating same model for different deployed application.

2012-12-29 Thread Subodh Nijsure
Hi,

I have following situation where. My model consist of say table1, table2,
table3.

I am going to "host" similar data and associated web interface for multiple
customers -( customer1, customer2, customer3.) they would access these
application as http://hostname/customer1 http://hostname/customer2 etc.

When customer1 application is deployed I want tables customer1_table1,
customer1_table2, customer1_table3 to be created. Same for customer2, 3 etc.

Right now I am thinking of having one "template" directory where all
database names are referred to as replaceme_table1, replaceme_table2 etc.

When I actually deploy application for real customer say customer1 I am
copying this template to directory customer1 and running sed to  change
'replaceme' with 'customer1'

Is there a better, elegant way to do this in django where you have same
 model that needs to be deployed as multiple django applications?

-Subodh

-- 
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: problem while passing a list of string to javascript in template

2012-12-29 Thread Everest K.C.
Thank you nimesh very much. It worked for me.
Masklinn I didn't get your point. Can you please explain?

-- 
With Regards,
Everest K.C.
BE Computer Engineering
Institute of Engineering, Pulchowk Campus
URL: http://www.everestkc.com.np

-- 
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: citations

2012-12-29 Thread Russell Keith-Magee
On Sat, Dec 29, 2012 at 10:26 PM,  wrote:

> Hi,
>
> I am creating a site, and trying to implement a referencing/citation
> system.
>
> I'd like to render something like
> "Lorem ipsum dolor sit amet[[ref:foo2012]], consectetur adipisicing elit,
> sed do eiusmod tempor incididunt[[ref:bar2011]] ut labore et dolore magna
> aliqua."
> stored in a TextField,
> "Lorem ipsum dolor sit amet[1], consectetur adipisicing elit, sed do
> eiusmod tempor incididunt[2] ut labore et dolore magna aliqua."
>
> "[1] foo, 'something something' (2012)
> [2] bar, 'something something' (2011)
> "
> where "foo2012" is the slug of a reference object, that has a title,
> author, data etc.
>
> I have made a filter that can scan though a string, pick out the [[]] tags
> and look up the reference. I can use this in  a template like {{
> site.description|refs }}. However i need somewhere to store mapping of
> numbers to references for that page, so that i can filter multiple blocks
> on the same page without resetting the numbering. I would then use a tag at
> the end of the page, that rendered the collected list.
>
> The docs on custom tags and filters talks about render_context, but does
> not show how to use them with filters (only with tags).
>
> Am i going about this the wrong way? should filters be stateless? i
> realise that parsing relationships out of a text field is not good database
> style, but i can't think of another way to allow editors to put citations
> into text. i would also like to use a similar tag for cross links in the
> text (eg [[site:foo]] -> "/sites/view/foo").
>

What you're describing is just a markup language -- if you look in
django.contrib.markup, you'll find 3 examples of analogous markup
languages. So yes, this is an entirely appropriate way to handle
user-provided content.

As for implementation; filters are generally stateless -- they're really
not much more than a way to access a function in a template. However,
that's got more to do with convention than hard rules. There's nothing that
*requires* them to be stateless. Writing to the context in a filter isn't
prohibited; it's just unusual (which is why the docs don't provide a
specific example). Using one tag to extract references, and a second to
print those references sounds entirely appropriate.

The other approach would be to use a template tag. The only advantage here
would be that tags often have context-modifying side effects, so it would
be marginally less surprising to an outside observer to see a tag modify
context. However, that's really just a developer communication issue -- if
there's enough documentation (formal or informal) about what the pair of
filters are doing, I don't see any reason why you shouldn't use a filter
for this purpose.

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: Django 1.5 - release date

2012-12-29 Thread Russell Keith-Magee
On Sat, Dec 29, 2012 at 2:44 PM, Aidan Zhakypov  wrote:

> Does anyone know when Django 1.5 is going to be released as a stable
> version? If I want to *start* developing a production web site, should I
> write it on Django 1.4 or is it already ok to implement it on Django 1.5?


It's difficult to give an exact date for the release of Django 1.5. We've
put out 2 beta releases, which means there are no more features to be
added; and the list of release blocking bugs is down to single figures [1].

If I were to guess, I'd say we're less than a month from the final release
of 1.5. However, this is all dependent on how many new release blocking
bugs are discovered between now and then, and the resources that the
community and the core team can devote to getting the release out the door.

Whether that suits your own development schedule is up to you.

The good news is that unless you're planning to use a new feature from 1.5
(e.g., pluggable User models), it shouldn't really matter whether you start
developing using Django 1.4 or Django 1.5. Django has a strict backwards
compatibility policy, so the migration process from 1.4 to 1.5 should be
very smooth.

[1]
https://code.djangoproject.com/query?status=assigned&status=new&status=reopened&severity=Release+blocker

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: Design by composition and persistance

2012-12-29 Thread Taras_96


> in your case: 
>
> class Event(models.Model): 
>   name = models.CharField(.) 
>   description = models.CharField() 
>   tw_start = models.DateTimeField() 
>   tw_finish= models.DateTimeField() 
>   timewindow = TimeWindowField(tw_start, tw_finish) 
>
> and getDuration() is a method of the TimeWindowField, so you can say 
> event.timewindow.getDuration() 
>
>
> -- 
> Javier 
>

I was thinking of doing something similar to Javier's suggestion of storing 
the underlying content 'flat' on the same table, and then creating an 
abstraction layer. I've tried out the sample code, and  calling 
event.timeWindow returns a TimeWindowField object (which you can call 
'getDuration' on), but setting the timewindow attribute to some other value 
doesn't propagate the values onto the tw_start & tw_finish fields, and 
using the query api doesn't work either (not that I was expecting either to 
work :)). You could work around this by using getters/setters (via 
properties), but that feels like a long road to go down to come up with a 
generic solution (DRY) & make sure that it works in the general case. Also, 
once you've implemented setting/getting, then what about other parts of 
Django functionality, notably querying and model form generation, that are 
coupled to the model.. how would support for those be added?  

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



Getting Access to Object in Admin Panel

2012-12-29 Thread That guy
After overriding list_display, I noticed that I lost access to being able 
to directly click on the object to view all its fields in the control 
panel. Hence, I needed to resort to defining return_unicode. I know that 
theres definitely a better way to approach it, so whats the 'Django' way of 
doing this?

def return_unicode(obj):
return obj.__unicode__()

class PictureAdmin(admin.ModelAdmin):
list_display = (return_unicode,'uploader','image','rated','approved',)

Thank You ahead of time.

-- 
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/-/XV-EpfLbyPUJ.
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: virtualenv setup

2012-12-29 Thread Phil
Hi,

Thanks for reply. Yeah I activated the source(terminal has "venv" beside my 
username). I followed instructions here(so I pip installed django etc after 
getting virtualenv up and running)...

https://devcenter.heroku.com/articles/django#prerequisites

If I runserver thats when I get the error. If I runserver without 
activating source it works fine but that would be using my system wide 
python. Just need to figure out how to get it to recognise the virtualenv 
python.


On Saturday, December 29, 2012 10:16:45 PM UTC, quinonesvictor wrote:
>
> Hi Phil
>
> sorry for the question, but, did you activate your virtualenv source?
> $ source bin/activate (?)
>
> Anyway, I'd try to install django via pip once you I have my virtualenv 
> created and activated.
>
> Cheers
>
> On Sat, Dec 29, 2012 at 7:01 PM, Phil >wrote:
>
>> Hi,
>>
>> I have python/django working system wide. But am currently looking into 
>> using Heroku for a new project so am trying to get virtualenv setup for the 
>> first time. When I run "django-admin.py startproject whatever" it creates 
>> the project ok, but then when I run "python manage.py runserver 8080" from 
>> the project folder I get the following error...
>>
>> ImportError: No module named django.core.management
>>
>> Is it because at the top of my "manage.py" it is pointing to my system 
>> wide python(#!/usr/bin/env python) instead of my virtualenv one? If so how 
>> do I fix this? I tried changing the path at the top of the manage.py file 
>> but didn't seem to do anything.
>>  
>> -- 
>> 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/-/n4-fu8ioveIJ.
>> To post to this group, send email to django...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> django-users...@googlegroups.com .
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> -- 
> Quiñones Victor Manuel
> Tel: +54 0362 15 4 880839
> Resistencia - 3500
> Argentina 
>

-- 
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/-/Gb4JYmpcK-0J.
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: virtualenv setup

2012-12-29 Thread Victor Manuel Quiñones Victor
Hi Phil

sorry for the question, but, did you activate your virtualenv source?
$ source bin/activate (?)

Anyway, I'd try to install django via pip once you I have my virtualenv
created and activated.

Cheers

On Sat, Dec 29, 2012 at 7:01 PM, Phil  wrote:

> Hi,
>
> I have python/django working system wide. But am currently looking into
> using Heroku for a new project so am trying to get virtualenv setup for the
> first time. When I run "django-admin.py startproject whatever" it creates
> the project ok, but then when I run "python manage.py runserver 8080" from
> the project folder I get the following error...
>
> ImportError: No module named django.core.management
>
> Is it because at the top of my "manage.py" it is pointing to my system
> wide python(#!/usr/bin/env python) instead of my virtualenv one? If so how
> do I fix this? I tried changing the path at the top of the manage.py file
> but didn't seem to do anything.
>
> --
> 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/-/n4-fu8ioveIJ.
> 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.
>



-- 
Quiñones Victor Manuel
Tel: +54 0362 15 4 880839
Resistencia - 3500
Argentina

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



virtualenv setup

2012-12-29 Thread Phil
Hi,

I have python/django working system wide. But am currently looking into 
using Heroku for a new project so am trying to get virtualenv setup for the 
first time. When I run "django-admin.py startproject whatever" it creates 
the project ok, but then when I run "python manage.py runserver 8080" from 
the project folder I get the following error...

ImportError: No module named django.core.management

Is it because at the top of my "manage.py" it is pointing to my system wide 
python(#!/usr/bin/env python) instead of my virtualenv one? If so how do I 
fix this? I tried changing the path at the top of the manage.py file but 
didn't seem to do anything.

-- 
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/-/n4-fu8ioveIJ.
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: loaddata deserializationerror: maximum recursion depth exceeded while calling a Python object

2012-12-29 Thread Sam Raker
Here's the truncated version I tried to load in case the problem was the 
length of the file:
- fields: {location: ST. DENNIS HOTEL, restaurant: Veterans American Guard, 
status: complete,
year: 1900}
  model: dishes.menu
  pk: 12495
- fields: {location: BOSTON, restaurant: New England Shorthand Reporter's 
Association,
status: complete, year: 1900}
  model: dishes.menu
  pk: 12563
- fields: {location: RMS LUCANIA, restaurant: Cunard Line, status: under 
review, year: 1900}
  model: dishes.menu
  pk: 12749
- fields: {location: IROQUOIS, restaurant: Alumni Association   University 
Of Buffalo,
status: complete, year: 1900}
  model: dishes.menu
  pk: 12826
- fields: {location: '[CHICAGO', restaurant: Chicago Bar Association, 
status: complete,
year: 1900}
  model: dishes.menu
  pk: 12836
- fields: {location: NEW YORK, restaurant: Hotel Marlborough, status: under 
review,
year: 1900}
  model: dishes.menu
  pk: 12841
- fields: {location: NEW YORK, restaurant: Hotel Marlborough, status: 
complete, year: 1900}
  model: dishes.menu
  pk: 12960
- fields: {location: HOTEL MARLBOROUGH, restaurant: District No.3 Catholic 
Benevolent
  Legion, status: under review, year: 1900}
  model: dishes.menu
  pk: 13076
- fields: {location: 9 & 10 BATTERY PL. NY, restaurant: Castle Garden 
Hotel, status: complete,
year: 1900}
  model: dishes.menu
  pk: 13117

Here's the model:
class Menu(models.Model):
restaurant=models.TextField(unique=False)
year=models.IntegerField(unique=False,null=True)
location=models.TextField(unique=False)
status=models.CharField(unique=False,max_length=20)
pk=models.IntegerField(primary_key=True)
def __unicode__(self):
return restaurant
def __period__(self):#adapted from 
http://stackoverflow.com/questions/2272149/round-to-5or-other-number-in-python
try:
p=int(10*round(float(self.year)/10))
if p < self.year:
return "%s-%s"%(p,p+5)
else:
return "%s-%s"%(p-5,p)
except:
return ""
period=property(__period__) 
language = models.CharField(unique=False,max_length=30)

I'd really appreciate any help on this.

On Saturday, December 29, 2012 3:28:34 PM UTC-5, Ryan Blunden wrote:
>
> Can you provide a single example of one of the fixture objects you're 
> trying to import, as well as the model it corresponds to?
>
> On 29/12/2012, at 11:34 AM, Sam Raker > 
> wrote:
>
> Hello,
> I've got a very tight deadline, and I'm encountering a very frustrating 
> problem. Every time I try to use loaddata to load my data into my database, 
> I get the loaddata error in the subject. I've tried YAML, I've tried JSON, 
> I've tried excerpting only a few lines of each, all to no avail. I'm really 
> at my rope's end. I don't think my models are flawed in any significant 
> way--each refers to only one field in one other model (the primary key in 
> four out of five of them). 
>
> I need to get this working by the 2nd, and I've looked all over the 
> internet and posted a question at Stackoverflow and still can't figure it 
> out. I really need some help.
>
> Thanks,
> -sam
>
> -- 
> 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/-/WLBxL9nsC1IJ.
> To post to this group, send email to django...@googlegroups.com
> .
> To unsubscribe from this group, send email to 
> django-users...@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/-/fI4rtItIhGIJ.
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: loaddata deserializationerror: maximum recursion depth exceeded while calling a Python object

2012-12-29 Thread Ryan Blunden
Can you provide a single example of one of the fixture objects you're trying to 
import, as well as the model it corresponds to?

On 29/12/2012, at 11:34 AM, Sam Raker  wrote:

> Hello,
> I've got a very tight deadline, and I'm encountering a very frustrating 
> problem. Every time I try to use loaddata to load my data into my database, I 
> get the loaddata error in the subject. I've tried YAML, I've tried JSON, I've 
> tried excerpting only a few lines of each, all to no avail. I'm really at my 
> rope's end. I don't think my models are flawed in any significant way--each 
> refers to only one field in one other model (the primary key in four out of 
> five of them). 
> 
> I need to get this working by the 2nd, and I've looked all over the internet 
> and posted a question at Stackoverflow and still can't figure it out. I 
> really need some help.
> 
> Thanks,
> -sam
> 
> -- 
> 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/-/WLBxL9nsC1IJ.
> 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: problem while passing a list of string to javascript in template

2012-12-29 Thread Masklinn
On 2012-12-29, at 19:59 , Ryan Blunden wrote:

> Django presumes all template variables are "unsafe" by default to prevent XSS 
> attacks which is why it's encoded the quotes.
> 
> Read up on filters and auto-escaping and you'll be able to figure out the 
> rest.

Realizing that the string serialization of a Python collection is not
necessarily valid Javascript may also be a good idea.

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



loaddata deserializationerror: maximum recursion depth exceeded while calling a Python object

2012-12-29 Thread Sam Raker
Hello,
I've got a very tight deadline, and I'm encountering a very frustrating 
problem. Every time I try to use loaddata to load my data into my database, 
I get the loaddata error in the subject. I've tried YAML, I've tried JSON, 
I've tried excerpting only a few lines of each, all to no avail. I'm really 
at my rope's end. I don't think my models are flawed in any significant 
way--each refers to only one field in one other model (the primary key in 
four out of five of them). 

I need to get this working by the 2nd, and I've looked all over the 
internet and posted a question at Stackoverflow and still can't figure it 
out. I really need some help.

Thanks,
-sam

-- 
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/-/WLBxL9nsC1IJ.
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: problem while passing a list of string to javascript in template

2012-12-29 Thread nimesh ghelani
use mark_safe:

from django.utils.safestring import mark_safe
ticks = mark_safe(["a", "b", "c", "d"])

On Saturday, December 29, 2012 9:27:55 PM UTC+5:30, Everest K.C. wrote:
>
> Hello Everyone,
> I have problem while passing a list of string from django views to 
> javascript template. The quotation mark gets converted into hex and I 
> cannot use it to plot graph using jpplot. I even tried *replace* method 
> of javascript to replace the hex to convert to '. 
>
> The codes are as follows:
> From views.py :
> from django.shortcuts import render_to_response
>
> def abc(request):
> s1=[1, 5 , 8 , 3]
> ticks=["a", "b", "c", "d"]
> return render_to_response('abc.html', {'s1':s1, 'ticks':ticks})
>
> From .html file (of template):
>  $(document).ready(function(){
> $.jqplot.config.enablePlugins = true;
>  var s1 ={{ s1 }}
>  var ticks ={{ ticks }}
> plot1 = $.jqplot('chart1', [s1], {
> // Only animate if we're not using excanvas (not in IE 7 or IE 
> 8)..
> animate: !$.jqplot.use_excanvas,
> seriesDefaults:{
> renderer:$.jqplot.BarRenderer,
> pointLabels: { show: true }
> },
> axes: {
> xaxis: {
> renderer: $.jqplot.CategoryAxisRenderer,
> ticks: ticks
> }
> },
> highlighter: { show: false }
> });
> 
> $('#chart1').bind('jqplotDataClick', 
> function (ev, seriesIndex, pointIndex, data) {
> $('#info1').html('series: '+seriesIndex+', point: 
> '+pointIndex+', data: '+data);
> }
> );
> });
> 
>
> when I view the source of the html file i get {{ ticks }} as
> ['a', 'b', 'c', 'd']
>
>

-- 
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/-/wR8glH02O1UJ.
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: When I set DEBUG=False, my 404.html doesn't appear

2012-12-29 Thread nimesh ghelani
Can you post the shell output when 404 occurs along with the TEMPLATE_DIRS 
part of settings.py?

On Saturday, December 29, 2012 9:29:11 PM UTC+5:30, Dae_James wrote:
>
>  I put my 404.html into root of the directory specified in TEMPLATE_DIRS. 
> However, when I visit an inexisting page, the browser's 404.html appears 
> rather than my own 404.html page.
> What's wrong with me ? 
> PS: I've set the DEBUG variable in settings.py to False.
>  
> --
> Dae James
>

-- 
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/-/gHqHfu2BGzoJ.
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: Actions after logout

2012-12-29 Thread Ryan Blunden
When you say you haver a "process in place", do you mean code sitting in a file?

If you haven't already, create a logout url and hook it up to your code to 
delete the log out data. Then just call django.contrib.auth.logout() somewhere 
in your logout view.

Cheers,
Ryan

On 27/12/2012, at 6:50 AM, 4 The good Life we work <4thegdl...@googlemail.com> 
wrote:

> Hallo,
> 
> I would like to delete certain data + login data after logout.
> 
> I have a process in place and would like to delete the
> data inserted if the process is not followed to the last step.
> 
> Thanks for your support,
> Michael
> 
> -- 
> 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: Using django-profiles app twice in one project.

2012-12-29 Thread Ryan Blunden
The AUTH_PROFILE_MODULE functionality is being deprecated in Django 1.5 in 
favour of being able to create your own custom User models. It sounds like that 
would be the way to go, especially as the 1.5 release is just around the corner 
and trunk is normally rock solid.

Cheers,
Ryan

On 27/12/2012, at 6:01 AM, Bill Freeman  wrote:

> 
> 
> On Thu, Dec 27, 2012 at 12:51 AM, Mark Shervey  wrote:
> I'm trying to use three different instances of the django-profiles app in one 
> project (developed here: https://bitbucket.org/ubernostrum/django-profiles).  
> I can make the whole thing work fine with one instance, but when I create the 
> three different instances with different names, I get this error:  "Exception 
> Value:   Unable to load the profile model, check AUTH_PROFILE_MODULE in your 
> project settings."  Is there a way to create thee different 
> AUTH_PROFILE_MODULE settings?
> 
> I know this is probably not the best practice, but it's something we need to 
> hack for now
> 
> I'm able to get django-profiles 
> (https://bitbucket.org/ubernostrum/django-profiles) working fine as one app 
> (vendor), but when I try to run two apps (vendor and coordinator) I get this 
> error: "Exception Value:   Unable to load the profile model, check 
> AUTH_PROFILE_MODULE in your project settings.".  I know it's because I need 
> this variable to point at the profile app, but is there a way that I can 
> either 1) Point it two places, or 2) create a new variable for it to resolve 
> to?
> 
> 
> Perhaps if you explained why you need three different profile apps, we could 
> offer another way to go.
> 
> The design of the profile stuff only offers one known connection between User 
> and a profile model.
> 
> I'm going to guess that you are looking to have three categories of 
> membership, with different sets of fields.  There are two ways that I see:
> 
>   1. A single profile model with all the fields, plus either a member_type 
> choice field, of several booleans indicating whether this member has those 
> features (lets a member live in more that one category if that's desirable).  
> Then all the views have to be careful to show (or allow editing of) only what 
> the given member type should be able to see.  The downside is that the admin 
> as it stands will not be suitable for the less technical manager, but even 
> this can be fixed with a custom template for this admin (though I tend to 
> like specific non-admin profile management views when things get this 
> squirrelly - often already useful to let users manage certain fields of their 
> own profiles).
> 
>   2. Write your own profile feature that can choose among several distinct 
> profile models and monkey patch it in so that any needed additional app that 
> finds profile from user in the standard way gets your chosen profile instance.
> 
> Bill
> 
> Note: use of the term "monkey patch" is intentionally pejorative.
> 
> 
> -- 
> 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: Access denied for user

2012-12-29 Thread Ryan Blunden
You either need to create an account for this user with access to the database 
or check the username and password provided.

How are you administering the DB? PHPMyAdmin?

On 27/12/2012, at 6:22 AM, El sayed Gamal  wrote:

> You need to change your mysql database configurations, that's is it.
> 
> On Thursday, December 27, 2012 3:45:58 PM UTC+2, Sanket Garg wrote:
> i m trying to follow the following guide
> 
> https://docs.djangoproject.com/en/1.3/intro/tutorial01/
> 
> but i m getting error
> ERROR 1045 (28000): Access denied for user 'Sanket'@'localhost' (using 
> password: YES)
> 
> do i need to login in as superuser or something? i m stuck :/
> 
> -- 
> 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/-/F-R0nE018soJ.
> 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: Admin page not found error

2012-12-29 Thread Ryan Blunden
I added a record to the django_site table (which Django on the first syncdb run 
for the Sites app) and then I could view the admin fine.

So you can either try this or just delete the sqlite.db file and run syncdb 
again which will also fix the problem.

Also, you don't need to specify the database path as an absolute path. It's 
relative to the Django project root folder so just "sqlite.db" would be fine.

Happy coding.

Cheers,
Ryan

On 29/12/2012, at 12:14 AM, Shahjalal Hossain  wrote:

> 
> 
> On Friday, December 28, 2012 9:29:50 AM UTC+1, Shahjalal Hossain wrote:
> 
> 
> 
> 
> 
> 
> 
> Hi, I am new at Django. I am learning Django from instruction manual "a basic 
> poll application". I was doing step by step. But, at a certain point I 
> stacked. 
> 
> It does not shows admin page as "2.4 Writing your first Django app, part 2". 
> I have done all the steps, like uncomment settings.py and urls.py and run the 
> syncdb. I am writing on code on Aptana Studio 3. For convenient, I have given 
> some images. and source files.
> 
> Thanks, in advance.
> 
> settings.py
> 
> INSTALLED_APPS = (
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.sites',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> # Uncomment the next line to enable the admin:
> 'django.contrib.admin',
> # Uncomment the next line to enable admin documentation:
> # 'django.contrib.admindocs',
> 'polls',
> )
> 
> urls.py
> 
> from django.conf.urls import patterns, include, url
> 
> # Uncomment the next two lines to enable the admin:
> from django.contrib import admin 
> admin.autodiscover()
> 
> urlpatterns = patterns('',
> # Examples:
> # url(r'^$', 'mysite.views.home', name='home'),
> # url(r'^mysite/', include('mysite.foo.urls')),
> 
> # Uncomment the admin/doc line below to enable admin documentation:
> # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
> 
> # Uncomment the next line to enable the admin:
> url(r'^admin/', include(admin.site.urls)),
> )
> 
> 
> 
> 
> -- 
> 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/-/mW2jgtuPr_gJ.
> 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: Bug in inlines.js

2012-12-29 Thread Ryan Blunden
You should post this to https://code.djangoproject.com/newticket

Cheers,
Ryan

On 29/12/2012, at 12:50 AM, Ruud van der Weide  wrote:

> I just noticed a small bug in inlines.js. In the part where the "addButton" 
> is included, the following check is used:
> if ($this.attr("tagName") == "TR") {
> This check doesn't work as expected however. The attr-method reads an 
> attribute. "tagName" isn't an attribute. This check should be:
> if ($this.is("tr")) {
> 
> Due to this bug, the "Add another ..." link gets positioned weirdly when 
> using a TabularInline.
> 
> - Ruud
> 
> -- 
> 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/-/LmL4VKrIpPkJ.
> 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: Django 1.5 - release date

2012-12-29 Thread Aaron C. de Bruyn
Django 1.5 is close to being released.

I'm not sure how you do your development, but my process under Linux is to
create a virtualenv (virtualenv myproject) then install the development
version of Django (pip install git+git://github.com/django/django.git) and
then begin the project (django-admin.py startproject myproject).

Every few days I will update django with the latest development changes
(pip install --upgrade git+git://github.com/django/django.git).  When I get
close to releasing the site, I stop updating Django and stick with whatever
version I'm on (pip freeze > requirements.txt).  If Django still hasn't
released the next version, by the time I launch the site, I go live, then
update and test when the final version comes out.


On Fri, Dec 28, 2012 at 10:44 PM, Aidan Zhakypov  wrote:

> Does anyone know when Django 1.5 is going to be released as a stable
> version? If I want to *start* developing a production web site, should I
> write it on Django 1.4 or is it already ok to implement it on Django 1.5?
>
> --
> 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/-/DgTQV-MpfhAJ.
> 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: Question about URL namespaces

2012-12-29 Thread Ryan Blunden
I've never used this feature but I believe it was created so that for a single 
Django project, you could provide multiple administration apps. For example, 
you might have one for customers and one for back office staff that expose 
different models, have different permissions etc.

So to answer your question about what "application" means in this context, it 
means a Django application (e.g. django.contrib.admin).

Cheers,
Ryan

On 29/12/2012, at 4:44 AM, "Dae James"  wrote:

> When I was reading django's URL document, I come across "URL namespaces".
> The raw sentence is "When you need to deploy multiple instances of a single 
> application, it can be helpful to be able to differentiate between instances."
> I'm very confused here. What the application here refer to? Does it mean  
> models ? Or something else I don't know?
> Thank you~~
>  
> Dae 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-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: Problem with auto tests Get an error creating the test database: (1044, "Access denied for user 'viewbank_django'@'localhost' to database 'test_viewbank_django'")

2012-12-29 Thread Ryan Blunden
Hey Jeff,

There sure is. Just specify a "TEST_NAME" key in the database configuration 
dictionary and you're good to go.

https://docs.djangoproject.com/en/dev/topics/testing/overview/#the-test-database

Cheers,
Ryan

On 29/12/2012, at 7:27 AM, Jeff  wrote:

> When I run the command - "python manage.py test polls" I get the following 
> error - error creating the test database: (1044, "Access denied for user 
> 'viewbank_django'@'localhost' to database 'test_viewbank_django'")
> 
> I am using a shared server that will only allow me to create a database 
> prefixed with viewbank_.
> 
> Using the MYSQL client I can create viewbank_django_test or any variation I 
> like as long as it starts with viewbank_.
> 
> Is there a way to change the way django names the test database?
> 
> Thanks in advance
> Jeff
> 
> -- 
> 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/-/oxBvQnPWaJgJ.
> 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: problem while passing a list of string to javascript in template

2012-12-29 Thread Ryan Blunden
Django presumes all template variables are "unsafe" by default to prevent XSS 
attacks which is why it's encoded the quotes.

Read up on filters and auto-escaping and you'll be able to figure out the rest.

Cheers,
Ryan

On 29/12/2012, at 7:57 AM, "Everest K.C."  wrote:

> Hello Everyone,
> I have problem while passing a list of string from django views to javascript 
> template. The quotation mark gets converted into hex and I cannot use it to 
> plot graph using jpplot. I even tried replace method of javascript to replace 
> the hex to convert to '. 
> 
> The codes are as follows:
> From views.py :
> from django.shortcuts import render_to_response
> 
> def abc(request):
>   s1=[1, 5 , 8 , 3]
>   ticks=["a", "b", "c", "d"]
>   return render_to_response('abc.html', {'s1':s1, 'ticks':ticks})
> 
> From .html file (of template):
>  $(document).ready(function(){
> $.jqplot.config.enablePlugins = true;
>var s1 ={{ s1 }}
>var ticks ={{ ticks }}
> plot1 = $.jqplot('chart1', [s1], {
> // Only animate if we're not using excanvas (not in IE 7 or IE 
> 8)..
> animate: !$.jqplot.use_excanvas,
> seriesDefaults:{
> renderer:$.jqplot.BarRenderer,
> pointLabels: { show: true }
> },
> axes: {
> xaxis: {
> renderer: $.jqplot.CategoryAxisRenderer,
> ticks: ticks
> }
> },
> highlighter: { show: false }
> });
> 
> $('#chart1').bind('jqplotDataClick', 
> function (ev, seriesIndex, pointIndex, data) {
> $('#info1').html('series: '+seriesIndex+', point: 
> '+pointIndex+', data: '+data);
> }
> );
> });
> 
> 
> when I view the source of the html file i get {{ ticks }} as
> ['a', 'b', 'c', 'd']
> 
> 
> -- 
> 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/-/mlgFT3rjmLQJ.
> 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: When I set DEBUG=False, my 404.html doesn't appear

2012-12-29 Thread Ryan Blunden
All I can suggest is to double-check the TEMPLATE_DIRS tuple to ensure the path 
is correct.

On 29/12/2012, at 7:59 AM, "Dae James"  wrote:

> I put my 404.html into root of the directory specified in TEMPLATE_DIRS. 
> However, when I visit an inexisting page, the browser's 404.html appears 
> rather than my own 404.html page.
> What's wrong with me ?
> PS: I've set the DEBUG variable in settings.py to False.
>  
> Dae 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-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: alternate way for nested inline in django admin

2012-12-29 Thread Nikhil Verma
Hi All

Can somebody explain me the workaround for this ticket 9025. I want to
nested inlines in my django admin
explained below.

Thanks in advance

On Fri, Dec 28, 2012 at 10:54 PM, Nikhil Verma wrote:

> Hi Guys
>
> Here are my models :-
>
> class Blog(models.Model):
> """
> This model represents information that is stored about a blog.
> """
>
> seo_tag = models.CharField(max_length=100)
> title = models.CharField(max_length=100, unique=True)
> description = models.TextField(verbose_name="content")
> meta_description = models.TextField(max_length=5000)
> image = models.ImageField(upload_to="blogs/images/", blank=True)
> video = models.FileField(upload_to="blogs/videos/", blank=True)
>   and so on 
>
> class BlogSidebarTitle(models.Model):
> """
> Describes the related title and sublinks inside
> the custom sidebar
> """
>
> associated_blog = models.ForeignKey(Blog)
> title = models.CharField(max_length=255,null=True,blank=True)
> title_sequence = models.IntegerField(null=True,blank=True)
>
> def __unicode__(self):
> return self.title
>
> #---
>
> class BlogSidebarSubtitle(models.Model):
> """
> Subtitle within the sidebar
> """
> associated_blog = models.ForeignKey(Blog)
> title = models.ForeignKey(BlogSidebarTitle)
> sublink_title = models.CharField(max_length=255,null=True,blank=True)
> sublink_title_sequence = models.IntegerField(null=True,blank=True)
> sublink_title_url = models.URLField(blank=True,null=True)
>
> def __unicode__(self):
> return self.sublink_title
>
>
>
> Now i want that if i go to add blog page in admin i can add multiple
> subtitle  for a single title
>
> Like this :-
>
> Add blog Page :-
> After blog fields in admin
> # I want that it should be Tabularline
> Fieldset Blog Sidebar title
> Title Title sequence
> # after this is should be having
>Sublink_title sublink_title_sequence
> sublink _title_url
># then is hould be able to add more subtitle to single title
>+ Add another Sublink title
>
> So i wrote the admin like this :-
>
>
> #---
> class BlogSidebarSubtitleInline(admin.TabularInline):
> """
> """
>
> models = BlogSidebarSubtitle
> extra = 1
>
> #---
> class BlogSidebarTitleInline(admin.TabularInline):
> """
> Making it appear on blog screen
> """
>
> model = BlogSidebarTitle
> extra = 1
>
> #---
> class BlogSidebarTitleAdmin(admin.ModelAdmin):
> inlines = [BlogSidebarSubtitleInline,]
> extra = 1
>
> class BlogAdmin(admin.ModelAdmin):
> """
> Finally the layout of it.
> """
>
> # For tags
> filter_horizontal = ('tags',)
>
> # Calling the Editor
> class Media:
> js = (
>   '/static/tinymce/jscripts/tiny_mce/tiny_mce.js',
>   '/static/js/textarea.js',
>   )
> # Finally diving the page into fieldsets
> fieldsets = [
> ('Blog',{'fields': ['seo_tag', 'title','meta_description',
> 'description',
> 'category', 'image','video', 'save_as_draft',
> 'featured', 'tags']})]
> #readonly_fields = ['seo_tag',]
>
> inlines = [BlogSidebarButtonsInline, BlogSidebarTitleInline]
>
>
> But still the BlogSidebarSubtitle class fields are not appearing in admin
> and i am not able to have nested inlines.
>
> Can anybody tell the appropriate way to do this and if not where i am
> doing wrong in the above code.
>
> Thanks  .
> --
> Regards
> Nikhil Verma
> +91-958-273-3156
>



-- 
Regards
Nikhil Verma
+91-958-273-3156

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



When I set DEBUG=False, my 404.html doesn't appear

2012-12-29 Thread Dae James
I put my 404.html into root of the directory specified in TEMPLATE_DIRS. 
However, when I visit an inexisting page, the browser's 404.html appears rather 
than my own 404.html page.
What's wrong with me ? 
PS: I've set the DEBUG variable in settings.py to False.




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



problem while passing a list of string to javascript in template

2012-12-29 Thread Everest K.C.
Hello Everyone,
I have problem while passing a list of string from django views to 
javascript template. The quotation mark gets converted into hex and I 
cannot use it to plot graph using jpplot. I even tried *replace* method of 
javascript to replace the hex to convert to '. 

The codes are as follows:
>From views.py :
from django.shortcuts import render_to_response

def abc(request):
s1=[1, 5 , 8 , 3]
ticks=["a", "b", "c", "d"]
return render_to_response('abc.html', {'s1':s1, 'ticks':ticks})

>From .html file (of template):
 $(document).ready(function(){
$.jqplot.config.enablePlugins = true;
 var s1 ={{ s1 }}
 var ticks ={{ ticks }}
plot1 = $.jqplot('chart1', [s1], {
// Only animate if we're not using excanvas (not in IE 7 or IE 
8)..
animate: !$.jqplot.use_excanvas,
seriesDefaults:{
renderer:$.jqplot.BarRenderer,
pointLabels: { show: true }
},
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: ticks
}
},
highlighter: { show: false }
});

$('#chart1').bind('jqplotDataClick', 
function (ev, seriesIndex, pointIndex, data) {
$('#info1').html('series: '+seriesIndex+', point: 
'+pointIndex+', data: '+data);
}
);
});


when I view the source of the html file i get {{ ticks }} as
['a', 'b', 'c', 'd']

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



Problem with auto tests Get an error creating the test database: (1044, "Access denied for user 'viewbank_django'@'localhost' to database 'test_viewbank_django'")

2012-12-29 Thread Jeff
When I run the command - "python manage.py test polls" I get the following 
error - error creating the test database: (1044, "Access denied for user 
'viewbank_django'@'localhost' to database 'test_viewbank_django'")

I am using a shared server that will only allow me to create a database 
prefixed with viewbank_.

Using the MYSQL client I can create viewbank_django_test or any variation I 
like as long as it starts with viewbank_.

Is there a way to change the way django names the test database?

Thanks in advance
Jeff

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



citations

2012-12-29 Thread samtygier
Hi,

I am creating a site, and trying to implement a referencing/citation system.

I'd like to render something like
"Lorem ipsum dolor sit amet[[ref:foo2012]], consectetur adipisicing elit, 
sed do eiusmod tempor incididunt[[ref:bar2011]] ut labore et dolore magna 
aliqua."
stored in a TextField, 
"Lorem ipsum dolor sit amet[1], consectetur adipisicing elit, sed do 
eiusmod tempor incididunt[2] ut labore et dolore magna aliqua."

"[1] foo, 'something something' (2012)
[2] bar, 'something something' (2011)
"
where "foo2012" is the slug of a reference object, that has a title, 
author, data etc. 

I have made a filter that can scan though a string, pick out the [[]] tags 
and look up the reference. I can use this in  a template like {{ 
site.description|refs }}. However i need somewhere to store mapping of 
numbers to references for that page, so that i can filter multiple blocks 
on the same page without resetting the numbering. I would then use a tag at 
the end of the page, that rendered the collected list.

The docs on custom tags and filters talks about render_context, but does 
not show how to use them with filters (only with tags). 

Am i going about this the wrong way? should filters be stateless? i realise 
that parsing relationships out of a text field is not good database style, 
but i can't think of another way to allow editors to put citations into 
text. i would also like to use a similar tag for cross links in the text 
(eg [[site:foo]] -> "/sites/view/foo").

thanks,
sam

-- 
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/-/2RrZilHvtSsJ.
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: Design by composition and persistance

2012-12-29 Thread Javier Guerra Giraldez
On Sat, Dec 29, 2012 at 3:39 AM, Taras_96  wrote:
> If we map software objects directly onto Django Models, then we'd end up
> with a TimeWindow table, where each row would only ever be referenced by
> exactly one Event. My understanding of the advantage of normalisation is
> that it prevents data duplication, and thus helps with data consistency.
> However, it doesn't really make much sense to incur the cost of this
> (through joins) if the object that is being modelled is a value object.

there's value in one-to-one relationships too.  it's not about
performance, but about data organization.   also, if there's a lot of
data that logically 'belongs' to a record but is seldom used, it's
easier to ignore when not needed if it's on a separate table.

but if it really belongs to the record, and you want to store on the
same table, and keep it conceptually as a separate object, then it
could be easier to create a new field class.

it could be either a full-blown field that stores its data on more
than one DB field, or it could be an extra abstraction used on top of
existing (and declared) fields, similar to the way generic
relationships work
(https://docs.djangoproject.com/en/1.4/ref/contrib/contenttypes/#generic-relations):


--
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic

class TaggedItem(models.Model):
tag = models.SlugField()
content_type = models.ForeignKey(ContentType)
object_id = models.PositiveIntegerField()
content_object = generic.GenericForeignKey('content_type', 'object_id')

def __unicode__(self):
return self.tag
---

there you see the 'content_type' and 'object_id' fields store some
'low-level' data, and the 'content_object' field uses those to present
a different interface: the relationship behaviour.

in your case:

class Event(models.Model):
  name = models.CharField(.)
  description = models.CharField()
  tw_start = models.DateTimeField()
  tw_finish= models.DateTimeField()
  timewindow = TimeWindowField(tw_start, tw_finish)

and getDuration() is a method of the TimeWindowField, so you can say
event.timewindow.getDuration()


--
Javier

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



Question about URL namespaces

2012-12-29 Thread Dae James
When I was reading django's URL document, I come across "URL namespaces". 
The raw sentence is "When you need to deploy multiple instances of a single 
application, it can be helpful to be able to differentiate between instances."
I'm very confused here. What the application here refer to? Does it mean  
models ? Or something else I don't know?
Thank you~~




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



customize the comment template for cleaned_data errors

2012-12-29 Thread Stephan
I use Django 1.4.3 and have a problem with the comment-app. If the 
comment-app miss some data (e.g. the field "Comment" is empty) I get the 
preview template with the error message. This preview-template is without 
css-style and looks horrible. How is it possible to use the normal template 
also for error messages?  I don't need the preview for comments.

Regards
Stephan

-- 
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/-/xGD0vwvEthcJ.
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: Design by composition and persistance

2012-12-29 Thread Mike Dewhirst

On 29/12/2012 7:39pm, Taras_96 wrote:

f we map software objects directly onto Django Models, then we'd end up
with a TimeWindow table, where each row would only ever be referenced by
exactly one Event. My understanding of the advantage of normalisation is
that it prevents data duplication, and thus helps with data consistency.
However, it doesn't really make much sense to incur the cost of this
(through joins) if the object that is being modelled is a value object.



If there is a genuine one-to-one relationship you can be a bit relaxed 
about making it part of the event table. That won't duplicate anything.


But there is nothing wrong with being rigorously 3rd normal form right 
now and then optimising later - if necessary.


Mike

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



Django 1.5 - release date

2012-12-29 Thread Aidan Zhakypov
Does anyone know when Django 1.5 is going to be released as a stable 
version? If I want to *start* developing a production web site, should I 
write it on Django 1.4 or is it already ok to implement it on Django 1.5?

-- 
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/-/DgTQV-MpfhAJ.
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.



Bug in inlines.js

2012-12-29 Thread Ruud van der Weide
I just noticed a small bug in inlines.js. In the part where the "addButton" 
is included, the following check is used:
if ($this.attr("tagName") == "TR") {
This check doesn't work as expected however. The attr-method reads an 
attribute. "tagName" isn't an attribute. This check should be:
if ($this.is("tr")) {

Due to this bug, the "Add another ..." link gets positioned weirdly when 
using a TabularInline.

- Ruud

-- 
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/-/LmL4VKrIpPkJ.
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: Design by composition and persistance

2012-12-29 Thread Taras_96
Hey Mike,

Sorry I didn't make it very clear that I've been working with Django for 
about 8 months now, so I've got the hang of the basic concepts. I'm 
redesigning a part of the system that was hacked together into what I hope 
is a cleaner OO design.

I realised that my question can be applied outside of Django in the more 
general ORM area. I found 
http://stackoverflow.com/questions/4907518/is-there-an-orm-that-supports-composition-w-o-joins
 
which explains the design issue I'm having,and it looks like JPA's 
'embeddable' decorator is what I'm describing. 

If we map software objects directly onto Django Models, then we'd end up 
with a TimeWindow table, where each row would only ever be referenced by 
exactly one Event. My understanding of the advantage of normalisation is 
that it prevents data duplication, and thus helps with data consistency. 
However, it doesn't really make much sense to incur the cost of this 
(through joins) if the object that is being modelled is a value object.

So does anyone have any experience with this problem/trade-off in the 
Django world?


On Saturday, 29 December 2012 18:53:05 UTC+11, Mike Dewhirst wrote:
>
> On 29/12/2012 4:44pm, Taras_96 wrote: 
> > Hi, 
> > 
> > I'm stuck on the best way of implementing design by composition in 
> > Django, and was wondering if anyone had any suggestions/pointers/past 
> > experiences. 
>
> Design by compositon is what you do before thinking about Django. The 
> outcome would be, well, a design! 
>
> Only then do you convert the entities and relationships into Django 
> models. A model defines the object complete with data and methods. 
>
> Relationships between models are defined via SQL-style foreign keys and 
> constraints. 
>
> Have a look at the model layer here ... 
>
> https://docs.djangoproject.com/en/1.5/ 
>
> and 
>
>
> https://docs.djangoproject.com/en/1.5/ref/models/fields/#module-django.db.models.fields.related
>  
>
>
> Cheers 
>
> Mike 
>
> > 
> > Say you're designing an event management program. Each event has a name, 
> > occurs in a suburb, and has a start time and end time. Say you want to 
> > model an event as follows. 
> > 
> > class Event: 
> >string eventName 
> >string description 
> >Suburb suburb 
> >TimeWindow eventTimeWindow 
> > 
> > class Suburb: 
> >string suburbName 
> >string state 
> >string postcode 
> > 
> > class TimeWindow: 
> >datetime startTime 
> >datetime endTime 
> >def getDuration(self) # in seconds 
> > 
> > 
> > The system contains a definitive list of Suburbs that can be chosen; 
> > that is a Suburb object has reference semantics. Consequently it makes 
> > sense for Suburb to have its own table, and thus the Event has a foreign 
> > key to a Suburb object. 
> > 
> > However, a 'TimeWindow' object has value semantics. Two TimeWindow 
> > objects with the same attributes are not the same object (arguable, but 
> > for illustration let's assume this). Thus although TimeWindow could have 
> > it's own table, it seems like overkill - you have the cost of a join, 
> > and a TimeWindow object will only ever have a reference to exactly one 
> > Event (thus there's no benefit in normalising this part of the design). 
> > 
> > This is analagous, in the extreme case, to the 'eventName' attribute. 
> > 'eventName' has value semantics, that is two 'eventName's that have the 
> > same sequence of characters will still be two separate objects. So you 
> > wouldn't create a separate 'EventName' table and reference this from the 
> > 'Event' class. 
> > 
> > So from the OO software design angle, the Event's TimeWindow object is 
> > it's own object (with it's own state & behaviour), but at the 
> > persistance layer, TimeWindow's attributes are lumped in with eventName 
> > (and description) into the same 'Event' table. Having a separate 
> > TimeWindow object is desirable as it follows the general rule that 
> > design by composition is desirable. We should have small, coherent, 
> > abstracted models that are well defined. 
> > 
> > My question is, is it possible to acheive this in Django? One possible 
> > solution is to declare TimeWindow as abstract and have Event inherit it. 
> > But this doesn't accurately model the 'has a' relationship (and seems 
> > like an abuse of Abstract inheritance) - Event would inherit the 
> > 'getDuration' method as well as TimeWindow's attributes, which more or 
> > less makes sense in this case but not in the general case. 
> > 
> > So in your business logic you would want to use the object as: 
> > event.eventTimeWindow.getDuration() (and by using abstract inheritance 
> > this wouldn't be possible) 
> > 
> > Another drawback is that you could only have one 'TimeWindow' object per 
> > Event. Let's say that we change the model slightly so that eventName and 
> > description are both EnglishString types: 
> > 
> > class EnglishString: 
> >def isEnglish(self) 
> >def spellCheck(self) 
> >def titleCase(self) # 

Re: Admin page not found error

2012-12-29 Thread Shahjalal Hossain


On Friday, December 28, 2012 9:29:50 AM UTC+1, Shahjalal Hossain wrote:
>
>
> 
>
>
> 
>
>
> 
>
> Hi, I am new at Django. I am learning Django from instruction manual "a 
> basic poll application". I was doing step by step. But, at a certain point 
> I stacked. 
>
> It does not shows admin page as "2.4 Writing your first Django app, part 
> 2". I have done all the steps, like uncomment settings.py and urls.py and 
> run the syncdb. I am writing on code on Aptana Studio 3. For convenient, I 
> have given some images. and source files.
>
> Thanks, in advance.
>
> *settings.py*
>
> INSTALLED_APPS = (
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.sites',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> # Uncomment the next line to enable the admin:
> 'django.contrib.admin',
> # Uncomment the next line to enable admin documentation:
> # 'django.contrib.admindocs',
> 'polls',
> )
>
> *urls.py*
>
> from django.conf.urls import patterns, include, url
>
> # Uncomment the next two lines to enable the admin:
> from django.contrib import admin 
> admin.autodiscover()
>
> urlpatterns = patterns('',
> # Examples:
> # url(r'^$', 'mysite.views.home', name='home'),
> # url(r'^mysite/', include('mysite.foo.urls')),
>
> # Uncomment the admin/doc line below to enable admin documentation:
> # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
>
> # Uncomment the next line to enable the admin:
> url(r'^admin/', include(admin.site.urls)),
> )
>
>
>
>

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