Code Monkey home page Code Monkey logo

django-tastypie-custom-user-example's Introduction

django-tastypie-custom-user-example
A project template for Django 1.5 is taken from `twoscoops/django-twoscoops-project

<https://github.com/twoscoops/django-twoscoops-project>`_

To use this project follow these steps:

#. Create your working environment
#. Install Django
#. Clone this repository
  1. Install additional dependencies
*note: these instructions show creation of a project called "django_tastypie_example". You

should replace this name with the actual name of your project.*

Working Environment

You have several options in setting up your working environment. We recommend using virtualenv to separate the dependencies of your project from your system's python environment. If on Linux or Mac OS X, you can also use virtualenvwrapper to help manage multiple virtualenvs across different projects.

Virtualenv Only

First, make sure you are using virtualenv (http://www.virtualenv.org). Once that's installed, create your virtualenv:

$ virtualenv --distribute django_tastypie_example

You will also need to ensure that the virtualenv has the project directory added to the path. Adding the project directory will allow django-admin.py to be able to change settings using the --settings flag.

Virtualenv with virtualenvwrapper --------------------------

In Linux and Mac OSX, you can install virtualenvwrapper (http://virtualenvwrapper.readthedocs.org/en/latest/), which will take care of managing your virtual environments and adding the project path to the site-directory for you:

$ mkdir django_tastypie_example
$ mkvirtualenv -a django_tastypie_example django_tastypie_example-dev
$ cd django_tastypie_example && add2virtualenv `pwd`

Windows

In Windows, or if you're not comfortable using the command line, you will need to add a .pth file to the site-packages of your virtualenv. If you have been following the book's example for the virtualenv directory (pg. 12), then you will need to add a python pathfile named _virtualenv_path_extensions.pth to the site-packages. If you have been following the book, then your virtualenv folder will be something like:

`~/.virtualenvs/django_tastypie_example/lib/python2.7/site-directory/`

In the pathfile, you will want to include the following code (from virtualenvwrapper):

import sys; sys.__plen = len(sys.path) /home/<youruser>/django_tastypie_example/django_tastypie_example/ import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:]; p=getattr(sys,'__egginsert',0); sys.path[p:p]=new; sys.__egginsert = p+len(new)

Installing Django

To install Django in the new virtual environment, run the following command:

$ pip install django

Clone this project

To clone this project, run the following command:

$ git clone https://github.com/psjinx/django-tastypie-custom-user-example.git

Installation of Dependencies

Depending on where you are installing dependencies:

In development:

$ pip install -r requirements/local.txt

For production:

$ pip install -r requirements.txt

note: We install production requirements this way because many Platforms as a Services expect a requirements.txt file in the root of projects.

Acknowledgements

  • Many thanks to everyone who read my blog post[1] and suggested possible improvements.
  • All of the contributers[2] to django-twoscoops-project[3] project.
  • All of the contributors to this project.
  1. http://psjinx.com/programming/2013/06/07/so-you-want-to-create-users-using-djangotastypie/
  2. https://github.com/twoscoops/django-twoscoops-project/blob/master/CONTRIBUTORS.txt
  3. https://github.com/twoscoops/django-twoscoops-project

django-tastypie-custom-user-example's People

Contributors

pankaj28843 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.