Created
September 14, 2012 06:32
-
-
Save alejandrobernardis/3720204 to your computer and use it in GitHub Desktop.
Data Base, User Demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from settings import DATABASE_USERS | |
| from com.ak.common.security import token | |
| from mongoengine import connect as mongo_connect | |
| settings = dict(host='127.0.0.1', port=27017) | |
| mongo_connect(DATABASE_USERS, **settings) | |
| User.drop_collection() | |
| u = User() | |
| u.username = 'alejandro.bernardis' | |
| u.password = 'alejandro.bernardis' | |
| u.email = 'alejandro.bernardis@gmail.com' | |
| u.token = token(32, include_date=False) | |
| u.facebook_uid = 'fake_'+u.username | |
| u.twitter_uid = 'fake_'+u.username | |
| u.save() | |
| print u.to_object() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment