Re: Is there an HTML editor that's Django-aware

2011-05-30 Thread BobX
Again, thanks to everyone who took the time out of their schedules to
jot down a quick reply to my question. I'll go away and try some of
the apps suggested. :D

If anyone from the Django Project itself is listening then can I (very
humbly) suggest that some editor recommendations would make a real
fine addition to the info on the site (useful to n00b's like me
anyway).

On May 20, 10:54 am, BobX <blueb...@gmail.com> wrote:
> Pretty obvious question, but is there any recommended HTML editor that
> won't munch the Django template codes? I was using Amaya to form my
> pages, but after a couple of what-the-heck moments, I discovered that
> it sporadically "eats" the template codes - ones in table definitions
> being particularly vulnerable.
>
> Notepad2 is very usable - but unfortunately that's just syntax
> highlighting the raw HTML codes. So at the moment I'm generating the
> templates with Amaya and then switching to Notepad2 once the template
> codes are added.

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



Is there an HTML editor that's Django-aware

2011-05-20 Thread BobX
Pretty obvious question, but is there any recommended HTML editor that
won't munch the Django template codes? I was using Amaya to form my
pages, but after a couple of what-the-heck moments, I discovered that
it sporadically "eats" the template codes - ones in table definitions
being particularly vulnerable.

Notepad2 is very usable - but unfortunately that's just syntax
highlighting the raw HTML codes. So at the moment I'm generating the
templates with Amaya and then switching to Notepad2 once the template
codes are added.

I've also got SeaMonkey but haven't had a chance to try it yet.
Platforms I've got available are Linux or Windows.

Thanks. Bob.

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



Advice needed: more advanced user capability

2011-05-20 Thread BobX
Got a question about my Django development that I'd appreciate some
sage "best practices" advice on.

My Django app needs more user capability than is available in the
default middleware. Specificially I need to be able to:
o "age" passwords;
o do checks on validity of new passwords - make sure they're not
reused, are greater than a minimum length and are "strong";
o lock out accounts after a certain number of failed attempts;
o have a capability like the "roles" or "profiles" one - so user A
needs to be able to just view data, user B needs to be able to
acknowledge login warning messages and reset locked users, user C
needs to have full access to user admin features, etc.

I figure that the best way to do this is to use the sessions features
in Django, but avoid the in-built user capability. I'm more than happy
to generate all the screens and code that are needed, but I obviously
don't want to do that if there's a simpler/better way. For obvious
reasons I really don't want to end up patching/extending the Django
code (and then have to redo my changes when Django 1.4 comes out).

Thanks.

Bob

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



Re: learning Django after a break -- site tutorials, examples

2011-05-20 Thread BobX

On May 20, 4:35 am, John Griessen  wrote:
> I've gone through the Django 1.2 tutorial to the point of creating an admin 
> site,
> then had to switch to other work for months.  What are some good simple 
> example sites
> or tutorials for creating a top page ( index.html ) and using templates with 
> css?
>
> John

Like you, I'm a Django n00b. What I'd recommend is a quick tour
through the tutorial again (in case there's any changes from 1.2 to
1.3 that'll effect you, plus it's always good to have that warm "I
remember that" feeling). I'd recommend that Django book from Apress,
even though that's covering 1.1 - but make sure to get the 2nd edition
(pub date 2009) rather than the older release - I've seen both on
Amazon, which is quite confusing.

The top page question - if you want a static page (ye olde index.html)
then probably best to get the web server to skirt around Django and
deliver that as a normal HTML page. But the _simplest_ option (from my
experience) is to generate a small stub routine that has index.html as
a template and use render_to_response to shoot that out when the user
goes to URL http//mysite/ (or whatever you want). Just because you're
using index.html as a template doesn't mean that it needs to contain
anything other than normal HTML. The site I'm developing at the moment
has "dummy" placeholders that do exactly that, so I know it works.

I only started Django about two weeks ago, and yesterday I generated
my first app-specific template filter with few troubles, so I'm
_REALLY_ impressed with the power and flexibility of the Django
framework. :D

Regards, Bob.

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



Re: 500 message with POST

2011-05-03 Thread BobX
On May 2, 4:14 pm, А. Р. <4d876...@gmail.com> wrote:
> > @csrf_exempt
> > Any ideas what I'm doing wrong?
>
> Try importing csrf_exempt at the top of your views.py:
> from django.views.decorators.csrf import csrf_exempt
Yes, I already did that - just omitted the declaration from the
message to save space. Oops.

On May 2, 5:14 pm, Ian Clelland  wrote:
> On Mon, May 2, 2011 at 7:45 AM, Robert Cross  wrote:

> The fact that, on GET, you are getting a 301 first means that the URL that
> you are providing is not the correct one for the resource. You probably have
> "/posttest/" defined in your urls.py, but you are using wget to access
> "/posttest" (no trailing slash). On a GET request, it is perfectly safe to
> just issue a redirect to the correct URL, but it is not necessarily safe for
> POST requests. I believe that Django will issue the redirect anyway, buy the
> user agent is *not* supposed to just blindly post the data to the new URL
> without some sort of user interaction.
>
> To eliminate this as a possible error source, try putting the trailing "/"
> on the URL in the command line:
>
> $ wget --post-data 
> 'data=Something'http://localhost:8000/posttest/?data=CommandLine
>
> Then you should get { 'data': 'CommandLine' } in request.GET, and { 'data':
> 'Something' } in request.POST.
Darn it - you were exactly right. Added the trailing slash, and the
code (the test one I gave and the real code) is now working
flawlessly. Thanks for the pointer and the explanation. :)

Bob

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