Saving a Profile
Saving a Profile
When you save() your Profile, the current or specified name
will be used to create or update a save file in the location specified by local
From the Docs…
- Profile.save(name=None, alert=True)[source]View on GitHub
Pickles and saves the
Profileusing the specified or currently set name.
- InstaTweet.profile.Profile.local =True
Indicates if saves should be made locally (
True) or on a remote database (False)
Important!!
You MUST configure the DATABASE_URL environment variable to save/load remotely
InstaTweet uses SQLAlchemy to create a DBConnection
Any
SQLAlchemy-supported database is therefore also supported byInstaTweetSee the
dbmodule for more information
Example: Save a Profile
from InstaTweet import Profile
>>> p = Profile('myProfile')
>>> p.save()
Saved Local Profile myProfile
>>> p.save('aProfile')
>>> print(p.name)
Saved Local Profile aProfile
aProfile
Profile names must be unique - you cannot save or create a profile if a
profile_exists() with that name already
>>> q = Profile('myProfile')
FileExistsError: Local save file already exists for profile named "myProfile"
Please choose another name, load the profile, or delete the file.