Re: 'python manage.py migrate' command gives error even after installing south

2013-11-22 Thread Nigel Legg
Check the documentation for south and go through the tutorial at
http://south.readthedocs.org/en/latest/tutorial/part1.html -  you need to
do an initial migration, and then an auto migration.  Also, the taceback
you posted says there is a syntax error in the question model

Cheers, Nigel
07914 740972



On 22 November 2013 04:41, puneet pandey  wrote:

> I was going through Django tutorials and found the command - 'python
> manage.py migrate' to give output as 'unknown command' . So i searched for
> it and found that its most probably due to 'south' not installed. i checked
> it on python shell by giving the command - 'import south' which resulted in
> 'unknown module'. So I installed south first by using easy_install and then
> by apt-get and then updated the system. I also went to settings.py and
> added south in the installed_apps section.
>
> Now when I ran 'python manage.py migrate' command there was an error -
> pasting it here -
>
> popo@popo-HP-TouchSmart-tm2-Notebook-PC:~/Django_apps/mysite$ python
> manage.py migrate
> Traceback (most recent call last):
>   File "manage.py", line 10, in 
> execute_from_command_line(sys.argv)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
> line 399, in execute_from_command_line
> utility.execute()
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
> line 392, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
> line 242, in run_from_argv
> self.execute(*args, **options.__dict__)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
> line 284, in execute
> self.validate()
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
> line 310, in validate
> num_errors = get_validation_errors(s, app)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/validation.py",
> line 34, in get_validation_errors
> for (app_name, error) in get_app_errors().items():
>   File
> "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line
> 196, in get_app_errors
> self._populate()
>   File
> "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line
> 75, in _populate
> self.load_app(app_name, True)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line
> 99, in load_app
> models = import_module('%s.models' % app_name)
>   File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py",
> line 40, in import_module
> __import__(name)
>   File "/home/popo/Django_apps/mysite/polls/models.py", line 5
> Class Question(models.Model):
>  ^
> SyntaxError: invalid syntax
>
>
>
>
>
>
>
>
>
>
> what can i do to solve this issue.
> Thanks a lot everyone for reading this and helping me out.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/ae647a5a-bea1-4c89-9816-4162ddb9809e%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADeX7vxU6Ok-O3X-znF%2BXYd0Kn%3DWiDfZ9eQTsTrs8LU_--XiDA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ABOUT DJANGO

2013-11-09 Thread Nigel Legg
My apologies to everyone, though I have received similar replies in the
past (not necessarily here).  You are quite right, I should have asked for
more information.

Cheers, Nigel
07914 740972



On 9 November 2013 22:48, Russell Keith-Magee <russ...@keith-magee.com>wrote:

>
> Nigel - that comment was in no way helpful. If you can't be helpful,
> please refrain from commenting. Glib comments like that one give the entire
> Django community a bad name.
>
> Hugar - it's very difficult to help without knowing what you've tried,
> what error messages you received, what operating system you're using, and
> so on. If you provide more details, we might be able to help.
>
> Yours,
> Russ Magee %-)
>
>
> On Sun, Nov 10, 2013 at 3:12 AM, Nigel Legg <nigel.l...@gmail.com> wrote:
>
>> READ THE MANUAL.
>>
>> Cheers, Nigel
>> 07914 740972
>>
>>
>>
>> On 9 November 2013 18:39, HUGAR MANJUNATH Manjunath 
>> <hugar...@gmail.com>wrote:
>>
>>> HELLO , I AM NOT GETTING HOW TO INSTAL THE DJANGO AND PYTHAN ON OUR
>>> MACHINE.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/133d769f-dd63-4e69-b14b-f4e25b3bc259%40googlegroups.com
>>> .
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CADeX7vwLM%3DAL0GxB1rL5-V%3DWWjYT_3y80uZckLdrU%3DSQV26Nog%40mail.gmail.com
>> .
>>
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJxq84-vUUdK%3D2nFQFJ1jzRM8aUi2%3DXmA1TEFNxTfWN%3DazoQRg%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADeX7vwhdjSG0-0u2cPtoP_cR%2BchK6%2BS5uT_cs%2BkpBuUE5gqww%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ABOUT DJANGO

2013-11-09 Thread Nigel Legg
READ THE MANUAL.

Cheers, Nigel
07914 740972



On 9 November 2013 18:39, HUGAR MANJUNATH Manjunath wrote:

> HELLO , I AM NOT GETTING HOW TO INSTAL THE DJANGO AND PYTHAN ON OUR
> MACHINE.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/133d769f-dd63-4e69-b14b-f4e25b3bc259%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADeX7vwLM%3DAL0GxB1rL5-V%3DWWjYT_3y80uZckLdrU%3DSQV26Nog%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: reauest.session[] not working.

2013-10-30 Thread Nigel Legg
I'll try that, but why does this work under windows and not ubuntu
On 30 Oct 2013 13:59, "Tom Evans" <tevans...@googlemail.com> wrote:

> On Wed, Oct 30, 2013 at 1:44 PM, Nigel Legg <nigel.l...@gmail.com> wrote:
> > My view:
> >
> > @login_required
> > def list(request):
> > user = User.objects.get(pk=request.session['user.id'])
>
> What is putting this 'user.id' key in the session? d.c.auth puts
> "_auth_user_id" in the session (but if the 'user' is the logged in
> user, why any of this, why not request.user?)
>
> Cheers
>
> Tom
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAFHbX1%2BqLWiu2Q9aATFD9A7uM5ahkuE7CNJdNiQ%2BdwLqQwXYOg%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADeX7vw1QF6DXg5k0S0a-a%3DQgp7MQq0rY5GFEDD6K46rA-VRBg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


reauest.session[] not working.

2013-10-30 Thread Nigel Legg
My view:

@login_required
def list(request):
user = User.objects.get(pk=request.session['user.id'])
# Handle file upload
if request.method == 'POST':
form = dataFileForm(request.POST, request.FILES)
if form.is_valid():
newdat = dataFiles(datafile = request.FILES['datafile'])
newdat.user_id = user
newdat.save()
# Redirect to the document list after POST
return HttpResponseRedirect(reverse('tilda.myapp.views.list'))
else:
form = dataFileForm() # A empty, unbound form'''
# Load documents for the list page
datafiles = dataFiles.objects.all()

# Render list page with the documents and the form
return render_to_response(
'myapp/list.html',
{'datafiles': datafiles, 'form': form, },
context_instance=RequestContext(request)
)

Under Windows7, using Python 2.7.5, with MySQL, this works after login,
showing a list of files already uploaded and the form to upload a new
file.
I have now moved the app onto Ubuntu 13.04, using Python 2.7.4 with
Postgres 9.1 (in reparation for a test deployment to Heroku), using
vrtualenv.  Following login, when I try and access this page, I get: Key
Error at myapp/list: 'user.id'.
I cant find a reason for this not working, can anyone help?



Cheers, Nigel
07914 740972

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADeX7vy_DQ7szJTdmKsosyfrAwx5mQgLaspFD%3Dp%2BeYzvK%2Buo_w%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django Tutorials

2013-10-28 Thread Nigel Legg
Cool, I'll take another look at it then.

Cheers, Nigel
07914 740972



On 28 October 2013 16:35, Jasvir Singh <jassigrewa...@gmail.com> wrote:

> On Mon, Oct 28, 2013 at 9:48 PM, Nigel Legg <nigel.l...@gmail.com> wrote:
> > I have looked at this a few times, and now I have realised what was
> bugging
>
> 
>
> > So I think that it would be much more useful and accessible if it was a
> > series of pages rather than a series of blog posts.
>
> Even I was thinking this too.
> Soon I'll shift this content to my personal domain where there will be
> complete section for these tutorials in a continues manner.
>
> --
>
> Jasvir Singh Grewal
> Blog:http://jasvirsinghgrewal91.wordpress.com/
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAN_O85vrgKmJ5RA0yoi2j6R%2BJTgZeyKFrtjMxGLBv82WS03aow%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADeX7vwcA-OQtfYxwBO%3DnMiLUcGBtFp3vaaoJSBLtRnaUXdNPg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: city selector for django

2013-10-28 Thread Nigel Legg
OK.  The readme makes it sound like it should work. maybe you should
contact the django-cities-light team?

Cheers, Nigel
07914 740972



On 28 October 2013 16:35, rush <dja...@irush.su> wrote:

> Hi,
>
> nope. unfortunately test_project has only URLs.Py . anything else is
> missing or broken. like templates directory is a link to itself.
>
> 28.10.13, 20:32, "Nigel Legg" <nigel.l...@gmail.com>":
> >
> > Following the link you posted I found a test project, is that not a
> usage example?
> >
> > Cheers, Nigel
> > 07914 740972
> >
> >
> >
> > On 28 October 2013 16:01, rush <dja...@irush.su> wrote:
> > Hi,
> > >It's pretty hard to find lightweight and easy city selector app with
> ready to use database.
> > >After a while, I've found a django-cities-light (
> https://github.com/yourlabs/django-cities-light ), but there is no usage
> examples at all. Maybe someone could prompt me where I can find one?
> > >ps. I also tried django-cities and django-simple-cities , but the first
> one is pretty complicated and the second one has a lot of errors even
> during a database installation. And geodjango is overkill for my needs. --
> > >wbr,rush.
> > >--
> > >You received this message because you are subscribed to the Google
> Groups "Django users" group.
> > >To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users+unsubscr...@googlegroups.com.
> > >To post to this group, send email to django-users@googlegroups.com.
> > >Visit this group at http://groups.google.com/group/django-users.
> > >To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/151871382976084%40web6g.yandex.ru
> .
> > >For more options, visit https://groups.google.com/groups/opt_out.
> > >
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "Django users" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users+unsubscr...@googlegroups.com.
> > To post to this group, send email to django-users@googlegroups.com.
> > Visit this group at http://groups.google.com/group/django-users.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CADeX7vx8w-QBNOvqYrG7BGb-FBavchxpSnEHJQMLEOfmruP6BA%40mail.gmail.com
> .
> > For more options, visit https://groups.google.com/groups/opt_out.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/6091382978144%40web13h.yandex.ru
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADeX7vwmOhKs_-1ndWWzwndbh%2BtUAaOCRwBuRsS%2B-RTELCyuJQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: city selector for django

2013-10-28 Thread Nigel Legg
Following the link you posted I found a test project, is that not a usage
example?

Cheers, Nigel
07914 740972



On 28 October 2013 16:01, rush  wrote:

> Hi,
>
> It's pretty hard to find lightweight and easy city selector app with ready
> to use database.
>
> After a while, I've found a django-cities-light (
> https://github.com/yourlabs/django-cities-light ), but there is no usage
> examples at all. Maybe someone could prompt me where I can find one?
>
> ps. I also tried django-cities and django-simple-cities , but the first
> one is pretty complicated and the second one has a lot of errors even
> during a database installation. And geodjango is overkill for my needs.
>
> --
> wbr,
> rush.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/151871382976084%40web6g.yandex.ru
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADeX7vx8w-QBNOvqYrG7BGb-FBavchxpSnEHJQMLEOfmruP6BA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django Tutorials

2013-10-28 Thread Nigel Legg
I have looked at this a few times, and now I have realised what was bugging
me.
Because this tutorial is a series of blog posts, when you access it, you
get to the most recently posted article, which may not be the article you
are looking for and will not be the start of the tutorial.
I think the blog is useful for posting tips and tricks, or articles on best
practice, but not necessarily for a tutorial, which should be read and
worked through as a structured series from beginning to end.
So I think that it would be much more useful and accessible if it was a
series of pages rather than a series of blog posts.

Cheers, Nigel
07914 740972



On 28 October 2013 16:10, Jasvir Singh  wrote:

> On Sat, Oct 26, 2013 at 9:12 PM, Pepsodent Cola 
> wrote:
> > Maybe make the text typography easier to see and read?
>
> Thanks for your suggestion. This is one the best suggestions that I
> have got about my blog.
> Now I am working on it.
> I'll let you know when it's done. Then you can again review it. :)
>
> --
>
> Jasvir Singh Grewal
> Blog:http://jasvirsinghgrewal91.wordpress.com/
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAN_O85ttvyyzG-xa6CXfC3S4RNYpMCuxu5_wFroXf86gRn9f_g%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADeX7vwHTdFc3KjBgvRzgXnSxiBkOSiRDqN-%2B2HUYzs8nx0OPw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: admin file not occuring

2013-10-26 Thread Nigel Legg
See the tutorial.  It explains all this.

Cheers, Nigel
07914 740972



On 26 October 2013 13:21, Mahantesh U  wrote:

> HI all,
>
>I am new to django. I am not able to see admin.py in my project file.
> So not able to run '/admin' API.pls suggest the solution.
>
> Thanks
> mahantesh
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/ae2509a8-295f-41fe-ae94-4c945fb7a7f9%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADeX7vxyJX25U6U91iArCYsoFAc26XkcgZ8aF%2BS-RL4U2VrPcQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Bug in admin models?

2013-10-24 Thread Nigel Legg
In installed apps you have s2.myapp, the traceback is just myapp.  Also you
have 's2.myapp, in the installed_apps, should it not be 's2.myapp', (ie
missing the end quote)?


Cheers, Nigel
07914 740972



On 24 October 2013 14:20, Derek  wrote:

