You say you're getting code from that site, but you're creating new code with errors in it.
The error message you're getting here is 'AttributeError: 'str' objetcs has no attribute 'workspace''
This is because you pass in an argument to the method you've created:
publish_featuretype("self" name="Layername", store="store_name", native_crs="4326", srs="EPSG:4326")
Here, you've passed in 'store-"store_name"' which assigns the store variable as a string.
Then, in the method, you do this:
feature_type = FeatureType(self, store.workspace, store, name)
where you try to access the attribute 'workspace' on the 'string' object. And as the error message says, the string object doesn't have an attribute called 'workspace'.
Your POST body is wrong in the first case, when in doubt make a GET request of an existing object to see what the expected format is.
So for example http://localhost:8080/geoserver/rest/workspaces/nurc/coveragestores/worldImageSample/coverages/Img_Sample.xml
returns:
<coverage>
<name>Img_Sample</name>
<nativeName>Img_Sample</nativeName>
<namespace>
<name>nurc</name>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/namespaces/nurc.xml" type="application/xml"/>
</namespace>
<title>North America sample imagery</title>
<description>A very rough imagery of North America</description>
<keywords>
<string>WCS</string>
<string>worldImageSample</string>
<string>worldImageSample_Coverage</string>
</keywords>
<nativeCRS>GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]],
UNIT["degree", 0.017453292519943295],
AXIS["Longitude", EAST],
AXIS["Latitude", NORTH],
AUTHORITY["EPSG","4326"]]</nativeCRS>
<srs>EPSG:4326</srs>
<nativeBoundingBox>
<minx>-130.85168</minx>
<maxx>-62.0054</maxx>
<miny>20.7052</miny>
<maxy>54.1141</maxy>
<crs>EPSG:4326</crs>
</nativeBoundingBox>
<latLonBoundingBox>
<minx>-130.85168</minx>
<maxx>-62.0054</maxx>
<miny>20.7052</miny>
<maxy>54.1141</maxy>
<crs>EPSG:4326</crs>
</latLonBoundingBox>
<enabled>true</enabled>
....
<requestSRS>
<string>EPSG:4326</string>
</requestSRS>
<responseSRS>
<string>EPSG:4326</string>
</responseSRS>
</coverage>
so your post body should be (at least):
<coverage>
<name>seonyudo</name>
</coverage>
and might need other values too, see the manual page for more details.
Best Answer
Try defining the resource first and pulling the layers from it: