Tangier, not Casablanca
I think I read somewhere that the city the producers of Casablanca had in mind was Tangier. However, another movie came out that year (or was due to come out) under the title of Algiers, and they felt the rhyme would detract from their own movie, so they renamed it Casablanca.
Thus the truly wild and wooly nature of Tangier in the 1940s is not synonymous with that of Casa during the same period for Americans, who continue to be surprised that Casablanca looks (surprise!) like a commercial and financial capital (think banks, warehouses, and factories), while Tangier looks more like they should expect Casa to have looked like.
Check out Paul Bowles' description, from 1958, describing the changes he saw from his first visit in 1931:
"Tangier is little more than an enormous market. Since the war it has been primarily a free-money market; and the new autonomous Moroccan government will probably take an increasingly active part in the economic life of a city without currency control. During the international years the dramatic, extralegal facets of the city's character were much publicized, and Tangier was thought of as a place where every fourth person was a smuggler, a spy or a refugee from justice in his native land. It is true that the city was a market where diplomatic information was bought and sold; it was also a place where goods destined to pass eventually across frontiers without benefit of customs inspection were unloaded and reloaded and, more importantly, a place where people from a variety of nations were able to exist without valid documents to identify them. Then, too, in the absence of all taxes, it was expedient for European exporters to maintain offices here, even though their produce might never pass within a thousand miles of the Moroccan coast. That era is over ... "