Skip to content

Instantly share code, notes, and snippets.

Avatar

Collin Rukundo crukundo

View GitHub Profile
@crukundo
crukundo / cbv_multiple_forms.html
Created Apr 29, 2020 — forked from badri/cbv_multiple_forms.html
Django multiple forms code with sample usage
View cbv_multiple_forms.html
{% extends "base.html" %}
{% block content %}
<form method="post">{% csrf_token %}
{{ forms.subscription }}
<input type="submit" value="Subscribe">
</form>
<form method="post">{% csrf_token %}
{{ forms.contact }}
<input type="submit" value="Send">
View UserProfile.py
from django import forms
from django.contrib.auth.models import User
class UserProfileForm(forms.ModelForm):
class Meta:
model = User
fields = ['first_name', 'last_name', 'email']
@crukundo
crukundo / views.py
Created Jul 30, 2020 — forked from alee/views.py
Django Discourse SSO endpoint adapted from https://meta.discourse.org/t/sso-example-for-django/14258 - depends on settings.py DISCOURSE_BASE_URL and DISCOURSE_SSO_SECRET
View views.py
import base64
import hmac
import hashlib
from urllib import parse
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseBadRequest, HttpResponseRedirect
from django.conf import settings
@login_required
@crukundo
crukundo / gotham.md
Created Apr 17, 2021 — forked from mfd/ gotham.md
Gotham font
View gotham.md

Gotham by Hoefler & Co

https://cdn.rawgit.com/mfd/f3d96ec7f0e8f034cc22ea73b3797b59/raw/856f1dbb8d807aabceb80b6d4f94b464df461b3e/gotham.css

<link rel="https://cdn.rawgit.com/mfd/f3d96ec7f0e8f034cc22ea73b3797b59/raw/856f1dbb8d807aabceb80b6d4f94b464df461b3e/gotham.css">