A boilerplate application for Django web applications.
If you've attented hackathons, you already know how much time can be wasted figuring out what language to pick, which web framework to choose, which APIs to incorporate, and figuring out OAuth authentication. Django Hackathon Starter aims to provide these features out of the box, allowing the team to save hours of time getting these pieces together.
Even if you are not using this for a hackathon, Django Hackathon Starter is sure to save any developer hours or even days of development time and can serve as a learning guide for web developers.
- User Registration
- Sphinx Documentation
- Django Nosetests
- Basic Authentication with username and password
- OAuth 2.0 Authentication for Github, LinkedIn and Instagram
- OAuth 1.0a Authentication for Twitter and Tumblr
- API Examples
- Yelp API
- Github API
- Instagram API
- Tumblr API
- Twitter API
- Twilio API
- Meetup API
- Steam API
- Quandl Stock API
- New York Times API
- LinkedIn API
This project relies on bower
for front-end dependencies, which in turn requires npm. npm
is now bundled with NodeJS
, which you can download and install here.
For Python-specific libraries, this project relies on pip. The easiest way to install pip
can be found here.
To get up and running, simply do the following:
$ git clone https://github.com/DrkSephy/django-hackathon-starter.git
$ cd django-hackathon-starter
# Install the requirements
$ pip install -r requirements.txt
# Install bower
$ npm install -g bower
$ bower install
# Perform database migrations
$ python manage.py makemigrations
$ python manage.py migrate
NOTE: We highly recommend creating a Virtual Environment. Python Virtual Environments allow developers to work in isolated sandboxes and to create separation between python packages installed via pip.
NOTE: To get you up and running quickly, we have provided dummy API keys for use. We highly recommend setting up your own keys and replacing them within settings.py
.
- Register an account on Yelp.com
- Visit the Yelp for developers page
- You will obtain the following:
CONSUMER KEY
,CONSUMER SECRET
,TOKEN
,TOKEN_SECRET
- Within
settings.py
, add the following:YELP_CONSUMER_KEY
=Yelp Consumer Key
YELP_CONSUMER_SECRET
=Yelp Consumer Secret
YELP_TOKEN
=Yelp Token
YELP_TOKEN_SECRET
=Yelp Token Secret
- Register an account on Meetup.com
- Visit Meetup OAuth Consumers page
- Enter a project name for the
consumer name
field - For
redirect url
field, enter:http://127.0.0.1:8000/hackathon/
- Enter a project name for the
- Within
settings.py
, add the following:MEETUP_CONSUMER_KEY
=Meetup key
MEETUP_CONSUMER_SECRET
=Meetup secret key
- Register an account on Twilio.com
- Get your Twilio Number
- Setup the numbers you want to be able to send messages to
- Grab your
account_sid
andauth_token
here - Within
scripts/twilioapi.py
:- Replace
account_sid
with your own Twilioaccount_sid
- Replace
auth_token
with your own Twilioauth_token
- Replace
- Register an account on Github.com.
- Visit Github developer applications page
- Click on Register new application.
- Enter
Application name
andHomepage URL
field - For
redirect url
field, enter:http://127.0.0.1:8000/hackathon/
- Enter
- Click Register application.
- Within
settings.py
, add the following:GITHUB_CLIENT_ID
=Github-client-id
GITHUB_CLIENT_SECRET
=Github-client-secret
- Register an account on Twitter.com
- Visit Twitter application management page
- Click on Create New App
- Enter
Application name
,Description
, andWebsite
field - For
Callback URL
field, enter:http://127.0.0.1:8000/hackathon/
- Enter
- Click Create your Twitter application
- Go to the Permissions tab
- Under Access, select Read and Write type
- Go to Keys and Access Tokens tab
- Under Your Access Token, click on Create my access token to generate access tokens
- Within
settings.py
, add the following:TWITTER_CONSUMER_KEY
=Twitter-consumer-key
TWITTER_CONSUMER_SECRET
=Twitter-consumer-secret
TWITTER_ACCESS_TOKEN
=Twitter-access-token
TWITTER_ACCESS_TOKEN_SECRET
=Twitter-access-token-secret
- Register an account on Instagram.com.
- Visit Instagram manage clients page
- Click on Register a New Client
- Enter
Application name
,Description
, andWebsite URL
field - For
Redirect URI
field, enter:http://127.0.0.1:8000/hackathon/
- Enter
- Within
settings.py
, add the following:INSTAGRAM_CLIENT_ID
=Instagram-client-id
INSTAGRAM_CLIENT_SECRET
=Instagram-client-secret
- Register an account on Linkedin.com.
- Visit Linkedin developer Network page
- Click on Add New Application
- Enter
Company Info
,Application Info
, andContact Info
section - Under
OAuth User Agreement
section, select scopes needed - For
OAuth 2.0 Redirect URLs
field, enter:http://127.0.0.1:8000/hackathon/
- Enter
- Click Add Application
- Within
settings.py
, add the following:LINKEDIN_CLIENT_ID
=Linkedin-client-id
LINKEDIN_CLIENT_SECRET
=Linkedin-client-secret
- Register an account on Facebook.com
- Visit Facebook Developer Network page
- After logging in, Click on My Apps and then on Add a New App+
- Choose Website as the platform and add the name for your project
- Click on Create New Facebook APP ID and choose the Category of your application
- Click Create App ID
- After the captcha, scroll down past the quick start and add
http://localhost:8000/
- Within your
views.py
add the App ID inyourappid
underneath the view for your facebook application.
- Register an account on Tumblr.com.
- Visit Tumblr applications page.
- Click on Register Application.
- Enter your application information.
- For Default callback URL field, enter: http://127.0.0.1:8000/hackathon/.
- Click Register.
- Within settings.py, add the following:
- TUMBLR_CONSUMER_KEY =
- TUMBLR_CONSUMER_SECRET =
- Register an account on Steam
- Visit Steam Community developers page
- After logging in, add the Domain Name as the name of your application and key is shown
- Within your
views.py
add the Key inkey
underneath the view for your steam application
- Register an account on NY Times Developer Network
- Click on Register
- After logging in, click on APIs (http://developer.nytimes.com/apps/register)
Write in the Name of your application and click each sub-API that you will use
- Agree to the Terms of Service and click on Register Application
- Within your
settings.py
add the following:POPAPIKEY
=Most Popular API
TOPAPIKEY
=Top Stories API
- Register an account on Quandl
- After logging in, click on Me and then Account settings to find the API key
- Within your
settings.py
addQUANDLAPIKEY
=Key
Name | Description |
---|---|
hackathon_starter/settings.py | Django settings module containing database and API keys/tokens. |
hackathon/admin.py | Registered models for Django's admin page. |
hackathon/models.py | Django models and profiles for user login. |
hackathon/tests.py | Integration tests. |
hackathon/urls.py | Django Hackathon Starter URL dispatcher. |
hackathon/views.py | Django views file. |
hackathon/serializers.py | Allows JSON representation for Django Model fields. |
hackathon/forms.py | Basic form fields. |
hackathon/static/ | Front-end JavaScript / CSS files. |
hackathon/unittests | Unit tests. |
hackathon/scripts/ | API Example scripts. |
**hackathon/scripts/**github.py | Script for interacting with Github API. |
**hackathon/scripts/**instagram.py | Script for interacting with Instagram API. |
**hackathon/scripts/**linkedin.py | Script for interacting with LinkedIn API. |
**hackathon/scripts/**meetup.py | Script for interacting with Meetup API. |
**hackathon/scripts/**nytimes.py | Script for interacting with New York Times API. |
**hackathon/scripts/**quandl.py | Script for interacting with Quandl API. |
**hackathon/scripts/**scraper.py | Basic web scraper for getting sales from Steam. |
**hackathon/scripts/**steam.py | Script for interacting with Steam API. |
**hackathon/scripts/**tumblr.py | Script for interacting with Tumblr API. |
**hackathon/scripts/**twilioapi.py | Script for interacting with Twilio API. |
**hackathon/scripts/**twitter.py | Script for interacting with Twitter API. |
**hackathon/scripts/**yelp.py | Script for interacting with Yelp API. |
**hackathon/templates/**hackathon/ | Templates for API examples. |
**hackathon/templates/**hackathon/base.html | Base template, contains navbar. |
Contributing |
We welcome contributions of all kinds. If you would like to know what work is needed to be done, check the issue tracker. Before sending a pull request, please open an issue. This project follows the pep-0008 style guide.
The MIT License (MIT)
Copyright (c) 2015 David Leonard
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.