I went a year ago and stayed in the Medina right in the centre.
It was fantastic. It was safe, but at times it felt a little daunting, but upon reflection it was probably us not being used to it as opposed to any real threat.
It is sensible to follow usual precautions such as not dress too provocatively in public areas, unless you are going to a club / bar - but even then get a taxi there - don't walk the streets.
Not that you'll be in any real danger, but you could feel uncomfortable with the unwanted attention.
But that aside it is an amazing place, drop me a PM if you are going and I'll give you a list of some great bars and restaurants.