We are going to visit Detroit soon. I'm not afraid but I would like to be prepared to any kind possible violence.
Are there districts to avoid and time of day to keep your eyes open?
Sure. Stick to downtown and/or midtown Detroit during the day, or if you're going to a specific event, go there and don't venture too far away. Downtown/midtown encompasses the Woodward/Jefferson area, Tiger Stadium, Cobo Hall, The Joe, etc. There are plenty of festivals this time of year downtown (at least their used to be). Be prepared to see homeless people or people down on their luck. Police are pretty concentrated around the downtown area b/c that's where the tourists visit. You're fine there during the day, probably during the evening as well. If I were just visiting, I'd stick to the downtown area, there isn't much else to see outside of that. Typically the worst things that happen there are phone snatchings b/c of people mindlessly talking/texting and a very fast runner will do a snatch and grab. Like I said though, if you're aware of your surroundings you should be able to avoid most of those situations.
This should go w/out saying, but stay out of any neighborhoods. Most aren't as bad as you see in the media, but you don't want to take chances. Obviously don't put yourself in bad situations such as pumping gas in the middle of the night at a dimly lit gas stations. Suburbs are a different story, though don't think you're exempt from violence anywhere, there are different police in the 'burbs and they tend to respond a bit quicker out there for various reasons.
Don't believe the news about Detroit, yeah, it's bad, however there are greats neighborhoods here w/ people who care about their communities. That being said, it was easier to list the places you should go rather than where you should avoid. Even w/ GPS, the one thing you don't want to do is get lost somewhere, Detroit or otherwise. The majority of things to see that are actually in Detroit are downtown, unless you're doing missionary work or a documentary or something similar.
All of the answers here are almost a decade old, and a lot has changed in Detroit since then. Midtown has gotten a lot of new development, and Woodward is popping with lots of shops and people strolling around (non-homeless people to be clear). I hear a lot of stories of younger folk moving back into the city from the suburbs, neighborhoods getting cleaned up, etc.
I remember not too long ago when most people would tell you to avoid the city in its entirety, and while that's still true for some neighborhoods, the core downtown area is much better now and is continuing to improve.
I also want to make clear that people who warn you about safety/violence are usually talking about the city of Detroit specifically. As others have alluded to, most of the suburbs are very safe and affluent -- I'm talking roughly the arc from Canton to Novi, West Bloomfield, Birmingham, Troy, Sterling Heights etc. There's often some confusion when one refers to "Detroit" as outsiders tend to include the suburbs while locals generally would not.
Overall, there's a lot to see in this part of the country -- life in the American heartland is quite different than what many might experience from only visiting the more touristy attractions along the coasts -- and personal safety shouldn't deter one from visiting entirely.
Just as a note it is generally rare for people living in the suburbs even in large metropolitan areas in the US not to have a car.
Irrespective of that you can look at Crime Mapping site on which the information is published by the Detroit Police Department. The map is coded and you can identify clusters of various crimes based on the information provided so if you choose you can avoid those areas.