项目作者: Alexmhack

项目描述 :
Django backend authentication using Djoser with Angular frontend
高级语言: JavaScript
项目地址: git://github.com/Alexmhack/Djoser-Angular.git
创建时间: 2018-11-04T13:55:20Z
项目社区:https://github.com/Alexmhack/Djoser-Angular

开源协议:

下载


Djoser-Angular

Django backend authentication using Djoser with Angular frontend

  1. Create virtualenv using pipenv

    1. pipenv install django djangorestframework djangorestframework-jwt djoser python-decouple
    2. # activate virtualenv using
    3. pipenv shell
  2. Start django project

    1. # ending dot creates files in the same folder
    2. django-admin startproject backend .
    3. ng new frontend

    Don’t run django migrate command for now.

  3. Start django app for custom user model

    1. python manage.py startapp users

    You can find the code for the custom user model from the same repo folder ‘users’.

  4. Specify the custom user model in django settings by

    1. # backend/settings.py
    2. INSTALLED_APPS = [
    3. 'users',
    4. ]
    5. # specify user model
    6. AUTH_USER_MODEL = 'users.User'

    Now run the makemigrations and migrate command

  5. Start angular project using Angular CLI

    1. // styling files will be in 'scss' format and routing file will be pre initiated.
    2. ng new frontend --style=scss --routing
  6. Try out the project progress so far by running django and angular server

    1. python manage.py runserver

    In another command prompt run angular server

    1. cd frontend
    2. ng serve -o

Project is under construction.