This guide assumes a fresh install of Mac OSX 10.7 Lion.
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
| # Django-ninja APIs (Python) | |
| from ninja import Router, Schema | |
| from django.http import JsonResponse | |
| from django.contrib.auth import authenticate, login | |
| from django.views.decorators.csrf import ensure_csrf_cookie | |
| from django.contrib.auth.models import User | |
| from ninja.errors import HttpError | |
| router = Router() |
Hopefully this will answer "How do I setup or start a Django project using REST Framework and ReactJS?"
This is a guide to show you step by step how this can be setup. If you just want to get started, use the cookiecuter I set up cookiecutter-django-reactjs. It basically is a fork of pydanny's cookiecutter, just added the front-end stuff :).
I created this because it was SUCH a pain in the ass setting up a project using all the latest technologies. After some research, I figured it out and have it working. The repo that implements this is located here. Feel free to use it as a boilerplate ;)
Main features:
- Django REST APIs
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
| *PPD-Adobe: "4.3" | |
| *% CUPS add-on PPD file for Canon Inkjet Printer Driver. | |
| *% Copyright CANON INC. 2001-2010 | |
| *% All Rights Reserved. | |
| *% | |
| *% This program is free software; you can redistribute it and/or modify | |
| *% it under the terms of the GNU General Public License as published by | |
| *% the Free Software Foundation; version 2 of the License. | |
| *% | |
| *% This program is distributed in the hope that it will be useful, |
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
| # INCORRECT! DON'T DO THIS! | |
| >>> x = "www.Alliancefrançaise.nu" # This is the problematic line. Forgot to make this a Unicode string. | |
| >>> print x | |
| www.Alliancefrançaise.nu | |
| >>> x.encode('punycode') | |
| 'www.Alliancefranaise.nu-h1a31e' | |
| >>> x.encode('punycode').decode('punycode') | |
| u'www.Alliancefran\xc3\xa7aise.nu' | |
| >>> print x.encode('punycode').decode('punycode') | |
| www.Alliancefrançaise.nu |