Giter Site home page Giter Site logo

intern-app-django's Introduction

Intern-app-django

Prosta plikacja servera do logowania. Korzysta z Django i Django REST framework.

Udostępnia cztery endpointy:

I: Logowanie
	metoda: POST
 	endpoint: `/login/`
	przykładowy json:
	{
		"email": "[email protected]",
		"password": "12345678",
	}
  	zwraca:
	{
		token: TOKEN
	}
II: Rejestracja
	metoda: POST
	endpoint: `/register/`
	przykładowy json:
	{
		"email": "[email protected]",
		"username": "test",
		"password": "12345678",
		"password2": "12345678"
	}
	zwraca:
	{
		token: TOKEN
	}

III: Pobranie aktualnie zalogowanego użytkownika
	metoda: GET + Autoryzacja ( JWT TOKEN )
	endpoint: `/users/me/`
	zwraca:
	{
		"username": "test",
		"email": "[email protected]"
	}
IV: Pobieranie wszystkich użytkowników
	metoda: GET + Autoryzacja ( JWT TOKEN )
	endpoint: `/users/`
	zwraca:
	[
		{
		    "email": "[email protected]",
		    "username": "test1"
		},
		{
		    "email": "[email protected]",
		    "username": "test2"
		}
	]

Wymagania:

  • Python 3.5.2
  • pip

Instalacja(Linux):

I: git clone https://github.com/marcinSuw/intern-app-django.git
II: cd intern-app-django
III: pip install -r requirements.txt
IV: python manage.py runserver   

Testy:

  • python manage.py test

Testowane endpointy:

  • /login/: test metoda [POST] poprawne dane oraz niepoprawne
  • /register/: test metoda [POST] poprawne dane oraz niepoprawne
  • /users/me/: test metoda [GET] pobranie danych o zalogowanym użytkowniku z autoryzacją oraz bez
  • /users/: test metoda [GET] pobranie listy uzytkowników z autoryzacją oraz bez

Przykładowy test:

#sample test
def test_single_user(self):
    user_count = User.objects.count()
    self.assertEqual(user_count, 1)

Zbudowane z: - Django - Django REST framework

Autor Marcin Suwała

intern-app-django's People

Contributors

marcinsuw avatar

Watchers

James Cloos 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.