I replaced my rear hub, but I'm not sure about how to attach the derailleur I'm new to working on bikes and have been unable to find an answer via the internet, which, too be honest, is probably really simple.

I got a bike just for riding around the city that had a cheap hub which went out recently.  I replaced the hub and cassette with a Deore T610 and HG51, which I had no problem doing and they seem to fit the bike just fine.  

My problem is that I'm not sure how to attach the derailleur.  The old derailleur was attached inline with the axle bolt, tightened down by a nut.  I was planning on using the old derailleur for the time being, but the axle for the new hub is the standard 142mm, which means it doesn't extend past the bike frame itself, as seen in the picture below.  I can mount the derailleur on the outside of the frame and tighten it with the quick release, but I'm hesitant to do so since it won't be supported by the axle.  Is it normal for the derailleur to be supported just by the pressure of the QR and not supported by hanging on the axle?

I also thought that maybe I should just replace the derailleur altogether, which I have no problem with, but it seems like most derailleurs also attach via built-in hanger or via a removable hanger, which would also be attached to the main axle.  So even if I did replace the derailleur, I'd still have a similar question about how to actually attach the hanger to my bike.  Further more, my bike doesn't have any kind of slot or bolt hole for a hanger.  Can I just use a generic hanger an tighten it down with the quick release?

Thanks for taking the time to read through this! I'd really appreciate any help!
Compare @mike 's photo with your hanger.   Yours does not show a bolt head.  Mike's does, and there's a specially-shaped nut on the other side.  



This semirounded nut is supposed to slide up the dropout, and acts as one anchor.  Your wheel axle acts as the other, to stop the derailleur rotating around.

Good news is these generic claw hangers are cheap, so buy the whole unit and you'll be able to fit the derailleur.

Note - you may need to file the backside of the rounded nut to get chain clearance in the smallest cog.