Skip to content

Instantly share code, notes, and snippets.

View sonthonaxrk's full-sized avatar
👁️
Focusing

RK sonthonaxrk

👁️
Focusing
View GitHub Profile
{
"url": "https://api.localhost:8000/users/3/",
"first_name": "Steven ",
"last_name": "Konig",
"email": "[email protected]",
"profile-image": "https://fbcdn-profile-a.akamaihd.net/profile_picture.jpg",
"age": 36,
"profiles": {
"customer_profile_url": "https://api.localhost:8000/customers/3/",
"vendor_profile_url": "https://api.localhost:8000/vendors/3/"
Environment:
Request Method: GET
Request URL: http://localhost:8000/profile/users/
Django Version: 1.7.4
Python Version: 3.4.2
Installed Applications:
('django.contrib.admin',
@sonthonaxrk
sonthonaxrk / models.py
Last active August 29, 2015 14:14 — forked from anonymous/models.py
class User(AbstractBaseUser, PermissionsMixin):
class Meta:
abstract = False
USERNAME_FIELD = 'email'
account_type = models.IntegerField(choices=ACCOUNT_TYPES, default=2)
first_name = models.CharField(max_length=30)
middle_names = models.CharField(max_length=30)
@sonthonaxrk
sonthonaxrk / models.py
Last active August 29, 2015 14:14 — forked from anonymous/models.py
class User(AbstractBaseUser, PermissionsMixin):
class Meta:
abstract = False
USERNAME_FIELD = 'email'
account_type = models.IntegerField(choices=ACCOUNT_TYPES, default=2)
first_name = models.CharField(max_length=30)
middle_names = models.CharField(max_length=30)
#urls.py
urlpatterns = patterns('',
url(r'^profile/$', login_required(views.BaseView.as_view(
template_name='profile_view.html' testVariable='testing' )), name='profile'),
)
#views.py
class BaseView(TemplateView):
#urls.py
urlpatterns = patterns('',
url(r'^profile/$', login_required(views.BaseView.as_view(
template_name='profile_view.html' testVariable='testing' )), name='profile'),
)
#views.py
class BaseView(TemplateView):