A D7 chord consists of:
- D - the root note - if you leave it out the chord is ambiguous, but you might fix that by having another instrument, your voice, or the listener's imagination, fill it in. When you're the only accompaniment, however, you typically want the tonic as one of the lowest notes in your chord, as an anchor (this is why bass guitars often play root notes)
- A - D's 5th - this reinforces the root (which is why the next step from root-note-only bass parts, is root-and-fifth bass parts), but leaving it out doesn't weaken the chord too much
- F# - D's major 3rd. This is what makes it a major chord. An F natural would make it a minor chord. Leaving out the third altogether makes it ambiguous (known as a "power chord")
- C - D's dominant 7th. This is what makes it a dominant 7th chord (in pop/rock/folk we generally use "7th" as shorthand for "dominant 7th" when talking about chords) If you leave it out, it's just a major chord, not a 7th chord.
Now, these four notes occur in multiple places on the fretboard:

You can play any of them and get a note that fits in a D7 chord. You can play any combination of them and get at least a partial D7 chord. To get a full D7 chord you need at least one of each.
So, there are lots of fingerings that would get some or all of those notes, in various octaves and in various orders. These are known as inversions of a chord. Here are three:

The top letters are the string names, the bottom letters are the fretted note names.
The first chord is missing the D, but uses two open strings, so is easy to play. It would sound OK, especially if (for example) a bass instrument is taking care of root notes.
One reason this shape might be in your source, is that some people reach ukulele chords by starting with Guitar chords. The top four strings of a guitar have the same relative tuning as a uke (if the uke has a low G), a fifth out. So a uke D7 is the same shape as a guitar A7, but two strings are missing. On the guitar, the root note is the 5th string. On the uke, the root note is missing.
The second chord has all four notes, with the D on the third string.
The third chord barres the 5th fret and also has all the notes, although the D is on the top string, so doesn't anchor the chord so firmly. It is higher up the fretboard, so you get a different tone out of your instrument. You could sometimes play this chord, and other times play one of the other forms, to add variety to an accompaniment.
This is very common on lots of instruments. When I want to play a C chord on guitar, I choose between the shape beginners learn early on, with open strings; a barred shape on the third fret; a different barred shape on the 8th fret; or lots of other choices.
I'd suggest:
- Play these three chords, and notice (especially if you hum the D to remind yourself of the tonic, and to fill in the missing D in the first form) that although the sound changes, the harmonic content stays the same.
- Try making up more D7 shapes, using more of the positions on the fretboard diagram.
- Try mapping out the notes of a different chord on the fretboard, and working out the shapes and inversions for that chord from first-principles too.