You should be able to get a lot done in 2 days. It isn't like WDW where the parks are spread out, the two parks as DL are only about 100 yards apart from each other, with DTD adjacent to both. Also, keep in mind that with only 2 parks you have about 70% of the attractions that the 4 parks in Florida have, so you can get to a lot of stuff within a smaller, easy to access area. You might not be able to take as relaxed an approach as you would with more days, but it will still require less planning than a WDW visit would (for instance, you don't need to book meal reservations months in advance, you can book them closer to your visit). Also, if you are limited in time I would actually advise staying offsite at one of the hotels on Harbor directly across the street (Best Wester PPI, Park Vue, Desert Inn, Del Sol Inn, Tropicana Inn, Carousel Inn, Camelot Inn). They are a 5 minute walk to the parks and are really the most convenient option. The onsite hotels are hundreds of dollars a night more, are not any closer and if you are only there for 2 days I imagine you would want to spend most of that time in the parks anyway. The link below is to a Google map showing the nearby hotels so you can get a sense of how close together everything is. Whatever you decide, good luck!
https://www.google.com/maps/place/Anaheim+Plaza+Hotel+&+Suites/@33.8083552,-117.9169905,833m/data=!3m1!1e3!4m5!1m2!2m1!1shotels+near+disneyland!3m1!1s0x0000000000000000:0x2536e69bd6c28797!6m1!1e1