> Yes, its there - the line after 'suit'.
>
>
> On Wednesday, 23 October 2013 19:22:54 UTC+2, Odin wrote:
>
>> Can't see the django.contrib.admin in INSTALLED_APPS.
>>
>>
>> 2013/10/23 Derek 
>>
>>> I am trying to add a model entry, via the admin; I get this error (which
>>> has not happened before), running Django on Ubuntu 12.04 with the test
>>> server.  Not sure if there is an error with the model (which has worked
>>> fine up to now) or ...?
>>>
>>>
>>> Request Method: POST
>>> Request URL: 
>>> http://127.0.0.1:8000/admin/**myapp/mymodel/add/
>>>
>>> Django Version: 1.5.4
>>> Python Version: 2.7.3
>>> Installed Applications:
>>> ('django.contrib.auth',
>>>  'django.contrib.contenttypes'**,
>>>  'django.contrib.sessions',
>>>  'django.contrib.staticfiles',
>>>  'django.contrib.messages',
>>>  'django.contrib.admindocs',
>>>  'django_nose',
>>>  'django_extensions',
>>>  'crispy_forms',
>>>  'autocomplete_light',
>>>  'admin_enhancer',
>>>  'smart_selects',
>>>  'selectable',
>>>  'massadmin',
>>>  's2.myapp,
>>>  'suit',
>>>  'django.contrib.admin')
>>> Installed Middleware:
>>> ('django.middleware.common.**CommonMiddleware',
>>>  'django.contrib.sessions.**middleware.SessionMiddleware',
>>>  'django.middleware.csrf.**CsrfViewMiddleware',
>>>  'django.contrib.auth.**middleware.**AuthenticationMiddleware',
>>>  'django.contrib.messages.**middleware.MessageMiddleware',
>>>  's2s.middle.middleware.**AdminSessionMiddleware')
>>>
>>>
>>> Traceback:
>>> File 
>>> "/usr/local/lib/python2.7/**dist-packages/django/core/**handlers/base.py"
>>> in get_response
>>>   115. response = callback(request,
>>> *callback_args, **callback_kwargs)
>>> File 
>>> "/usr/local/lib/python2.7/**dist-packages/django/contrib/**admin/options.py"
>>> in wrapper
>>>   372. return self.admin_site.admin_view(**view)(*args,
>>> **kwargs)
>>> File "/usr/local/lib/python2.7/**dist-packages/django/utils/**decorators.py"
>>> in _wrapped_view
>>>   91. response = view_func(request, *args, **kwargs)
>>> File 
>>> "/usr/local/lib/python2.7/**dist-packages/django/views/**decorators/cache.py"
>>> in _wrapped_view_func
>>>   89. response = view_func(request, *args, **kwargs)
>>> File 
>>> "/usr/local/lib/python2.7/**dist-packages/django/contrib/**admin/sites.py"
>>> in inner
>>>   202. return view(request, *args, **kwargs)
>>> File "/usr/local/lib/python2.7/**dist-packages/django/utils/**decorators.py"
>>> in _wrapper
>>>   25. return bound_func(*args, **kwargs)
>>> File "/usr/local/lib/python2.7/**dist-packages/django/utils/**decorators.py"
>>> in _wrapped_view
>>>   91. response = view_func(request, *args, **kwargs)
>>> File "/usr/local/lib/python2.7/**dist-packages/django/utils/**decorators.py"
>>> in bound_func
>>>   21. return func(self, *args2, **kwargs2)
>>> File "/usr/local/lib/python2.7/**dist-packages/django/db/**transaction.py"
>>> in inner
>>>   223. return func(*args, **kwargs)
>>> File 
>>> "/usr/local/lib/python2.7/**dist-packages/django/contrib/**admin/options.py"
>>> in add_view
>>>   1009. self.log_addition(request, new_object)
>>> File 
>>> "/usr/local/lib/python2.7/**dist-packages/django/contrib/**admin/options.py"
>>> in log_addition
>>>   530. action_flag = ADDITION
>>> File 
>>> "/usr/local/lib/python2.7/**dist-packages/django/contrib/**admin/models.py"
>>> in log_action
>>>   18. e = self.model(None, None, user_id, content_type_id,
>>> smart_text(object_id), object_repr[:200], action_flag, change_message)
>>>
>>> Exception Type: TypeError at /admin/myapp/mymodel/add/
>>> Exception Value: 'NoneType' object has no attribute '__getitem__'
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users...@**googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>>
>>> Visit this group at 
>>> http://groups.google.com/**group/django-users
>>> .
>>> To view this discussion on the web visit https://groups.google.com/d/**
>>> msgid/django-users/**CAF1Wu3PHp7FM8yge3YLRQuMFaCw24**
>>> ENzTOuuhYmW54QADXRg%2BA%**40mail.gmail.com
>>> .
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out
>>> .
>>>
>>
>>  --
> You 

Re: Ubuntu, Postgres, and psycopg2.

2013-10-17 Thread Nigel Legg
Thanks Thomas, that worked, so some progress, but now when I do sudo pip
psycopg2, I get an error: Python.h not found -
In file included from psycopg/psycopgmodule.c:27:0:
./psycopg/psycopg.h:30:20: fatal error: Python.h: no such file or directory.
Should I be downloading and building the source?

Cheers, Nigel
07914 740972



On 17 October 2013 09:57, Thomas Orozco <tho...@orozco.fr> wrote:

> You need the Postgres client C headers to build psycopg2. Before running
> pip install psycopg2, run:
>
> sudo apt-get install libpq-dev
>
>
>
>
> On Thu, Oct 17, 2013 at 10:51 AM, Nigel Legg <nigel.l...@gmail.com> wrote:
>
>> I am not sure whether this is really a postgres issue or a python /
>> Django issue - please let me know if I should be posting this elsewhere.
>> I have installed Ubuntu 13.04, Postgres 9.1 and Django. (strangely, the
>> Ubuntu software centre says I have Python 3.3, but when I go into the
>> Python shell it says 2.7.4).
>> I followed the instructions on configuring Postgres from
>> http://blog.iiilx.com/programming/how-to-install-postgres-on-ubuntu-for-django/,
>> up to the point of adding a line to the pg_hba.conf file - Ubuntu would not
>> let me write to this.
>> When I tried to install psycopg2 (pip install psycopg2),  I got the
>> following error:
>>
>> ERROR: you need to install postgresql-server-dev-X.Y for building a
>> server side extension or libpq-dev for building a client-side application.
>>
>> What does this mean?  How do I proceed?
>>
>> Many thanks in advance for your help.
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/3b3fa90f-7602-40ff-ab79-55d70c3074f1%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMuNovQyS1jhWLieeZ-Etb%2Bfpp1%2B6iaSRTuf5hNxVFJQpC4fWw%40mail.gmail.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADeX7vwToyt8ze989WhUkmQ2nx0TwTqt8L7ibC3sHrGjZeRjBA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Ubuntu, Postgres, and psycopg2.

2013-10-17 Thread Nigel Legg
I am not sure whether this is really a postgres issue or a python / Django 
issue - please let me know if I should be posting this elsewhere.
I have installed Ubuntu 13.04, Postgres 9.1 and Django. (strangely, the 
Ubuntu software centre says I have Python 3.3, but when I go into the 
Python shell it says 2.7.4).  
I followed the instructions on configuring Postgres from 
http://blog.iiilx.com/programming/how-to-install-postgres-on-ubuntu-for-django/,
 
up to the point of adding a line to the pg_hba.conf file - Ubuntu would not 
let me write to this. 
When I tried to install psycopg2 (pip install psycopg2),  I got the 
following error:

ERROR: you need to install postgresql-server-dev-X.Y for building a server 
side extension or libpq-dev for building a client-side application. 

What does this mean?  How do I proceed? 

Many thanks in advance for your help.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3b3fa90f-7602-40ff-ab79-55d70c3074f1%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: New to Django

2013-10-16 Thread Nigel Legg
Yes - there is a section in the tutorials and documentation on connecting
to databases, including PostgreSQL.

Cheers, Nigel
07914 740972



On 16 October 2013 04:04, Bryan Kim Artificio
wrote:

> HI,
>
> good day!
>
> i would like to know id there's a way to connect the postgresSQL with
> django?
>
> regards,
>
> On Tuesday, October 15, 2013 1:55:01 PM UTC+8, Mahantesh U wrote:
>>
>> Hi All,
>>
>>   I am new to Django framework. I worked on Flask framework using python.
>> Please share the sites to learn Django easily.
>>
>> Thanks
>> Mahantesh
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d6099d99-2967-4686-b20a-7be9d2257327%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADeX7vxKFE1v%2BQUjRuMpPS5EKAnOb6-tPtq%3DrY4O25J28eubLg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: __unicode__() addition not working in basic poll application.

2013-10-09 Thread Nigel Legg
show us your code, and someone might show you where it is wrong, but the
tutorial is pretty clear on what you have to do.

Cheers, Nigel
07914 740972



On 8 October 2013 22:42, Brachamul  wrote:

> Could someone post what the entire "models.py" file should look like at
> this point?
> I don't think I have indendation problems, but I'm new to both Python &
> Django, so I can't be sure.
> Using Python 2.7.5 and Django 1.4.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8aa3f7ef-4252-494e-9334-9f40578a5e8e%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADeX7vzq-dPF8n_%2B%3Dz8ngndy_LcbGLiapd7ePn%2BT7Z76ng2sQQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How to Sign In as a admin or Staff in Django Site?

2013-10-08 Thread Nigel Legg
See the tutorial in the django documentation.

Cheers, Nigel
07914 740972



On 8 October 2013 18:31, Mamarth Briton  wrote:

> Hi,
>
>
>
> How to Sign In as a admin or Staff in Django Site? Dose anybody know about
> admin url creation?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/776fbe72-5fe0-429c-a91e-6089e7af6b3d%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADeX7vwJ84eBv%3DqhU_REGHT64u1jJSzvHZ8g5DidZLHXi3x_5w%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: PyCons in Africa

2013-10-04 Thread Nigel Legg
I have lived in both Zambia and Kenya, and have family in Zambia.  Bongo
Hive in Lusaka may be a good place to start (they are on twitter). I
haven't been there for more than five years, but would be interested in
getting involved in some way, time and work permitting.

Cheers, Nigel
07914 740972



On 4 October 2013 17:13, Daniele Procida  wrote:

> First of all, apologies if you have to read this more than once because of
> the cross-posting.
>
> I've had an idea brewing recently.
>
> I went to meet Professor Judith Hall this afternoon to talk about it.
> She's involved with http://medicine.cardiff.ac.uk/mothers-africa/(amongst 
> other things) and is working on a Cardiff University project which
> itself is part of
> http://wales.gov.uk/topics/health/improvement/index/grants/?lang=en
>
> Following that meeting, I bashed out:
> https://github.com/evildmp/pycons-in-africa/ - please take a look, and
> even better, let me know what you think, or make your own contribution to
> the document. I'll continue working on it myself.
>
> Thanks,
>
> Daniele
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/20131004161344.532752077%40smtpauth.cf.ac.uk
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADeX7vxnd6B_5%2BNzzXXwuubrs1%3D7K5g6d3uUu0%2ByJkQtUCemvg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


django-metrics-dashboard question.

2013-10-04 Thread Nigel Legg
I am looking for a solution..  I want to allow all users of my app to
create their own dashboards for each project, and for their clients to be
able to see only the dashboards they have permission to see.  I have looked
at django-metrics-dashboard (
https://github.com/bitmazk/django-metrics-dashboard), it appars that this
will only produce one dashboard per website, which is not what I am after,
and there does not seem to be another dashboard app for django.
So am I correct about the metrics dashboard, and is there another solution
available?

Many thanks, Cheers, Nigel

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADeX7vz52opk-FwFkuP9L1KPuF1uL%3Diy8DWiHnvtvhq5hcjJnQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: how start work in django after installation in ubuntu

2013-10-03 Thread Nigel Legg
work through the tutorial.

Cheers, Nigel
07914 740972



On 3 October 2013 13:28, jasvir sandhu  wrote:

>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/52759c02-31f1-4c94-a856-18375626d94d%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADeX7vwC2SY2P%2BgXBDu6KHxkPEU5ABiLDwMs9G5A7nV96Xkh5g%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: how to start learning Django in Windows Platform

2013-10-01 Thread Nigel Legg
The tutorial on the website.

Cheers, Nigel
07914 740972



On 1 October 2013 16:42, Ahsan Ahmad  wrote:

> Hi,
> This is Ahsan. and i am brand fresh programmer in Django. Please guide the
> easiest way to start learning Django.
>
> Thank You
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/a9a052f2-c437-48e9-b01a-078d9cb04b61%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADeX7vxao-SecLkjQLVOyTsMkKTpKDTULsdzzk7Gew0NbQYr%2BA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Bootstrap - django-bootstrap3 or django-crispy-forms

2013-09-27 Thread Nigel Legg
Thanks both.

Cheers, Nigel
07914 740972



On 27 September 2013 06:19, Lachlan Musicman <data...@gmail.com> wrote:

> this is probably the answer you want:
>
> http://stackoverflow.com/a/11795186
>
> L.
>
> On 27 September 2013 09:23, Sam Lai <samuel@gmail.com> wrote:
> > Yep.  django-bootstrap-* and django-crispy-forms only provide helpers
> > for outputting HTML with bootstrap CSS classes. Neither are really
> > necessary to use Bootstrap (just makes it slightly easier), which is
> > applied through HTML and CSS and Django doesn't place any restrictions
> > on how your HTML/CSS is structured.
> >
> > On 26 September 2013 22:53, Nigel Legg <nigel.l...@gmail.com> wrote:
> >> Hi, I've been looking into using Bootstap3 on the django app I'm
> working on.
> >> It seems you can do this with both django-bootstrap and crispy-forms.
> >> Am I right in thinking that django-bootstap allows you to use bootstrap
> >> across the whole site, while crispy forms is just for forms?  So you
> can use
> >> both together? Or am I missing something?
> >>
> >> Cheers, Nigel
> >> 07914 740972
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "Django users" group.
> >> To unsubscribe from this group and stop receiving emails from it, send
> an
> >> email to django-users+unsubscr...@googlegroups.com.
> >> To post to this group, send email to django-users@googlegroups.com.
> >> Visit this group at http://groups.google.com/group/django-users.
> >> For more options, visit https://groups.google.com/groups/opt_out.
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "Django users" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users+unsubscr...@googlegroups.com.
> > To post to this group, send email to django-users@googlegroups.com.
> > Visit this group at http://groups.google.com/group/django-users.
> > For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
> --
> Maya Otos (@maya_otos) tweeted at 9:27 PM on Tue, Jul 30, 2013:
> When you used to be punk, and now you are still punk but not as punk,
> are you post-punk or decaying punk or ex-punk or just not punk anymore
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Bootstrap - django-bootstrap3 or django-crispy-forms

2013-09-26 Thread Nigel Legg
Hi, I've been looking into using Bootstap3 on the django app I'm working
on.  It seems you can do this with both django-bootstrap and crispy-forms.
Am I right in thinking that django-bootstap allows you to use bootstrap
across the whole site, while crispy forms is just for forms?  So you can
use both together? Or am I missing something?

Cheers, Nigel
07914 740972

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Image Maps + Django

2013-09-19 Thread Nigel Legg
GeoDjango uses ESRI shape files in the example in the Djang documentation,
not Google maps?? (I don't want to use google maps either). To me it looks
ideal for your purpose

Cheers, Nigel
07914 740972



On 19 September 2013 10:50, +Emmanuel <eluse...@gmail.com> wrote:

> @Nigel,
> If I understand it well, GeoDjango seems to be for a more robust GIS
> application that utilizes Google Maps. In contrast, I want to use a simple
> image map with no Google Maps. Thanks
> On Tuesday, September 17, 2013 12:34:49 PM UTC+3, Nigel Legg wrote:
>>
>> Read the documentation on GeoDjango, it's all there
>>
>> Cheers, Nigel
>> 07914 740972
>>
>>
>>
>> On 17 September 2013 09:54, +Emmanuel <elus...@gmail.com> wrote:
>>
>>> I am intending to implement something similar to this:
>>> https://opendata.go.ke/**facet/counties<https://opendata.go.ke/facet/counties>
>>> That has been developed in Ruby on Rails. How does Django handle image
>>> maps? Are there any additional Python/ Django libraries I will require? Is
>>> there a specific approach (best practices) way of solving this?
>>> Thanks.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users...@**googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at 
>>> http://groups.google.com/**group/django-users<http://groups.google.com/group/django-users>
>>> .
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>> .
>>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Image Maps + Django

2013-09-17 Thread Nigel Legg
Read the documentation on GeoDjango, it's all there

Cheers, Nigel
07914 740972



On 17 September 2013 09:54, +Emmanuel  wrote:

> I am intending to implement something similar to this:
> https://opendata.go.ke/facet/counties
> That has been developed in Ruby on Rails. How does Django handle image
> maps? Are there any additional Python/ Django libraries I will require? Is
> there a specific approach (best practices) way of solving this?
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How do I create a standalone python application that uses the django environment (e.g. the ORM etc...)?

2013-09-16 Thread Nigel Legg
Shouldn't it be

   from django.db import models

??

Cheers, Nigel
07914 740972



On 16 September 2013 15:25, DJ-Tom  wrote:

> For reporting purposes I want to use List & Label from Combit. The
> web/online part is no big deal since the reporting module can be run
> without user interface (creating Excel or PDF files)
>
> But the actual form designer part that is used to define the report layout
> is a windows GUI application, so I would like to have a python file inside
> my Django app that I can call to start the designer part on my local
> machine.
>
> I have now read a bunch of descriptions on how to use Django in a
> standalone application but did not succeed so far in actually running my
> form designer.
>
> This is what I currently have, i tried to start this via "python
> formdesigner.py", after activating the correct virtualenv:
>
> from Tkinter import *
> from ctypes import *
> import django
> from models import *
>
> LL = windll.cmll18
>
> ### Declaration of application class omitted, this is plain python  
>
> app = Application()
> app.master.title("List & Label sample application")
> app.mainloop()
>
>
> Regardless what I try, I can't get the model class import to work.
>
> I also tried SET DJANGO_SETTINGS_MODULE=settings and project.settings and
> project.app.settings... nothing worked.
>
> thomas
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: form issue.

2013-09-13 Thread Nigel Legg
OK, thanks Daniel, putting blank = True and null = True has let me get
through that.  I used a standard model so I can change the field labels on
the form need to do some more reading I think.

Cheers, Nigel
07914 740972



On 13 September 2013 12:05, Nigel Legg <nigel.l...@gmail.com> wrote:

> So is blank = True and null = True in the model?
> What I have done is working fine in another form, so why is it not working
> here? 
>
> Cheers, Nigel
> 07914 740972
>
>
>
> On 13 September 2013 11:59, Daniel Roseman <dan...@roseman.org.uk> wrote:
>
>> On Friday, 13 September 2013 08:45:51 UTC+1, Nigel Legg wrote:
>>
>>> I have a form with a lot of fields in it.  Users will never require data
>>> in all fields, so most have the required = False tag:
>>>  
>>>
>>> [This is a good example of how the for would be used]
>>>
>>> When I submit the form, I get the error "vChoice1_score cannot be null."
>>> I thought that required = False would allow that?
>>> Am I doing something wrong here?
>>>
>>> Cheers, Nigel
>>> 07914 740972
>>>
>>>
>> Well, you're doing quite a lot of things wrong here. In particular,
>> you're using a plain Form instead of a ModelForm, which means you have to
>> define and all the fields manually and then copy them over to the model
>> object, when you could just call form.save() to do it automatically with a
>> ModelForm.
>>
>> But the main issue is that you have not declared any of your model fields
>> as null=True, so the database will be expecting value. Again, declare all
>> the fields as blank=True and the integerfields as null=True as well, then
>> define a simple modelform without overriding any of the fields, and your
>> app will work with about a third of the code.
>>
>> --
>> DR.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: form issue.

2013-09-13 Thread Nigel Legg
So is blank = True and null = True in the model?
What I have done is working fine in another form, so why is it not working
here? 

Cheers, Nigel
07914 740972



On 13 September 2013 11:59, Daniel Roseman <dan...@roseman.org.uk> wrote:

> On Friday, 13 September 2013 08:45:51 UTC+1, Nigel Legg wrote:
>
>> I have a form with a lot of fields in it.  Users will never require data
>> in all fields, so most have the required = False tag:
>> 
>>
>> [This is a good example of how the for would be used]
>>
>> When I submit the form, I get the error "vChoice1_score cannot be null."
>> I thought that required = False would allow that?
>> Am I doing something wrong here?
>>
>> Cheers, Nigel
>> 07914 740972
>>
>>
> Well, you're doing quite a lot of things wrong here. In particular, you're
> using a plain Form instead of a ModelForm, which means you have to define
> and all the fields manually and then copy them over to the model object,
> when you could just call form.save() to do it automatically with a
> ModelForm.
>
> But the main issue is that you have not declared any of your model fields
> as null=True, so the database will be expecting value. Again, declare all
> the fields as blank=True and the integerfields as null=True as well, then
> define a simple modelform without overriding any of the fields, and your
> app will work with about a third of the code.
>
> --
> DR.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: form issue.

2013-09-13 Thread Nigel Legg
Declared where as NULL fields? in the view, the model, the form?  Where?
In another form the required=False is working, I don't know why it is not
here.

Cheers, Nigel
07914 740972



On 13 September 2013 11:55, MikeKJ  wrote:

> Check that the fields in the database are declared as NULL fields
>
>   --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


form issue.

2013-09-13 Thread Nigel Legg
I have a form with a lot of fields in it.  Users will never require data in
all fields, so most have the required = False tag:

model:
class EditStruct(models.Model):
varName = models.CharField(max_length=50)
varOrder = models.IntegerField()
varLabel = models.CharField(max_length=200)
varType = models.CharField(max_length=20)
vChoice1_text = models.CharField(max_length=200)
vChoice1_code = models.IntegerField()
vChoice1_score = models.IntegerField()
vChoice2_text = models.CharField(max_length=200)
vChoice2_code = models.IntegerField()
vChoice2_score = models.IntegerField()
vChoice3_text = models.CharField(max_length=200)
vChoice3_code = models.IntegerField()
vChoice3_score = models.IntegerField()
vChoice4_text = models.CharField(max_length=200)
vChoice4_code = models.IntegerField()
vChoice4_score = models.IntegerField()
vChoice5_text = models.CharField(max_length=200)
vChoice5_code = models.IntegerField()
vChoice5_score = models.IntegerField()
vChoice6_text = models.CharField(max_length=200)
vChoice6_code = models.IntegerField()
vChoice6_score = models.IntegerField()
vChoice7_text = models.CharField(max_length=200)
vChoice7_code = models.IntegerField()
vChoice7_score = models.IntegerField()
vChoice8_text = models.CharField(max_length=200)
vChoice8_code = models.IntegerField()
vChoice8_score = models.IntegerField()
vChoice9_text = models.CharField(max_length=200)
vChoice9_code = models.IntegerField()
vChoice9_score = models.IntegerField()
vChoice0_text = models.CharField(max_length=200)
vChoice0_code = models.IntegerField()
vChoice0_score = models.IntegerField()
EditData_id = models.ForeignKey(EditData)

view:
def editstruct(request):
user = User.objects.get(pk=request.session['user.id'])
if request.method == 'POST':
form = EditStructForm(request.POST)
if form.is_valid():
edstruct = EditStruct()
edstruct.varName = form.cleaned_data['varName']
edstruct.varLabel = form.cleaned_data['varLabel']
edstruct.varType = form.cleaned_data['varType']
edstruct.vChoice1_text = form.cleaned_data['vChoice1_text']
edstruct.vChoice1_code = form.cleaned_data['vChoice1_code']
edstruct.vChoice1_score = form.cleaned_data['vChoice1_score']
edstruct.vChoice2_text = form.cleaned_data['vChoice2_text']
edstruct.vChoice2_code = form.cleaned_data['vChoice2_code']
edstruct.vChoice2_score = form.cleaned_data['vChoice2_score']
edstruct.vChoice3_text = form.cleaned_data['vChoice3_text']
edstruct.vChoice3_code = form.cleaned_data['vChoice3_code']
edstruct.vChoice3_score = form.cleaned_data['vChoice3_score']
edstruct.vChoice4_text = form.cleaned_data['vChoice4_text']
edstruct.vChoice4_code = form.cleaned_data['vChoice4_code']
edstruct.vChoice4_score = form.cleaned_data['vChoice4_score']
edstruct.vChoice5_text = form.cleaned_data['vChoice5_text']
edstruct.vChoice5_code = form.cleaned_data['vChoice5_code']
edstruct.vChoice5_score = form.cleaned_data['vChoice5_score']
edstruct.vChoice6_text = form.cleaned_data['vChoice6_text']
edstruct.vChoice6_code = form.cleaned_data['vChoice6_code']
edstruct.vChoice6_score = form.cleaned_data['vChoice6_score']
edstruct.vChoice7_text = form.cleaned_data['vChoice7_text']
edstruct.vChoice7_code = form.cleaned_data['vChoice7_code']
edstruct.vChoice7_score = form.cleaned_data['vChoice7_score']
edstruct.vChoice8_text = form.cleaned_data['vChoice8_text']
edstruct.vChoice8_code = form.cleaned_data['vChoice8_code']
edstruct.vChoice8_score = form.cleaned_data['vChoice8_score']
edstruct.vChoice9_text = form.cleaned_data['vChoice9_text']
edstruct.vChoice9_code = form.cleaned_data['vChoice9_code']
edstruct.vChoice9_score = form.cleaned_data['vChoice9_score']
edstruct.vChoice0_text = form.cleaned_data['vChoice0_text']
edstruct.vChoice0_code = form.cleaned_data['vChoice0_code']
edstruct.vChoice0_score = form.cleaned_data['vChoice0_score']
struct = str(request.session['structfile'])
labellist = Get_labels(struct)
x = len(labellist)-1
y = labellist[x][0]
edstruct.varOrder = y
edstruct.user_id = user
edstruct.save()
strfile = open(get_file(struct))
text = strfile.read()
newvar = ritenewvar(edstruct)
out =
open('c:\\stats_portal\\myproject\\myproject\\media'+struct, 'w')
out.write(text)
out.write(newvar)
out.close()
return
HttpResponseRedirect(reverse('myproject.myapp.views.eitstruct'))
  

Re: Login not working.

2013-09-06 Thread Nigel Legg
I have removed the form.is_valid check and renamed the view, this now works
(except for not directing to the correct page, it does appear to be logging
in now)
Thanks!

Cheers, Nigel
07914 740972



On 6 September 2013 14:35, Nigel Legg <nigel.l...@gmail.com> wrote:

> I am using django.contrib.auth, and have created the folowing:
>
> view:
> def login(request):
> if request.method == 'POST':
> form = AuthenticationForm(request.POST)
> if form.is_valid():
> username = request.POST['username']
> password = request.POST['password']
> user = authenticate(username=username, password=password)
> if user is not None:
> login(request, user)
> if login == True:
> return render_to_response('myapp/list.html')
> else:
> error = 'Disabled account. Pay your bill!!'
> return render_to_response('auth/login.html',
> {'form': form, 'error': error },
> context_instance=RequestContext(request)
> )
> else:
> error = 'invalid login...'
> return render_to_response('auth/login.html',
> {'form': form, 'error': error },
> context_instance=RequestContext(request)
> )
> else:
> form = AuthenticationForm()
> return render_to_response(
> 'auth/login.html', {'form': form},
> context_instance=RequestContext(request)
> )
>
> template:
> 
>  
> 
>  enctype="multipart/formdata"> {% csrf_token %}
>  {{ error }} 
>  {{ form.username.label_tag }} {{ form.username }} 
>  {{ form.password.label_tag }} {{ form.password }} 
>   
> 
>
> When I go to the login page, and enter the user details, it returns with
> "invalid login", in other words it is failing the is_valid() check.  Am I
> missing something here?  I have checked through the documentation (django
> 1.5) and don't appear to be.
> Any help greatly appreciated.
>
> Cheers, Nigel
> 07914 740972
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Login not working.

2013-09-06 Thread Nigel Legg
I am using django.contrib.auth, and have created the folowing:

view:
def login(request):
if request.method == 'POST':
form = AuthenticationForm(request.POST)
if form.is_valid():
username = request.POST['username']
password = request.POST['password']
user = authenticate(username=username, password=password)
if user is not None:
login(request, user)
if login == True:
return render_to_response('myapp/list.html')
else:
error = 'Disabled account. Pay your bill!!'
return render_to_response('auth/login.html',
{'form': form, 'error': error },
context_instance=RequestContext(request)
)
else:
error = 'invalid login...'
return render_to_response('auth/login.html',
{'form': form, 'error': error },
context_instance=RequestContext(request)
)
else:
form = AuthenticationForm()
return render_to_response(
'auth/login.html', {'form': form},
context_instance=RequestContext(request)
)

template:

 

 {% csrf_token %}
 {{ error }} 
 {{ form.username.label_tag }} {{ form.username }} 
 {{ form.password.label_tag }} {{ form.password }} 
  


When I go to the login page, and enter the user details, it returns with
"invalid login", in other words it is failing the is_valid() check.  Am I
missing something here?  I have checked through the documentation (django
1.5) and don't appear to be.
Any help greatly appreciated.

Cheers, Nigel
07914 740972

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Using django.contrib.auth...

2013-08-21 Thread Nigel Legg
Thanks very much Laurent, I will have a go with that this morning. 
Regards, N/ 

On Monday, 19 August 2013 16:25:00 UTC+1, Laurent Meunier wrote:
>
> On 19/08/2013 17:05, Nigel Legg wrote: 
> > In the app I am building for data analysis, I want all logged in users 
> > to be able to access all parts of the system, but only to have access to 
> > the datafiles they hae uploaded themselves.  Can I use 
> > django.contrib.auth to filter the full list of datafiles according to 
> > the user object? 
> > If so, how do I go about this? I'm thinking of attaching a user_id field 
> > to the file when it is uploaded, and then filtering against that wen a 
> > logged in user goes to the list of files, but I'm not sure how I would 
> > implement this. 
> > Any help greatly appreciated. 
>
> Hi, 
>
> Your best option is to add a foreign key to your user model (usually 
> django.contrib.auth.models.User) in your model that handles your 
> datafiles. 
>
> from django.contrib.auth.models import User 
>
> class Datafile(models.Model): 
>  user = models.ForeignKey(User) 
>  ... 
>
>
> When a user upload a datafile, don't forget to set the user field: 
>
> mydatafile.user = request.user 
>
>
> And then you can filter datafiles: 
>
> Datafile.objects.filter(user=request.user) 
>
>
> -- 
> Laurent Meunier <lau...@deltalima.net > 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Using django.contrib.auth...

2013-08-19 Thread Nigel Legg
In the app I am building for data analysis, I want all logged in users to 
be able to access all parts of the system, but only to have access to the 
datafiles they hae uploaded themselves.  Can I use django.contrib.auth to 
filter the full list of datafiles according to the user object?  
If so, how do I go about this? I'm thinking of attaching a user_id field to 
the file when it is uploaded, and then filtering against that wen a logged 
in user goes to the list of files, but I'm not sure how I would implement 
this.
Any help greatly appreciated. 
Cheers, N/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Newbie: do I need to upload in order to access data?

2013-08-10 Thread Nigel Legg
The file is uploaded - ie it is copied onto the server drive.
I don't think you can do stuff client side with Django - beyond my
knowledge.

Regards,
Nigel Legg
07914 740972
http://www.trevanianlegg.co.uk
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 10 August 2013 18:04, Bob Aalsma <overhaalsgang_24_...@me.com> wrote:

> Thanks Nigel, this looks very promising ;)
>
> If I interpret your text correctly, this is based on the upload/save
> example I mentioned.
> I'm really interested in the meaning of parts your closing paragraph:
>
>- "This saves the file in 'media/documents/2013/08/10/**datafile.csv'."
>- I think this means the contents of the file is copied from the user disk
>to my disk, right?
>- "pointing them to the correct directory and file." - could I not
>simply point to the *original* directory and file (on the user's
>machine) and read the contents from that location?
>
>
> Regards,
> Bob
>
> Op zaterdag 10 augustus 2013 18:39:38 UTC+2 schreef Nigel Legg:
>>
>> I've based my process a minimal file upload - I think based on the answer
>> to the link above.  I use:
>> models.py:
>> class Document(models.Model):
>> docfile = models.FileField(upload_to='**documents/%Y/%m/%d')
>>
>> views.py:
>> def list(request):
>> # Handle file uploadf
>> if request.method == 'POST':
>> form = DocumentForm(request.POST, request.FILES)
>> if form.is_valid():
>> newdoc = Document(docfile = request.FILES['docfile'])
>> newdoc.save()
>>
>> # Redirect to the document list after POST
>> return HttpResponseRedirect(reverse('**
>> myproject.myapp.views.list'))
>> else:
>> form = DocumentForm() # A empty, unbound form
>>
>> # Load documents for the list page
>> documents = Document.objects.all()
>>
>> # Render list page with the documents and the form
>> return render_to_response(
>> 'myapp/list.html',
>> {'documents': documents, 'form': form},
>> context_instance=**RequestContext(request)
>> )
>>
>> forms.py:
>> class DocumentForm(forms.Form):
>> docfile = forms.FileField(
>> label='Select a file',
>> help_text='max. 42 megabytes'
>> )
>>
>> This saves the file in 'media/documents/2013/08/10/**datafile.csv'.  You
>> can then access this using the normal open() and read() functions, pointing
>> them to the correct directory and file.  As far as I can see, the data
>> remains in the file you upload, but the location and name are stored in the
>> database - in this case, "documents/2013/10/08/**datafile.csv".
>>
>> Hope this helps
>>
>> Regards,
>> Nigel Legg
>> 07914 740972
>> http://www.trevanianlegg.co.uk
>> http://twitter.com/nigellegg
>> http://uk.linkedin.com/in/**nigellegg<http://uk.linkedin.com/in/nigellegg>
>>
>>
>>
>> On 10 August 2013 15:52, Bob Aalsma <overhaalsg...@me.com> wrote:
>>
>>> Hi,
>>>
>>> I'm trying to achieve the following:
>>>
>>>- user indicates a file on his/her machine
>>>- the program opens the file, reads the data and acts on that
>>>
>>>
>>> So far, I can find examples of indicating the file on the user's
>>> machine, but this is always combined with saving to database (which I don't
>>> want); the clearest example I could find is http://stackoverflow.com/**
>>> questions/5871730/need-a-**minimal-django-file-upload-**example<http://stackoverflow.com/questions/5871730/need-a-minimal-django-file-upload-example>
>>>
>>> Question 1: is it really necessary to store the data in my database?
>>>
>>> If not, I've not been able to find how to actually open and read the
>>> file.
>>> I've been trying out variations on reading, based on what I could find
>>> in the Tutorials and Managing files (https://docs.djangoproject.**
>>> com/en/1.5/topics/files/<https://docs.djangoproject.com/en/1.5/topics/files/>)
>>>  but I don't seem to understand how to actually find the path and filename
>>> the user would have indicated. I seem to get completely lost in FileField
>>> and FieldFile and connected methods 
>>>
>>> Question 2: how do I find the indicated path and filename from the user?
>>>
>>> Regards,
>>> Bob
>>>
>>> --
>>> You received this message because you are su

Re: Newbie: do I need to upload in order to access data?

2013-08-10 Thread Nigel Legg
I've based my process a minimal file upload - I think based on the answer
to the link above.  I use:
models.py:
class Document(models.Model):
docfile = models.FileField(upload_to='documents/%Y/%m/%d')

views.py:
def list(request):
# Handle file uploadf
if request.method == 'POST':
form = DocumentForm(request.POST, request.FILES)
if form.is_valid():
newdoc = Document(docfile = request.FILES['docfile'])
newdoc.save()

# Redirect to the document list after POST
return
HttpResponseRedirect(reverse('myproject.myapp.views.list'))
else:
form = DocumentForm() # A empty, unbound form

# Load documents for the list page
documents = Document.objects.all()

# Render list page with the documents and the form
return render_to_response(
'myapp/list.html',
{'documents': documents, 'form': form},
context_instance=RequestContext(request)
)

forms.py:
class DocumentForm(forms.Form):
docfile = forms.FileField(
label='Select a file',
help_text='max. 42 megabytes'
)

This saves the file in 'media/documents/2013/08/10/datafile.csv'.  You can
then access this using the normal open() and read() functions, pointing
them to the correct directory and file.  As far as I can see, the data
remains in the file you upload, but the location and name are stored in the
database - in this case, "documents/2013/10/08/datafile.csv".

Hope this helps

Regards,
Nigel Legg
07914 740972
http://www.trevanianlegg.co.uk
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 10 August 2013 15:52, Bob Aalsma <overhaalsgang_24_...@me.com> wrote:

> Hi,
>
> I'm trying to achieve the following:
>
>- user indicates a file on his/her machine
>- the program opens the file, reads the data and acts on that
>
>
> So far, I can find examples of indicating the file on the user's machine,
> but this is always combined with saving to database (which I don't want);
> the clearest example I could find is
> http://stackoverflow.com/questions/5871730/need-a-minimal-django-file-upload-example
>
> Question 1: is it really necessary to store the data in my database?
>
> If not, I've not been able to find how to actually open and read the file.
> I've been trying out variations on reading, based on what I could find in
> the Tutorials and Managing files (
> https://docs.djangoproject.com/en/1.5/topics/files/ ) but I don't seem to
> understand how to actually find the path and filename the user would have
> indicated. I seem to get completely lost in FileField and FieldFile and
> connected methods 
>
> Question 2: how do I find the indicated path and filename from the user?
>
> Regards,
> Bob
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Avoiding huge IDs after deleting data

2013-08-06 Thread Nigel Legg
Two thoughts:
1.  If you are analysing tweets, why are you deleting on a daily basis?
Wouldn't a longer term view give you a better picture?
2.  Why not use the status_id field from the tweet as your id? The twitter
have the problem of dealing with it's size, and you will (should, or at
least could) be getting it in the JSON you download.

Regards,
Nigel Legg
07914 740972
http://www.trevanianlegg.co.uk
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 5 August 2013 23:37, Javier Guerra Giraldez <jav...@guerrag.com> wrote:

> On Mon, Aug 5, 2013 at 4:52 PM, Sean Whalen <whalens...@gmail.com> wrote:
> > How can the models be configured to use bigserial? I know I could convert
> > the tables myself, but that is not helpful for distributing the app.
>
>
> https://docs.djangoproject.com/en/1.5/ref/django-admin/#sqlcustom-appname-appname
>
> you can provide custom SQL commands that are executed right after
> table creation by syncdb.  in short, just add
> "/sql/.sql" or
> "/sql/..sql" files.
>
>
> i guess South also provides some way to express the same change as a
> migration.
>
> --
> Javier
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to check if DEBUG is True in template?

2013-08-05 Thread Nigel Legg
It i in settings.py, not in template.

Regards,
Nigel Legg
07914 740972
http://www.trevanianlegg.co.uk
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 5 August 2013 11:41, cui ye <darwi...@gmail.com> wrote:

> As title.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: PDF generator in Django

2013-08-05 Thread Nigel Legg
I'm currently looking at ReportLab following
https://docs.djangoproject.com/en/dev/howto/outputting-pdf/ - but open to
suggestions.

Regards,
Nigel Legg
07914 740972
http://www.trevanianlegg.co.uk
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 5 August 2013 07:48, navnath gadakh <navnathgad...@gmail.com> wrote:

> Which is best tool to generate PDF in python django
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: South with MySQL?

2013-08-01 Thread Nigel Legg
So is it something I have done wrong?  From what you are saying it has run
the migration but I am not seeing that - still getting errors when I try to
access the page.  If I do manag.py sql myapp I see the schema including the
new fields, but if I go into the shell, import the view, and do
DataTable.objects.all() I get "Unknown column 'myapp_datatable.type2stub'
in 'field list'".
So is there a way to resolve this without deleting the database and
starting again with one that does not have so many issues working with
South?

Regards,
Nigel Legg
07914 740972
http://www.trevanianlegg.co.uk
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 1 August 2013 10:46, Masklinn <maskl...@masklinn.net> wrote:

> On 2013-08-01, at 11:23 , Nigel Legg wrote:
> > So are you saying the migration wil or will not work with South using
> > MySQL??
>
> No. I'm saying if the migration fails the database will be left in an
> intermediate (and likely incorrect) state.
>
> > What do I have to do, in addition to everything in the South
> > documentation, in orde3r to make a South migration work with MySQL, given
> > what you have posted above?
>
> South *works* with mysql. But because of *mysql's limitations* if there
> is a problem while South is *modifying the database schema* (the DDL) it
> has no way to *rollback the changes*.
>
> That's what it tells you: if there is a a problem during the migration
> (because there's a bug in your migration), south *can not* put the
> database back in the state it was before you started the migration
> because mysql *does not provide the tools to do so*.
>
> It's not an incompatibility, it's mysql being a gigantic turd, no
> migration tool can fix that no matter how much they polish it.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: South with MySQL?

2013-08-01 Thread Nigel Legg
So are you saying the migration wil or will not work with South using
MySQL?? What do I have to do, in addition to everything in the South
documentation, in orde3r to make a South migration work with MySQL, given
what you have posted above?

Regards,
Nigel Legg
07914 740972
http://www.trevanianlegg.co.uk
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 1 August 2013 09:40, Masklinn <maskl...@masklinn.net> wrote:

> On 2013-08-01, at 10:09 , Nigel Legg wrote:
>
> > I tried to run a migration using south, and got the message:
> > "Since you have a database that does not support running schema-altering
> > statements in transactions, we have had to leave it in an interim state
> > between migrations."
> > Is this an incompatibility with MySQL, or because my DB is incorrectly
> > configured?  I have not seen in any of the South documentation that it
> can
> > not be used with MySQL.
> > Cheers, N//
>
> Please read the message. It doesn't note that South is *incompatible*
> with mysql, it notes that a failed migration will leave the database in
> an intermediate (broken) state.
>
> This is because MySQL does not implement transactional DDL[0]: table
> alterations are performed outside of transactions and thus can not be
> rollbacked (and will implicitly commit any pending transaction when
> using InnoDB). This by comparison to PostgreSQL, where pretty much all
> commands (including DDL) are executed in transaction and will be
> rollbacked with it (a quick search notes database and tablespace
> alterations are not transactional, 2-phase transactions obviously aren't
> either, and sequence operations don't rollback for different reasons).
>
> [0]
> http://wiki.postgresql.org/wiki/Transactional_DDL_in_PostgreSQL:_A_Competitive_Analysis#MySQL
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




South with MySQL?

2013-08-01 Thread Nigel Legg
I tried to run a migration using south, and got the message:
"Since you have a database that does not support running schema-altering
statements in transactions, we have had to leave it in an interim state
between migrations."
Is this an incompatibility with MySQL, or because my DB is incorrectly
configured?  I have not seen in any of the South documentation that it can
not be used with MySQL.
Cheers, N//

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Moving data in a browser.

2013-07-31 Thread Nigel Legg
The attached screenshot, simpletab, shows the simple cross tab I have
created using Django (my first functioning app).  This takes in a csv data
file and an xml definition file. The user selects the variables they want
to see, and the table is created.
My question is that the user may want to flip the table round, or add new
variables to the table.  I'd quite like to do this as a drag and drop
thing, would I have to do this using javascript or something else?  I
assume I can't use Django - am I wrong is thinking that?
Any suggestions of how to do that gratefully received
Thanks, N//

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


<>

Re: Error.

2013-07-27 Thread Nigel Legg
Running locally on windows7. Where would I find the logs?
On 27 Jul 2013 12:42, "Roberto López López" <roberto.lo...@uni.no> wrote:

>  Well, I suppose you are running that locally or have access to the
> server. So show the logs.
>
>
>
> On 07/27/2013 01:40 PM, Nigel Legg wrote:
>
> I have provided all the information I have. That's all there is on the
> screen in the browser. There is no trace.
> On 27 Jul 2013 12:26, "Roberto López López" <roberto.lo...@uni.no> wrote:
>
>>
>> Could be. But if you don't provide more information (i.e. detailed
>> information about how you get that error, error stacktrace, logs), you
>> won't get an answer.
>>
>>
>> On 07/27/2013 01:21 PM, Nigel Legg wrote:
>> > I've just set up a new view / url etc, which has quite a bit of
>> > processing behind it.  When I click on the link for it, I get the
>> > "Connecting" message for a few minutes, and then just "A server error
>> > has occurred. Please contact the administrator." appears.  Is this a
>> > time out message?
>> > Regards,
>> > Nigel Legg
>> > 07914 740972
>> > http://www.trevanianlegg.co.uk
>> > http://twitter.com/nigellegg
>> > http://uk.linkedin.com/in/nigellegg
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Django users" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an email to django-users+unsubscr...@googlegroups.com.
>> > To post to this group, send email to django-users@googlegroups.com.
>> > Visit this group at http://groups.google.com/group/django-users.
>> > For more options, visit https://groups.google.com/groups/opt_out.
>> >
>> >
>>
>>
>> --
>>
>> Roberto López López
>> System Developer
>> Parallab, Uni Computing
>> +47 55584091
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
> --
>
> Roberto López López
> System Developer
> Parallab, Uni Computing+47 55584091
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Error.

2013-07-27 Thread Nigel Legg
I have provided all the information I have. That's all there is on the
screen in the browser. There is no trace.
On 27 Jul 2013 12:26, "Roberto López López" <roberto.lo...@uni.no> wrote:

>
> Could be. But if you don't provide more information (i.e. detailed
> information about how you get that error, error stacktrace, logs), you
> won't get an answer.
>
>
> On 07/27/2013 01:21 PM, Nigel Legg wrote:
> > I've just set up a new view / url etc, which has quite a bit of
> > processing behind it.  When I click on the link for it, I get the
> > "Connecting" message for a few minutes, and then just "A server error
> > has occurred. Please contact the administrator." appears.  Is this a
> > time out message?
> > Regards,
> > Nigel Legg
> > 07914 740972
> > http://www.trevanianlegg.co.uk
> > http://twitter.com/nigellegg
> > http://uk.linkedin.com/in/nigellegg
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Django users" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> > an email to django-users+unsubscr...@googlegroups.com.
> > To post to this group, send email to django-users@googlegroups.com.
> > Visit this group at http://groups.google.com/group/django-users.
> > For more options, visit https://groups.google.com/groups/opt_out.
> >
> >
>
>
> --
>
> Roberto López López
> System Developer
> Parallab, Uni Computing
> +47 55584091
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Error.

2013-07-27 Thread Nigel Legg
I've just set up a new view / url etc, which has quite a bit of processing
behind it.  When I click on the link for it, I get the "Connecting" message
for a few minutes, and then just "A server error has occurred. Please
contact the administrator." appears.  Is this a time out message?
Regards,
Nigel Legg
07914 740972
http://www.trevanianlegg.co.uk
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Unable to open database.

2013-07-25 Thread Nigel Legg
So should I put
home/stats_portal/stats_/portal/myproject/myproject/database/sqlite3 ?
(settings.py in second myproject folder)
The database file name is sqlite3, this worked on Windows with no file
extension, does Linux require it?


Regards,
Nigel Legg
07914 740972
http://www.trevanianlegg.co.uk
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 25 July 2013 11:18, Gerald Klein <j...@zognet.com> wrote:

> It looks fine but that depends on your folder structure but this is
> showing "myproject" off the root of the file system, is that correct?
>
>
>
>
> On Thu, Jul 25, 2013 at 5:12 AM, Nigel Legg <nigel.l...@gmail.com> wrote:
>
>> I have just moved my project from Windows to Linux.  I have maintained
>> the folder structure, but am getting the message "Unable to open database
>> file - sqlite3".
>> Settings as follows:
>> DATABASES = {
>> 'default': {
>> 'ENGINE': 'django.db.backends.sqlite3',
>> 'NAME': '/myproject/database/sqlite3',
>> 'USER': '',
>> 'PASSWORD': '',
>> 'HOST': '',
>> 'PORT': '',
>> }
>> }
>> I'm very new at using Linux, is this a path definition error?
>>
>> Cheers,Nigel
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
>
> --
>
> Gerald Klein DBA
>
> contac...@geraldklein.com
>
> www.geraldklein.com <http://geraldklein.com/>
>
> geraldklein.wordpress.com
>
> j...@zognet.com
>
> 708-599-0352
>
>
> Arch Awesome, Ranger & Vim the coding triple threat.
>
> Linux registered user #548580
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Unable to open database.

2013-07-25 Thread Nigel Legg
I have just moved my project from Windows to Linux.  I have maintained the
folder structure, but am getting the message "Unable to open database file
- sqlite3".
Settings as follows:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': '/myproject/database/sqlite3',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
}
}
I'm very new at using Linux, is this a path definition error?

Cheers,Nigel

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Saving data from a form.

2013-07-22 Thread Nigel Legg
models.py:
class DataTable(models.Model):
datFile = models.CharField(max_length = 200)
structFile = models.CharField(max_length = 200)
bannerVar = models.CharField(max_length = 50)
stubVar = models.CharField(max_length = 50)
stubNets = models.BooleanField()

def __unicode__(self):
return u'%s %s %s %s' % (self.datFile, self.structFile,
self.bannerVar, self.stubVar)

forms.py:
class DataTableForm(forms.ModelForm):
class Meta:
model = DataTable

views.py:
def datatables(request):
if request.method == 'POST':
form = DataTableForm(request.POST)
if form.is_valid():
form.save()
DataTable_id = DataTable.id
return render(request, 'myapp/tabspec/{{DataTable_id}}.html', {
'DataTable_id' : DataTable.id,
})
else:
form = DataTableForm()
return render(request, 'myapp/datatables.html', {
'form': form,
})


When I input data on the form, and click "Confirm Selections", I get
"object DataTable has no attribute 'DataTable_id'"
Should I be using a different method to save the data from the form to the
database?


Regards,
Nigel Legg
07914 740972
http://www.trevanianlegg.co.uk
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Saving data from a form.

2013-07-22 Thread Nigel Legg
Thanks Christian. I'll get my head around this soon, I hope.

Regards,
Nigel Legg
07914 740972
http://www.trevanianlegg.co.uk
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 22 July 2013 14:53, Christian Erhardt <christian.erha...@mojo2k.de>wrote:

> The error lies in this two rows:
>
> form.save()
> DataTable_id = DataTable.id
>
> DataTable is the class, not the instance of the saved object! form.save()
> returns an instance of what has been saved. So your code should look like
> this:
>
> my_new_datatable_instance = form.save()
> DataTable_id = my_new_datatable_instance.id
>
> That should do the trick
>
>
> Am Montag, 22. Juli 2013 13:02:46 UTC+2 schrieb Nigel Legg:
>
>> models.py:
>> class DataTable(models.Model):
>> datFile = models.CharField(max_length = 200)
>> structFile = models.CharField(max_length = 200)
>> bannerVar = models.CharField(max_length = 50)
>> stubVar = models.CharField(max_length = 50)
>> stubNets = models.BooleanField()
>>
>> def __unicode__(self):
>> return u'%s %s %s %s' % (self.datFile, self.structFile,
>> self.bannerVar, self.stubVar)
>>
>> forms.py:
>> class DataTableForm(forms.ModelForm)**:
>> class Meta:
>> model = DataTable
>>
>> views.py:
>> def datatables(request):
>> if request.method == 'POST':
>> form = DataTableForm(request.POST)
>> if form.is_valid():
>> form.save()
>> DataTable_id = DataTable.id
>> return render(request, 'myapp/tabspec/{{DataTable_id}**}.html',
>> {
>> 'DataTable_id' : DataTable.id,
>> })
>> else:
>> form = DataTableForm()
>> return render(request, 'myapp/datatables.html', {
>> 'form': form,
>>     })
>>
>>
>> When I input data on the form, and click "Confirm Selections", I get
>> "object DataTable has no attribute 'DataTable_id'"
>> Should I be using a different method to save the data from the form to
>> the database?
>>
>>
>> Regards,
>> Nigel Legg
>> 07914 740972
>> http://www.trevanianlegg.co.uk
>> http://twitter.com/nigellegg
>> http://uk.linkedin.com/in/**nigellegg<http://uk.linkedin.com/in/nigellegg>
>>
>>   --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: greetings

2013-07-21 Thread Nigel Legg
SPAM

Regards,
Nigel Legg
07914 740972
http://www.trevanianlegg.co.uk
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 21 July 2013 17:52, Rene Vielma <renevie...@gmail.com> wrote:

>  http://shreeabhiramashram.in/tnq/ruyonteqffvvj
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>  renevielma
>
>
>
>
>
>
>
>
>
>
>
>  7/21/2013 5:51:51 PM
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Is Celery the best option?

2013-07-18 Thread Nigel Legg
I am working on using the DataSift api to collect social media posts as
part of my project.
I have a page which lists defined searches, and I want to be able to start
searches from here, and stop them when the user no longer requires them -
that is, the search should continue until it is stopped, even if the user
who has started it logs out - in fact, it will be most useful if it runs
continuously for more than a week.
I believe this needs an asynchronous task manager; would Celery be
appropriate for this task, both for starting and stopping the process?  And
secondly, can I set up and use Celery on Windows7 (which I am using for
development)?  Is there anything else that would be more appropriate?
Cheers, N//

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Reserved word issue?

2013-07-17 Thread Nigel Legg
I am working on integrating social search through the Datasift API into my
project.
The API gives a json object, and I have printed part of it out to the
screen, so I know that the link is working and I am receiving the right
stuff.  I now want to save some of the fields from the json to a model.
models.py:
class SearchResult(models.Model):
sm_User = models.CharField(max_length = 100)
sm_Name = models.CharField(max_length = 100)
sm_created_at = models.CharField(max_length = 100)
sm_content = models.CharField(max_length = 160)
sm_Source = models.CharField(max_length = 100)
sm_Link = models.CharField(max_length = 150)
sm_type = models.CharField(max_length = 50)

def __unicode__(self):
return self.sm_content

views.py
def runsearch(request, dSearch_id):
search = dSearch.objects.get(pk = dSearch_id)
search_name = str(search.dName)
search_keywords = str(search.dKeywords)
template = loader.get_template('myapp/runsearch.html')
results = SearchResult.objects.all()
if len(results)==0:
getinteractions.GetPosts(search_keywords)
results = SearchResult.objects.all()
context = Context({
'search_name': search_name,
'search_keywords': search_keywords,
})
return HttpResponse(template.render(context))

in getinteractiions.py:
def GetPosts(keyword):
user = datasift.User('nigellegg', '1d940b94903285ff73ba0dbe1b13a8a3')
csdl = 'interaction.content contains "football" and language.tag ==
"en"'
definition = user.create_definition(csdl)
consumer = definition.get_consumer(EventHandler(), 'http')
consumer.consume()
consumer.run_forever()

class EventHandler(datasift.StreamConsumerEventHandler):
def __init__(self):
self.num = 10

 def on_interaction(self, consumer, interaction, hash):
result = SearchResult()
result.sm_type = interaction['interaction']['type']
if interaction['interaction']['type']=='twitter':
result.sm_User =
interaction['interaction']['author']['username']
result.sm_Name = interaction['interaction']['author']['name']
result.sm_created_at = interaction['interaction']['created_at']
result.sm_content =
interaction['interaction']['content'].encode('ascii', 'replace')
result.sm_Source = interaction['interaction']['source']
result.sm_Link = interaction['interaction']['link']
result.save()
self.num -= 1
if self.num == 0:
#Stopping consumer...
consumer.stop()

The page shows ok in the browser, but there are no results.  Looking at the
server log (development server) I get
result.sm_Link = interaction['interaction']['link']
KeyError: 'link'

Is this a reserved name problem, or have I made another error? I'm not sure
I can change the field name, as that is how it came to me from datasift.
Many thanks in advance.
Nigel Legg
http://www.trevanianlegg.co.uk
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django Chartit Installed, How do I run the demo???

2013-07-17 Thread Nigel Legg
You need to include it as an app in a Django project.

Regards,
Nigel Legg
07914 740972
http://www.trevanianlegg.co.uk
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 17 July 2013 06:44, Tony Guilin <bajagui...@gmail.com> wrote:

> BTW, I'm using http://chartit.shutupandship.com/docs/#how-to-use
>
>
> On Tuesday, July 16, 2013 10:43:39 PM UTC-7, Tony Guilin wrote:
>>
>> I'm a complete noob.
>>
>> I've been able to go through the Djano tutorial with minimal issues.
>>
>> I successfully installed this according to:
>> Installation¶ <http://chartit.shutupandship.com/docs/#installation>
>>
>> You can install Django-Chartit from PyPI. Just do
>>
>> $ pip install django_chartit
>>
>> You also need supporting JavaScript libraries. See the Required
>> JavaScript 
>> Libraries<http://chartit.shutupandship.com/docs/#required-javascript-libraries>
>>  section
>> for more details.
>>
>>
>>
>> *Now what???*
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Unable to get python manage.py runserver to work

2013-07-12 Thread Nigel Legg
You need to create a project before you do anything. The docs and tutorials
show you how to so it .
On 12 Jul 2013 18:51, "Yves S. Garret"  wrote:

> On Friday, July 12, 2013 1:48:13 PM UTC-4, Yves S. Garret wrote:
>>
>>
>> On Friday, July 12, 2013 5:18:58 AM UTC-4, Tom Evans wrote:
>>>
>>> On Fri, Jul 12, 2013 at 4:01 AM, Yves S. Garret
>>>  wrote:
>>> > I was able to import django from inside of python 2.6.6 (which is what
>>> I'm
>>> > going with
>>> > at the moment).  However, when I try to display something in a
>>> browser, this
>>> > is the
>>> > problem that I'm getting:
>>> >
>>> > $ python /path/to/file/manage.py runserver
>>> > Traceback (most recent call last):
>>> >   File
>>> > "/home/azureuser/Downloads/**django/Django-1.5.1/django/**
>>> conf/project_template/manage.**py",
>>>
>>> You *MUST* install django before trying to use it.
>>> You will need to create a real project using django-admin.py, instead
>>> of trying to run manage.py from the application template stubs.
>>>
>>> Please take a look at the tutorial intro, which describes how to install
>>> django
>>>
>>> https://docs.djangoproject.**com/en/1.5/intro/install/
>>>
>>> Next, look at the tutorial itself, which describes how to start your
>>> first project.
>>>
>>> https://docs.djangoproject.**com/en/1.5/intro/tutorial01/
>>>
>>> These steps are not optional.
>>>
>>> Cheers
>>>
>>> Tom
>>>
>>
>> I have it down to this level, where I can import django from inside of
>> python:
>> $ python
>> Python 2.6.6 (r266:84292, Sep 11 2012, 08:34:23)
>> [GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>> import django
>> >>> print(django.get_version())
>> 1.5.1
>>
>
> Ultimately, this is what I'd like to have running on my machine.
>
>
> http://django-dynamic-scraper.readthedocs.org/en/latest/getting_started.html#installation
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Problem in uploading MultiValueDictKeyError

2013-07-09 Thread Nigel Legg
You have
*Csrf_token% {%}

*
shouldn't it be

*{% csrf_token %}*

???




Regards,
Nigel Legg
07914 740972
http://www.treavnianlegg.co.uk
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 9 July 2013 13:10, Hélio Miranda <helio...@gmail.com> wrote:

> Good!
> I'm having a strange problem, which is this, I have uploaded all ok and
> working.
> HTML:
> *  *
> **
> *   *
> *{% block title%} {% endblock%} *
> *   *
> *   *
> *{% Block content%} {% endblock%}*
> *  *
> *  Csrf_token% {%}*
> **
> *   Submittr>*
> *   *
> **
>
> Views:
> *def upload (request, id):*
> *
> *
> * if request.method == 'POST':*
> **
> * my_painting Movie.objects.get = (id = id)*
> **
> * files = []*
> * request.FILES.getlist for f in ('file'):*
> *mf = mongoengine.fields.GridFSProxy ()*
> *mf.put (f, filename = f.name)*
> *
> *
> *files.append (mf)*
> *my_painting.MovieCover = files*
> * my_painting.save ()*
> *
> *
> * return render_to_response ('upload.html', {},*
> *   context_instance = RequestContext
> (request))*
>
> But to put my code in the repository to my colleague interconnect
> interface, the pc it gives the following error:
> *MultiValueDictKeyError at / upload/51dbdc3efadcd20d8cad9249*
> 'Key' Legend 'not found in  [u'ttink2Z7gz3VXu1CwruYeZ2Cnq5x7uNy']}> "
>
> Does anyone know what could be?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django graphics

2013-07-09 Thread Nigel Legg
I was going to look at Django Chartit -
http://chartit.shutupandship.com/for this, unless anyone has better
suggestions?

Regards,
Nigel Legg
07914 740972
http://www.treavnianlegg.co.uk
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 9 July 2013 08:39, amanjot kaur <kauramanjo...@gmail.com> wrote:

> Please suggest me some module/library in django to plot graphs which
> takes input from user.
> --
> Amanjot Kaur
>
> Blog: kauramanjot35.wordpress.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: type object 'DataTable' has no attribute 'datFile'

2013-07-08 Thread Nigel Legg
Thanks Daniel.
Before trying that, I went nto the python shell, imported the DataTable
model, and tried DataTable.objects.all(), and got the error:
DatabaseError: no such column: myapp_datatable.datFile.
I tried re-running syncdb, but still get the same error. Am I using
reserved names here, or is there another issue with my code?  These are the
most logical names for what I am trying to do.
Many thanks in advance.

Regards,
Nigel Legg
07914 740972
http://www.treavnianlegg.co.uk
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 7 July 2013 18:27, Daniel Roseman <dan...@roseman.org.uk> wrote:

> On Saturday, 6 July 2013 12:07:34 UTC+1, Nigel Legg wrote:
>
>> I have the following code:
>> models.py:
>> class DataTable(models.Model):
>> datFile = models.CharField(max_length = 200)
>> structFile = models.CharField(max_length = 200)
>> bannerVar = models.CharField(max_length = 50)
>> stubVar = models.CharField(max_length = 50)
>> stubNets = models.BooleanField()
>>
>> def __unicode__(self):
>> return u'%s %s %s %s' % (self.datFile, self.structFile,
>> self.bannerVar, self.stubVar)
>>
>> forms.py:
>> class DataTableForm(forms.ModelForm)**:
>>
>> class Meta:
>>
>> model = DataTable
>>
>> views.py:
>> def datatables(request):
>> if request.method == 'POST':
>> form = DataTableForm(request.POST)
>> if form.is_valid():
>> form.save()
>> return redirect('myapp/tabspec.html')
>> else:
>> form = DataTableForm()
>> return render(request, 'myapp/datatables.html', {
>> 'form': form,
>> })
>>
>> def tabspec(request):
>> try:
>> datFile = DataTable.datFile
>> context = Context({
>> 'datFile': datFile,
>> })
>> except DataTable.DoesNotExist:
>> raise Http404
>> return HttpResponse(template.render(**context))
>>
>> The DataTable view shows, as a form; I enter the values for the ields,
>> when I click the button, I get the error "type object 'DataTable' has no
>> attribute 'datFile'".  I thought maybe I should be referring to
>> DataTableForm.datFile, but this gave the same error.
>> I am confused, could any one tell me where I am going wrong?
>> Regards,
>> Nigel Legg
>> 07914 740972
>> http://www.treavnianlegg.co.uk
>> http://twitter.com/nigellegg
>> http://uk.linkedin.com/in/**nigellegg<http://uk.linkedin.com/in/nigellegg>
>>
>>
> datFile (terrible name, by the way) is a field on a DataTable *instance*.
> You need to pass an ID value to the tabspec view (via the URL) from your
> form view, then use DataTable.objects.get(pk=id) in that tabspec view.
> --
> DR.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




type object 'DataTable' has no attribute 'datFile'

2013-07-06 Thread Nigel Legg
I have the following code:
models.py:
class DataTable(models.Model):
datFile = models.CharField(max_length = 200)
structFile = models.CharField(max_length = 200)
bannerVar = models.CharField(max_length = 50)
stubVar = models.CharField(max_length = 50)
stubNets = models.BooleanField()

def __unicode__(self):
return u'%s %s %s %s' % (self.datFile, self.structFile,
self.bannerVar, self.stubVar)

forms.py:
class DataTableForm(forms.ModelForm):

class Meta:

model = DataTable

views.py:
def datatables(request):
if request.method == 'POST':
form = DataTableForm(request.POST)
if form.is_valid():
form.save()
return redirect('myapp/tabspec.html')
else:
form = DataTableForm()
return render(request, 'myapp/datatables.html', {
'form': form,
})

def tabspec(request):
try:
datFile = DataTable.datFile
context = Context({
'datFile': datFile,
})
except DataTable.DoesNotExist:
raise Http404
return HttpResponse(template.render(context))

The DataTable view shows, as a form; I enter the values for the ields, when
I click the button, I get the error "type object 'DataTable' has no
attribute 'datFile'".  I thought maybe I should be referring to
DataTableForm.datFile, but this gave the same error.
I am confused, could any one tell me where I am going wrong?
Regards,
Nigel Legg
07914 740972
http://www.treavnianlegg.co.uk
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Error in Autoamation

2013-07-06 Thread Nigel Legg
Make sure the two variables you are trying to combine are the same
datatype.  This is in the python docs, and not a django problem.

Regards,
Nigel Legg
07914 740972
http://www.treavnianlegg.co.uk
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 6 July 2013 08:40, Harjot Mann <harjotmann1...@gmail.com> wrote:

> On Fri, Jul 5, 2013 at 4:46 PM, Nigel Legg <nigel.l...@gmail.com> wrote:
> > You can't combine int and unicode. Seems you are trying to.
>
> Yes I am adding int with another datatype. What should I do to remove
> this error?
>
>
> --
> Harjot Kaur Mann
> Blog: http://harjotmann.wordpress.com/
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Error in Autoamation

2013-07-05 Thread Nigel Legg
You can't combine int and unicode. Seems you are trying to.

Regards,
Nigel Legg
07914 740972
http://www.treavnianlegg.co.uk
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 5 July 2013 12:08, Harjot Mann <harjotmann1...@gmail.com> wrote:

> While generating bill an error is coming in automation software.
>
> TypeError at /tcc/jobok/
>
> unsupported operand type(s) for +: 'int' and 'unicode'
>
>
>
> --
> Harjot Kaur Mann
> Blog: http://harjotmann.wordpress.com/
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django-simple-multitenant

2013-07-04 Thread Nigel Legg
That's great, thanks Mario.  I will see how I get on with implementing it.
Thanks for your help.
N//

Regards,
Nigel Legg
07914 740972
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 4 July 2013 11:39, Mario Gudelj <mario.gud...@gmail.com> wrote:

> You sure can Nigel.
>
> Let's say you have a model called Notes, where users can enter their notes
> that they only can see.
>
> You add User model (in 1.4 from django.contrib.auth.models, in 1.5 same or
> you can extend AbstractUser) as a foreign key to Notices.
>
> Here's some info on FK
> https://docs.djangoproject.com/en/dev/ref/models/fields/#foreignkey
>
> When the user logs in you can obtain that user from "request.user", so
> when they create a Notice you save the user as a foreign key against the
> Notice.
>
> Then, when you're displaying the notices you simply use that in your
> queries e.g. Notice.objects.filter(user=request.user)
>
> I hope that makes sense.
>
> _M
>
>
>
>
> On 4 July 2013 15:59, Nigel Legg <nigel.l...@gmail.com> wrote:
>
>> Mario, I am not sure what you mean here.  I want users to be able to
>> upload data to the site, and do various things with it. I want each user to
>> only see the data they have uploaded.  Whether this is
>> domain.com/uer_account or user_account.domain.com I don't know, so long
>> as it provides the functionality I need. If I use the
>> domain,com/user_account, can I do that with the standard django auth system?
>>
>> Regards,
>> Nigel Legg
>> 07914 740972
>> http://twitter.com/nigellegg
>> http://uk.linkedin.com/in/nigellegg
>>
>>
>>
>> On 4 July 2013 00:36, Mario Gudelj <mario.gud...@gmail.com> wrote:
>>
>>> Depends what you need. Do you want to have users access data via
>>> www.domain.com/user_acccount/ or http://user_account.domain.com? If
>>> it's www.domain.com/user_acccount/ just foreign key your models to user
>>> model and in your queries always include user as a filter. The other option
>>> is somewhat harder.
>>>
>>> Cheers,
>>>
>>> _M
>>>
>>>
>>> On 3 July 2013 22:20, Nigel Legg <nigel.l...@gmail.com> wrote:
>>>
>>>> I am building an app to, among other things, allow people to upload
>>>> data files and carry out various analyses online.  I would like each user
>>>> to only see the datafiles that they or members of their team (company,
>>>> research team, etc) have uploaded.
>>>> It seems that 
>>>> django-simple-multitenant<https://github.com/pombredanne/django-simple-multitenant>would
>>>>  be appropriate for this.  Are there any problems in using this, or
>>>> other apps that would be easier to implement?
>>>> Cheers N//
>>>>
>>>> Regards,
>>>> Nigel Legg
>>>> 07914 740972
>>>> http://twitter.com/nigellegg
>>>> http://uk.linkedin.com/in/nigellegg
>>>>
>>>>  --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Django users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to django-users+unsubscr...@googlegroups.com.
>>>> To post to this group, send email to django-users@googlegroups.com.
>>>> Visit this group at http://groups.google.com/group/django-users.
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>
>>>>
>>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-users.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/op

Re: django-simple-multitenant

2013-07-04 Thread Nigel Legg
Mario, I am not sure what you mean here.  I want users to be able to upload
data to the site, and do various things with it. I want each user to only
see the data they have uploaded.  Whether this is domain.com/uer_account or
user_account.domain.com I don't know, so long as it provides the
functionality I need. If I use the domain,com/user_account, can I do that
with the standard django auth system?

Regards,
Nigel Legg
07914 740972
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 4 July 2013 00:36, Mario Gudelj <mario.gud...@gmail.com> wrote:

> Depends what you need. Do you want to have users access data via
> www.domain.com/user_acccount/ or http://user_account.domain.com? If it's
> www.domain.com/user_acccount/ just foreign key your models to user model
> and in your queries always include user as a filter. The other option is
> somewhat harder.
>
> Cheers,
>
> _M
>
>
> On 3 July 2013 22:20, Nigel Legg <nigel.l...@gmail.com> wrote:
>
>> I am building an app to, among other things, allow people to upload data
>> files and carry out various analyses online.  I would like each user to
>> only see the datafiles that they or members of their team (company,
>> research team, etc) have uploaded.
>> It seems that 
>> django-simple-multitenant<https://github.com/pombredanne/django-simple-multitenant>would
>>  be appropriate for this.  Are there any problems in using this, or
>> other apps that would be easier to implement?
>> Cheers N//
>>
>> Regards,
>> Nigel Legg
>> 07914 740972
>> http://twitter.com/nigellegg
>> http://uk.linkedin.com/in/nigellegg
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




django-simple-multitenant

2013-07-03 Thread Nigel Legg
I am building an app to, among other things, allow people to upload data
files and carry out various analyses online.  I would like each user to
only see the datafiles that they or members of their team (company,
research team, etc) have uploaded.
It seems that 
django-simple-multitenant<https://github.com/pombredanne/django-simple-multitenant>would
be appropriate for this.  Are there any problems in using this, or
other apps that would be easier to implement?
Cheers N//

Regards,
Nigel Legg
07914 740972
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Views, Forms not working.

2013-07-02 Thread Nigel Legg
Nick - I removed some irrelevant stuff earlier, and removed those tags by
mistake.
Cheers, N//

Regards,
Nigel Legg
07914 740972
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 1 July 2013 22:20, Nick Dokos <ndo...@gmail.com> wrote:

> Nigel Legg <nigel.l...@gmail.com> writes:
>
> > template datatables.html:
> > 
> > 
> > 
> > Make Tables
> > 
> > 
> >  enctype="multipart/formdata">{% csrf_token %}
> >
> >  {{ form.datFile.label_tag }} {{ form.datFile }}
> 
> >  {{ form.structFile.label_tag }} {{
> form.structFile }} 
> >  {{ form.bannerVar.label_tag}} {{ form.bannerVar
> }} 
> >  {{ form.stubVar.label_tag}} {{ form.stubVar }}
> 
> >  {{ form.stubNets.label_tag }} {{ form.stubNets
> }} 
> >
> >  />
> >
> > 
> > 
> >
>
> Nothing to do with the problem, so just an fyi:  and  are
> missing.
>
> --
> Nick
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Views, Forms not working.

2013-07-01 Thread Nigel Legg
Ah yes, thank you.

Regards,
Nigel Legg
07914 740972
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 1 July 2013 15:53, Mário Idival <marioidi...@gmail.com> wrote:

> Oh, but the url 'list'? remove the url 'list' of actions in forms
>
>
> 2013/7/1 Nigel Legg <nigel.l...@gmail.com>
>
>> Tried that, still going back to the index page.
>>
>> Regards,
>> Nigel Legg
>> 07914 740972
>> http://twitter.com/nigellegg
>> http://uk.linkedin.com/in/nigellegg
>>
>>
>>
>> On 1 July 2013 15:33, Mário Idival <marioidi...@gmail.com> wrote:
>>
>>> """
>>> form.is_valid():
>>> model_instance.save()
>>>
>>> """
>>>
>>> form.is_valid():
>>> form.save()
>>>
>>>
>>>
>>>
>>> 2013/7/1 Nigel Legg <nigel.l...@gmail.com>
>>>
>>>>  So I have:
>>>> views.py:
>>>> def datatables(request):
>>>> if request.method == 'POST':
>>>> form = DataTableForm(request.POST)
>>>> if form.is_valid():
>>>> model_instance.save()
>>>> return redirect('myapp/tabspec.html')
>>>> else:
>>>> form = DataTableForm()
>>>> return render(request, 'myapp/datatables.html', {
>>>> 'form': form,
>>>> })
>>>>
>>>> template datatables.html:
>>>> 
>>>> 
>>>> 
>>>> Make Tables
>>>> 
>>>> 
>>>> >>> enctype="multipart/formdata">{% csrf_token %}
>>>>
>>>>  {{ form.datFile.label_tag }} {{ form.datFile }} 
>>>>  {{ form.structFile.label_tag }} {{ form.structFile }} 
>>>>  {{ form.bannerVar.label_tag}} {{ form.bannerVar }} 
>>>>  {{ form.stubVar.label_tag}} {{ form.stubVar }} 
>>>>  {{ form.stubNets.label_tag }} {{ form.stubNets }} 
>>>>
>>>> 
>>>>
>>>> 
>>>> 
>>>>
>>>> models.py:
>>>> class DataTable(models.Model):
>>>> datFile = models.CharField(max_length = 200)
>>>> structFile = models.CharField(max_length = 200)
>>>> bannerVar = models.CharField(max_length = 50)
>>>> stubVar = models.CharField(max_length = 50)
>>>> stubNets = models.BooleanField()
>>>>
>>>> and forms.py:
>>>> class DataTableForm(forms.ModelForm):
>>>> class Meta:
>>>> model = DataTable
>>>>
>>>> The form shows fine (see image), but when I click the button it goes
>>>> back to the index page, which isn't what I wanted to happen.  Any thoughts
>>>> on where I am going wrong?
>>>> Cheers N //
>>>>
>>>> Regards,
>>>> Nigel Legg
>>>> 07914 740972
>>>> http://twitter.com/nigellegg
>>>> http://uk.linkedin.com/in/nigellegg
>>>>
>>>>  --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Django users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to django-users+unsubscr...@googlegroups.com.
>>>> To post to this group, send email to django-users@googlegroups.com.
>>>> Visit this group at http://groups.google.com/group/django-users.
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Mário Idival
>>>
>>> *Twitter *: *@marioigd*
>>> *Facebook*: *mario.idival*
>>> *User Linux : **#554446*
>>> Skype*: marioidival*
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-users.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> &quo

Re: Views, Forms not working.

2013-07-01 Thread Nigel Legg
Tried that, still going back to the index page.

Regards,
Nigel Legg
07914 740972
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 1 July 2013 15:33, Mário Idival <marioidi...@gmail.com> wrote:

> """
> form.is_valid():
> model_instance.save()
>
> """
>
> form.is_valid():
> form.save()
>
>
>
>
> 2013/7/1 Nigel Legg <nigel.l...@gmail.com>
>
>> So I have:
>> views.py:
>> def datatables(request):
>> if request.method == 'POST':
>> form = DataTableForm(request.POST)
>> if form.is_valid():
>> model_instance.save()
>> return redirect('myapp/tabspec.html')
>> else:
>> form = DataTableForm()
>> return render(request, 'myapp/datatables.html', {
>> 'form': form,
>> })
>>
>> template datatables.html:
>> 
>> 
>> 
>> Make Tables
>> 
>> 
>> > enctype="multipart/formdata">{% csrf_token %}
>>
>>  {{ form.datFile.label_tag }} {{ form.datFile }} 
>>  {{ form.structFile.label_tag }} {{ form.structFile }} 
>>  {{ form.bannerVar.label_tag}} {{ form.bannerVar }} 
>>  {{ form.stubVar.label_tag}} {{ form.stubVar }} 
>>  {{ form.stubNets.label_tag }} {{ form.stubNets }} 
>>
>> 
>>
>> 
>> 
>>
>> models.py:
>> class DataTable(models.Model):
>> datFile = models.CharField(max_length = 200)
>> structFile = models.CharField(max_length = 200)
>> bannerVar = models.CharField(max_length = 50)
>> stubVar = models.CharField(max_length = 50)
>> stubNets = models.BooleanField()
>>
>> and forms.py:
>> class DataTableForm(forms.ModelForm):
>> class Meta:
>> model = DataTable
>>
>> The form shows fine (see image), but when I click the button it goes back
>> to the index page, which isn't what I wanted to happen.  Any thoughts on
>> where I am going wrong?
>> Cheers N //
>>
>> Regards,
>> Nigel Legg
>> 07914 740972
>> http://twitter.com/nigellegg
>> http://uk.linkedin.com/in/nigellegg
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
>
> --
> Mário Idival
>
> *Twitter *: *@marioigd*
> *Facebook*: *mario.idival*
> *User Linux : **#554446*
> Skype*: marioidival*
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Views, Forms not working.

2013-07-01 Thread Nigel Legg
So I have:
views.py:
def datatables(request):
if request.method == 'POST':
form = DataTableForm(request.POST)
if form.is_valid():
model_instance.save()
return redirect('myapp/tabspec.html')
else:
form = DataTableForm()
return render(request, 'myapp/datatables.html', {
'form': form,
})

template datatables.html:



Make Tables


{% csrf_token %}

 {{ form.datFile.label_tag }} {{ form.datFile }} 
 {{ form.structFile.label_tag }} {{ form.structFile }} 
 {{ form.bannerVar.label_tag}} {{ form.bannerVar }} 
 {{ form.stubVar.label_tag}} {{ form.stubVar }} 
 {{ form.stubNets.label_tag }} {{ form.stubNets }} 






models.py:
class DataTable(models.Model):
datFile = models.CharField(max_length = 200)
structFile = models.CharField(max_length = 200)
bannerVar = models.CharField(max_length = 50)
stubVar = models.CharField(max_length = 50)
stubNets = models.BooleanField()

and forms.py:
class DataTableForm(forms.ModelForm):
class Meta:
model = DataTable

The form shows fine (see image), but when I click the button it goes back
to the index page, which isn't what I wanted to happen.  Any thoughts on
where I am going wrong?
Cheers N //

Regards,
Nigel Legg
07914 740972
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


<>

Re: embedding an HTML file.

2013-06-23 Thread Nigel Legg
Thanks Goran, that does exactly what I need.

Regards,
Nigel Legg
07914 740972
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 22 June 2013 15:42, Goran <thego...@gmail.com> wrote:

> Try to use "safe" filter in which case table will be interpreted as HTML
>
> {{ dftable|safe }} or as second solution, call dftable.allow_tags=True in
> the view.
>
>
> On Saturday, June 22, 2013 9:35:01 AM UTC+2, Nigel Legg wrote:
>>
>> I want to allow users to upload a file and then view the data from it.
>> So I have sorted out the file upload, and converting the file to a pandas
>> dataframe, and then creating an HTML table of df.head().  The template
>> looks like
>>
>> 
>>
>> 
>> 
>> 
>> File View
>> 
>>
>> 
>> File name: {{docfile_name}}
>>
>> {{dftable}}
>>
>> 
>> 
>> [dftable is the variable I used for writing the html to.
>> And the attached image shows how this looks on screen.
>> How can I get this HTML table to show on the web page?
>> Many thanks,
>>
>> Regards,
>> Nigel Legg
>> 07914 740972
>> http://twitter.com/nigellegg
>> http://uk.linkedin.com/in/**nigellegg<http://uk.linkedin.com/in/nigellegg>
>>
>>   --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: embedding an HTML file.

2013-06-22 Thread Nigel Legg
That would be unnecessarily complicated and time consuming
On 22 Jun 2013 21:30, "Javier Guerra Giraldez"  wrote:

> On Sat, Jun 22, 2013 at 9:42 AM, Goran  wrote:
> > Try to use "safe" filter in which case table will be interpreted as HTML
>
> or better, don't write html in Python.  collect and organize the data
> in the view functions/classes, and express into html in the template.
>
>
> --
> Javier
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: embedding an HTML file.

2013-06-22 Thread Nigel Legg
Thanks will try this.
On 22 Jun 2013 15:42, "Goran" <thego...@gmail.com> wrote:

> Try to use "safe" filter in which case table will be interpreted as HTML
>
> {{ dftable|safe }} or as second solution, call dftable.allow_tags=True in
> the view.
>
> On Saturday, June 22, 2013 9:35:01 AM UTC+2, Nigel Legg wrote:
>>
>> I want to allow users to upload a file and then view the data from it.
>> So I have sorted out the file upload, and converting the file to a pandas
>> dataframe, and then creating an HTML table of df.head().  The template
>> looks like
>>
>> 
>>
>> 
>> 
>> 
>> File View
>> 
>>
>> 
>> File name: {{docfile_name}}
>>
>> {{dftable}}
>>
>> 
>> 
>> [dftable is the variable I used for writing the html to.
>> And the attached image shows how this looks on screen.
>> How can I get this HTML table to show on the web page?
>> Many thanks,
>>
>> Regards,
>> Nigel Legg
>> 07914 740972
>> http://twitter.com/nigellegg
>> http://uk.linkedin.com/in/**nigellegg<http://uk.linkedin.com/in/nigellegg>
>>
>>   --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: File Path Question

2013-06-22 Thread Nigel Legg
MEDIA_ROOT = 'c:\\stats_portal\\myproject\\myproject\\media\\'

doesn't work.  I've parsed the path to get this working for the time being,
thanks for your help.

Regards,
Nigel Legg
07914 740972
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 21 June 2013 19:09, Jacky Tian <xjtia...@gmail.com> wrote:

> Have you set your MEDIA_ROOT appropriately in settings.py? Since
> fileview.py is where your original exception originated, can you post the
> relevant parts of the source in that file (whatever function line 5 belongs
> to). Did you get the exception under runserver or a "real" webserver?
>
> You shouldn't need to change the slashes in your path, Python handles that
> for you.
>
> -Jacky Tian
>
> On Friday, June 21, 2013 11:34:16 AM UTC-4, Nigel Legg wrote:
>
>> In the path shown in my previous email, documents is a subdirectory of
>> the media directory, which is set in settings.py.
>>
>> views.py:
>> from myproject.myapp.forms import DocumentForm
>>
>> def list(request):
>> # Handle file upload
>> if request.method == 'POST':
>> form = DocumentForm(request.POST, request.FILES)
>> if form.is_valid():
>> newdoc = Document(docfile = request.FILES['docfile'])
>> newdoc.save()
>>
>> # Redirect to the document list after POST
>> return HttpResponseRedirect(reverse('**
>> myproject.myapp.views.list'))
>> else:
>> form = DocumentForm() # A empty, unbound form
>>
>> # Load documents for the list page
>> documents = Document.objects.all()
>>
>> # Render list page with the documents and the form
>> return render_to_response(
>> 'myapp/list.html',
>> {'documents': documents, 'form': form},
>> context_instance=**RequestContext(request)
>> )
>>
>> models.py:
>> from django.db import models
>>
>> class Document(models.Model):
>> docfile = models.FileField(upload_to='**documents/%Y/%m/%d')
>>
>> this section works fine - ie files yesterday were uploaded to
>> c:\\\\myproject\\media\\**documents\\2013\\06\\20\\file.**csv.
>> I need now to be able to access them.  This error suggests I need to
>> convert  documents/%Y/%m/%d' to documents\\2013\\06\\20\\ to be able to do
>> so.  Is that correct?
>>
>> Regards,
>> Nigel Legg
>> 07914 740972
>> http://twitter.com/nigellegg
>> http://uk.linkedin.com/in/**nigellegg<http://uk.linkedin.com/in/nigellegg>
>>
>>
>>
>> On 21 June 2013 16:25, Jacky Tian <xjti...@gmail.com> wrote:
>>
>>> What does your project directory tree look like? I suspect the error has
>>> to do with where your documents/ directory is located in relation to the
>>> working directory. Try loading the document using a path relative to your
>>> project root.
>>>
>>> -Jacky Tian
>>>
>>>
>>>
>>> On Friday, June 21, 2013 9:29:20 AM UTC-4, Nigel Legg wrote:
>>>>
>>>> New to Django(ish).  I'm not sure whether my error is coding or OS
>>>> related:
>>>> I am getting the following error message:
>>>>
>>>> IOError at /myapp/file_view/4/
>>>>
>>>> [Errno 2] No such file or directory: 
>>>> 'documents/2013/06/20/**testdata**1.csv'
>>>>
>>>>  Request Method: GET  Request URL: http://127.0.0.1:8000/myapp/**fi**
>>>> le_view/4/ <http://127.0.0.1:8000/myapp/file_view/4/>  Django Version:
>>>> 1.5.1  Exception Type: IOError  Exception Value:
>>>>
>>>> [Errno 2] No such file or directory: 
>>>> 'documents/2013/06/20/**testdata**1.csv'
>>>>
>>>>  Exception Location: 
>>>> C:\stats_portal\myproject\**mypr**oject\myapp\fileview.py
>>>> in filedata, line 5  Python Executable: c:\python27\python.exe  Python
>>>> Version: 2.7.5  Python Path:
>>>>
>>>> ['C:\\stats_portal\\myproject',
>>>>  'c:\\python27\\lib\\site-**packa**ges\\python_dateutil-1.5-**py2.**7.egg',
>>>>  
>>>> 'c:\\python27\\lib\\site-**packa**ges\\django_directupload-**0.0.**11-py2.7.egg',
>>>>  'C:\\windows\\system32\\**python**27.zip',
>>>>  'c:\\python27\\DLLs',
>>>>  'c:\\python27\\lib',
>>>>  'c:\\python27\\lib\\plat-win',
>>>>  'c:\\python27\\lib\\lib-tk',
>>>>  'c:\\python27',
>>>>  'c:\\python27\\lib\\site-**packa**ges']
>>>>
>

Re: File Path Question

2013-06-21 Thread Nigel Legg
In the path shown in my previous email, documents is a subdirectory of the
media directory, which is set in settings.py.

views.py:
from myproject.myapp.forms import DocumentForm

def list(request):
# Handle file upload
if request.method == 'POST':
form = DocumentForm(request.POST, request.FILES)
if form.is_valid():
newdoc = Document(docfile = request.FILES['docfile'])
newdoc.save()

# Redirect to the document list after POST
return
HttpResponseRedirect(reverse('myproject.myapp.views.list'))
else:
form = DocumentForm() # A empty, unbound form

# Load documents for the list page
documents = Document.objects.all()

# Render list page with the documents and the form
return render_to_response(
'myapp/list.html',
{'documents': documents, 'form': form},
context_instance=RequestContext(request)
)

models.py:
from django.db import models

class Document(models.Model):
docfile = models.FileField(upload_to='documents/%Y/%m/%d')

this section works fine - ie files yesterday were uploaded to
c:\\\\myproject\\media\\documents\\2013\\06\\20\\file.csv.
I need now to be able to access them.  This error suggests I need to
convert  documents/%Y/%m/%d' to documents\\2013\\06\\20\\ to be able to do
so.  Is that correct?

Regards,
Nigel Legg
07914 740972
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 21 June 2013 16:25, Jacky Tian <xjtia...@gmail.com> wrote:

> What does your project directory tree look like? I suspect the error has
> to do with where your documents/ directory is located in relation to the
> working directory. Try loading the document using a path relative to your
> project root.
>
> -Jacky Tian
>
>
>
> On Friday, June 21, 2013 9:29:20 AM UTC-4, Nigel Legg wrote:
>>
>> New to Django(ish).  I'm not sure whether my error is coding or OS
>> related:
>> I am getting the following error message:
>>
>> IOError at /myapp/file_view/4/
>>
>> [Errno 2] No such file or directory: 'documents/2013/06/20/**testdata1.csv'
>>
>>  Request Method: GET  Request URL: http://127.0.0.1:8000/myapp/**
>> file_view/4/ <http://127.0.0.1:8000/myapp/file_view/4/>  Django Version:
>> 1.5.1  Exception Type: IOError  Exception Value:
>>
>> [Errno 2] No such file or directory: 'documents/2013/06/20/**testdata1.csv'
>>
>>  Exception Location: C:\stats_portal\myproject\**myproject\myapp\fileview.py
>> in filedata, line 5  Python Executable: c:\python27\python.exe  Python
>> Version: 2.7.5  Python Path:
>>
>> ['C:\\stats_portal\\myproject'**,
>>  'c:\\python27\\lib\\site-**packages\\python_dateutil-1.5-**py2.7.egg',
>>  
>> 'c:\\python27\\lib\\site-**packages\\django_directupload-**0.0.11-py2.7.egg',
>>  'C:\\windows\\system32\\**python27.zip',
>>  'c:\\python27\\DLLs',
>>  'c:\\python27\\lib',
>>  'c:\\python27\\lib\\plat-win',
>>  'c:\\python27\\lib\\lib-tk',
>>  'c:\\python27',
>>  'c:\\python27\\lib\\site-**packages']
>>
>>  Server time: Fri, 21 Jun 2013 14:09:20 +0100
>> Is the file not found problem because the upload has recorded it as
>> documents/2013/06/... even though I am working on Windows, so python /
>> django should have ... documents\\2013\\06\\... etc? I am developing on
>> Windows, but will deploy on Linux.
>> Or have I made an error elsewhere?
>>
>>
>> Regards,
>> Nigel Legg
>> 07914 740972
>> http://twitter.com/nigellegg
>> http://uk.linkedin.com/in/**nigellegg<http://uk.linkedin.com/in/nigellegg>
>>
>>   --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




File Path Question

2013-06-21 Thread Nigel Legg
New to Django(ish).  I'm not sure whether my error is coding or OS related:
I am getting the following error message:

IOError at /myapp/file_view/4/

[Errno 2] No such file or directory: 'documents/2013/06/20/testdata1.csv'

 Request Method: GET  Request URL:
http://127.0.0.1:8000/myapp/file_view/4/  Django
Version: 1.5.1  Exception Type: IOError  Exception Value:

[Errno 2] No such file or directory: 'documents/2013/06/20/testdata1.csv'

 Exception Location: C:\stats_portal\myproject\myproject\myapp\fileview.py
in filedata, line 5  Python Executable: c:\python27\python.exe  Python
Version: 2.7.5  Python Path:

['C:\\stats_portal\\myproject',
 'c:\\python27\\lib\\site-packages\\python_dateutil-1.5-py2.7.egg',
 'c:\\python27\\lib\\site-packages\\django_directupload-0.0.11-py2.7.egg',
 'C:\\windows\\system32\\python27.zip',
 'c:\\python27\\DLLs',
 'c:\\python27\\lib',
 'c:\\python27\\lib\\plat-win',
 'c:\\python27\\lib\\lib-tk',
 'c:\\python27',
 'c:\\python27\\lib\\site-packages']

 Server time: Fri, 21 Jun 2013 14:09:20 +0100
Is the file not found problem because the upload has recorded it as
documents/2013/06/... even though I am working on Windows, so python /
django should have ... documents\\2013\\06\\... etc? I am developing on
Windows, but will deploy on Linux.
Or have I made an error elsewhere?


Regards,
Nigel Legg
07914 740972
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: countries phone prefixes

2013-06-20 Thread Nigel Legg
That is cool. Nice one.

Regards,
Nigel Legg
07914 740972
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 20 June 2013 10:38, Roberto López López <roberto.lo...@uni.no> wrote:

>
> Ok, answering my own question: django-country-dialcode
>
>
>
> On 06/20/2013 11:35 AM, Roberto López López wrote:
> > Hi,
> >
> > I need a sort of prepopulated foreign key with countries and their phone
> > prefixes, to add to my models. Does anyone know any 3rd party package or
> > service providing this? Thanks.
> >
> > Cheers,
> >
> > Roberto
> >
>
>
> --
> Kind regards,
>
> Roberto López López
>
>
> System Developer
> Parallab, Uni Computing
> Høyteknologisenteret, Thormøhlensgate 55
> N-5008 Bergen, Norway
> Tel:(+47) 555 84091
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Model Error

2013-06-19 Thread Nigel Legg
Thank you.  Not seeing it for staring at it for too long.

Regards,
Nigel Legg
07914 740972
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 19 June 2013 07:53, <jirka.vejra...@gmail.com> wrote:

> **
> Hi Nigel,
>
> You have a spelling error in the word "unicode" in the TextFile method.
>
> Cheers
>
> Jirka
> --
> *From: * Nigel Legg <nigel.l...@gmail.com>
> *Sender: * django-users@googlegroups.com
> *Date: *Wed, 19 Jun 2013 06:51:21 +0100
> *To: *<django-users@googlegroups.com>
> *ReplyTo: * django-users@googlegroups.com
> *Subject: *Model Error
>
> I have been working through the tutorial, "Writing your first Django app,
> part 1", at https://docs.djangoproject.com/en/1.5/intro/tutorial01/. I
> have the following model code:
>
> from django.db import models
> import datetime
> from django.utils import timezone
>
> class TextFile(models.Model):
> tfile = models.CharField(max_length = 50)
> filetype = models.CharField(max_length = 50)
> up_date = models.DateTimeField('date_uploaded')
>
> def __unicde__(self):
> return self.tfile
>
> def was_uploaded_recently(self):
> return self.up_date>= timezone.now() - datetme.timedelta(days=1)
>
> class Bitext_upd(models.Model):
> tFile = models.ForeignKey(TextFile)
> bitext_file = models.CharField(max_length = 50)
> Bit_up_date = models.DateTimeField('date_analysed')
>
> def __unicode__(self):
> return self.bitext_file
>
> However in the shell I am still getting:
> >>> from apilink.models import TextFile
> >>> TextFile.object.all()
> [, ]
>
> ... when there are two files added.
> In the admin interface, I have a list of two "TextFile objects" (see
> image), if I edit them I can see the details.
>
> I am a bit lost as to where the error is, can anyone help?
> Many thanks.
>
> Regards,
> Nigel Legg
> 07914 740972
> http://twitter.com/nigellegg
> http://uk.linkedin.com/in/nigellegg
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Model Error

2013-06-18 Thread Nigel Legg
I have been working through the tutorial, "Writing your first Django app,
part 1", at https://docs.djangoproject.com/en/1.5/intro/tutorial01/. I have
the following model code:

from django.db import models
import datetime
from django.utils import timezone

class TextFile(models.Model):
tfile = models.CharField(max_length = 50)
filetype = models.CharField(max_length = 50)
up_date = models.DateTimeField('date_uploaded')

def __unicde__(self):
return self.tfile

def was_uploaded_recently(self):
return self.up_date>= timezone.now() - datetme.timedelta(days=1)

class Bitext_upd(models.Model):
tFile = models.ForeignKey(TextFile)
bitext_file = models.CharField(max_length = 50)
Bit_up_date = models.DateTimeField('date_analysed')

def __unicode__(self):
return self.bitext_file

However in the shell I am still getting:
>>> from apilink.models import TextFile
>>> TextFile.object.all()
[, ]

... when there are two files added.
In the admin interface, I have a list of two "TextFile objects" (see
image), if I edit them I can see the details.

I am a bit lost as to where the error is, can anyone help?
Many thanks.

Regards,
Nigel Legg
07914 740972
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Unable to locate django-admin.py

2013-06-08 Thread Nigel Legg
on my set up (windows) it is in
c:\python27\Lib\site-packages\django\bin\.


Regards,
Nigel Legg
07913 740972
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 8 June 2013 13:36, Satinderjit Singh <satinderjit2...@gmail.com> wrote:

> I am beginner and trying to get start new project according to manual
> I had installed the latest version of Django and currently using ubuntu
> 13.04 .
> When i try to run django-admin.py startproject mysite
>
> Terminal shows this error:
> ~$ django-admin.py startproject mysite
> django-admin.py: command not found
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: (error) tutorial 2: local admin page not working

2013-06-01 Thread Nigel Legg
Doesn't what you have posted tell you enough of what you need to do?

Regards,
Nigel Legg
07722 652866
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 1 June 2013 00:20, Issam Laradji <issamo...@gmail.com> wrote:

> After setting up the database using the command:
>
> "python manage.py syncdb"
>
> I ran "python manage.py runserver" to launch the server
>
> But then when I try open the admin page " http://127.0.0.1:8000/admin/;
>
> I keep getting this error,
>
>
> Of course, you haven't actually done any work yet. Here's what to do next:
>
>- If you plan to use a database, edit the DATABASES setting in
>mysite/settings.py.
>- Start your first app by running python manage.py startapp [appname].
>
> You're seeing this message because you have DEBUG = True in your Django
> settings file and you haven't configured any URLs. Get to work!
>
>
> Thanks in advance...
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: site critique

2013-05-22 Thread Nigel Legg
Ah yes. main site home page has a variety of font sizes which looks a
bit odd.

Regards,
Nigel Legg
07722 652866
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 22 May 2013 22:59, Nikolas Stevenson-Molnar <nik.mol...@consbio.org>wrote:

>  The link is actually to an admin page.
>
> _Nik
>
>
> On 5/22/2013 2:53 PM, Nigel Legg wrote:
>
> Site is asking for a username and password, so I can't look at it.
>
>  Regards,
> Nigel Legg
> 07722 652866
> http://twitter.com/nigellegg
> http://uk.linkedin.com/in/nigellegg
>
>
>
> On 22 May 2013 14:24, frocco <faro...@gmail.com> wrote:
>
>> Hi Every one,
>>
>>  I have my PHP site up and running that I converted to django.
>> Would you have a look at this production site and let me know your
>> opinions?
>>
>>  Current users are very fussy and resist change.
>>
>>  http://ntwarehouse.net<http://ntwarehouse.net/adminsite/search/searchterm/>
>>
>>
>>  One problem I have is SEO is not working correctly.
>> If I search on TIRES, my site does not show.
>>
>>  I am new to SEO, and have having a hard time trying to figure out what
>> needs to be done.
>>
>>  Thanks
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: site critique

2013-05-22 Thread Nigel Legg
Site is asking for a username and password, so I can't look at it.

Regards,
Nigel Legg
07722 652866
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 22 May 2013 14:24, frocco <faro...@gmail.com> wrote:

> Hi Every one,
>
> I have my PHP site up and running that I converted to django.
> Would you have a look at this production site and let me know your
> opinions?
>
> Current users are very fussy and resist change.
>
> http://ntwarehouse.net<http://ntwarehouse.net/adminsite/search/searchterm/>
>
>
> One problem I have is SEO is not working correctly.
> If I search on TIRES, my site does not show.
>
> I am new to SEO, and have having a hard time trying to figure out what
> needs to be done.
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: New user - template errors.

2013-05-22 Thread Nigel Legg
Cool, thanks.  And sorry - I should have gone there first.

Regards,
Nigel Legg
07722 652866
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 22 May 2013 17:01, Michael <mich...@d3i.com> wrote:

> Hi Nigel, take a look at these, they might provide some answers:
>
>
> http://stackoverflow.com/questions/14892462/django-error-upolls-is-not-a-registered-namespace
>
>
> http://stackoverflow.com/questions/16049972/django-tutorial-04-noreversematch-at-polls-1-upolls-is-not-a-registered-na
>
>
> On Wednesday, 22 May 2013 11:10:02 UTC+1, Nigel Legg wrote:
>>
>> Morning/Afternoon - I am new to django, and I have been working through
>> the tutorial.  I have reached Tutorial 4, https://docs.djangoproject.**
>> com/en/1.5/intro/tutorial04/<https://docs.djangoproject.com/en/1.5/intro/tutorial04/>,
>> which is about getting the voting on the polls app to work, but when I set
>> detail.html I get an error, "
>> NoReverseMatch at /polls/2/
>>
>> u'polls' is not a registered namespace
>>
>> What would cause that?
>>
>> Many thanks.
>>
>> Regards,
>> Nigel Legg
>> 07722 652866
>> http://twitter.com/nigellegg
>> http://uk.linkedin.com/in/**nigellegg<http://uk.linkedin.com/in/nigellegg>
>>
>>   --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




New user - template errors.

2013-05-22 Thread Nigel Legg
Morning/Afternoon - I am new to django, and I have been working through the
tutorial.  I have reached Tutorial 4,
https://docs.djangoproject.com/en/1.5/intro/tutorial04/, which is about
getting the voting on the polls app to work, but when I set detail.html I
get an error, "
NoReverseMatch at /polls/2/

u'polls' is not a registered namespace

What would cause that?

Many thanks.

Regards,
Nigel Legg
07722 652866
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.