I tend to write with the source texts in mind and I do try to keep to what JKR says -- for example, she's shot down Draco/Hermione and Neville/Luna. She's said that Ron is not Dumbledore and that Neville is definitely not special because of the prophecy, that Harry is The Chosen One and Neville's role is simply that of a person who could have been The Chosen One but wasn't because of a choice that Voldemort made. Some consider it unfair that she interprets the books for us and on one hand, I totally agree with them, because really, thousands of people would be unemployed if there were only one way to interpret each work of literature.
On the other hand, when JKR makes an unequivocal statement about interpreting a certain thing in the books, it pretty much means that she's not going to write it any other way, so in other words, holding out hope for D/Hr or N/L is pretty much hopeless - she's not going to write it. But so what? All she's said is that Draco and Hermione will not get together and that Neville's personality is not quite enough to handle Luna. But people's personalities can change, people's opinions and views can change and as long as we can make those changes in fan fiction, changes that enable Draco and Hermione to get along or changes that make Neville be still his canon self but different enough from that to be able to "handle" Luna.
I'll now bore you with my "plz to explain it" mantra because I think that's sort of a given, considering my constant harping about exposition and explanations and making things make sense and believable. It's sometimes difficult to write believable redemption or personality shifts or what have you, because everyone's threshold of believability is different and whereas I as an H/D shipper might accept that Draco really secretly wants Harry and that's why he always antagonises him, someone who isn't an H/D shipper might not find that believable at all. In fact, they may snort and say "yeah right" and they might also throw baked goods at you. (Which I wouldn't find disagreeable because one can never have enough pie).
Pie aside, though, there are a lot of accusations of "canon rape" flung about. What's canon rape? I don't think something like Muggle clothes at Hogwarts qualifies as canon rape, because though there is almost no evidence for Muggle clothes at Hogwarts (a T-shirt is mentioned once and a shirt, also once), there's also no direct evidence contradicting their existence. Canon characters turned into Mary Sues/Gary Stus is canon rape, in my opinion, because really, people, stick to your American transfer students and keep the canon characters in character, thanks.
If a canon character is unrecognisable in fic besides some superficial physical attribute that's been used to refer to them in canon, I call canon rape. I don't want to read about a random blond bloke or a random bloke with glasses, I want to read about Draco and Harry. Harry is very fleshed out by the source text and it's easy to screw him up - Draco, not so much. There are things I believe about Draco based on my own analysis and interpretation of canon, but I'll happily read other Dracos and their interpretations as long as the author somehow imparts the rationale for their interpretation through their writing. I've read and liked really-quite-nice-to-his-own!Draco. I've read and liked redeemed!Draco, even though I myself don't think he needs or wants redemption the way it's usually written (where he self-flagellatingly prostrates himself before Harry or Ron or Hermione and says "I was wrong all along, omg!!11").
Another thing that tends to throw me (though I'd hesitate to call it canon rape) is character voice. Harry is from a middle-class background, he is not likely to use words like "discombobulated" or "jejune". He's not likely to speak very properly, he uses colloquialisms and contractions a lot, just like various Weasley children. Hagrid is probably not likely to think in highfalutin metaphors, unless there's some sort of explanation for how he's really quite erudite but for the old speech impediment. Neither of the canon characters are likely to start spouting Americanisms, and so forth. The thing with POV-based fic is that an author has to be really careful whom they pick to tell the story if they're writing from third-person, because hi, canon characterisation and character voice go hand in hand. The thing is, though, that using a different voice for a character is not canon rape unless it's clearly an attempt at being pretentious while caring nothing for the character him/herself.
Anything can be made to work, really, and you've got a free reign if you're writing AU or AT or AR. I think consistency is key. I personally am incredibly anal-retentive about canon - anyone I've beta-read for can attest to that, I think. I've even made comments when the Gryffindor common room hearthrug was absent from a fic. I research obsessively and I keep and often glance through a list of rather trivial facts gleaned from the books, just to keep them fresh in my mind. The exciting thing about canon is that there is so much of it and some little bitty details are so tiny, they simply beg exploration. When I write fics, I try to include at least one theory I have about canon and my idea for its implementation (whether it be magic, use of Potions, or specific types of magical devices).
The thing is that there are fics where the little detail omissions throw me out completely because the rest of the fic is either not very good or kind of dodgy when it comes to exposition of decidedly non-canon things. There are also fics where I couldn't give a rat's ass if they don't have a hearthrug in the Gryffindor common room or if their Ravenclaw tower is on the wrong floor - because the plot itself is so engaging that these little things don't take away from enjoying the whole thing. Some writers are able to perfectly capture the wizarding world's atmosphere, the very, hm, quaint morality that seems to exist there - and in their case I really don't give a fuck if their characters eat Bertie Pott's Every Flavour Beams instead of Bott's and Beans. My all-time H/D favourite was written pre-GoF and it remains my favourite despite the fact that it doesn't observe a number of canon facts that happened since PoA.
The thing is though, looking through lists of "classic" fics and fics that are almost universally loved and are on every single rec list out there, there is a very common thing to be noticed. 95% of them attempt to stick to canon and most capture aspects of canon that feel familiar. It's not about being 100% faithful to every single canon detail (though this is always preferable[/canon nazi]), it's really all about interacting with the source text and illuminating facets of it that speak to the reader on a fundamental level. Let's face it, if everyone wrote like JKR we would have a very boring fandom.
I see a lot of people complaining about how the canon nazis are restricting creativity and whatnot, and I once read someone saying that they think the canon nazis have their own sekrit cabal and they send out people to slam fics that don't observe every single canon detail to the point of absurdity. I sincerely hope they were joking, though I suppose GAFF could count as the sekrit cabal. :P I suppose I should qualify my previous statement -- I think that if someone demands that an author not deviate from canon in any way, shape or form, they're being ridiculous, because then why write fan fiction at all? We could just all sit here and wonder what's going to happen in HBP.
Canon-tight fan fiction is not the kind that only deals with established canon and doesn't extrapolate on it, is what I'm trying to say. Canon-tight fan fiction makes an honest attempt to observe previous canon while exploring it creatively.
Thoughts & opinions always welcome. :)