9 Django Concepts - Part 3
Tags: python, webdev, career, startup
Published: 2019-09-01 13:58:04

# Introduction 
Welcome to the final part of the 9 Django Concepts for aspiring Django developers.

For this, I will be covering parts like deployment, testing and supporting front-end framework. 

Which is a project that any Django developer who is building it for a Javascript based front-end framework.

 If you had miss [part 1][1] or [part 2][2], I would suggest you go to those before reading this part 3 to not miss out on it.

# Testing
By default, Django comes with its own [testing module][3] based upon Python's default testing library. 

Which is called [unittest][4]. 

Personally, I would prefer the use of [Pytest][5]. 

Due to it is **simple** to write test cases without much **boilerplate** and it's [Fixtures][6] to mock data to run your test cases repeatedly.

For a tutorial on how to use Django's testing framework, I would suggest you head to **Harry Perceval's** free online ebook called [Test Driven Development with Python][7] or his [PyCon workshop - Django TDD ][8].

# Supporting Front-end framework
Due to the popularity of Javascript front-end framework like **Vue**, **React** and **Angular**.

Django is being increasingly used as a **backend system** to provide support for front-end. 

Therefore you need to use new tools or services to provide your best support of front-end.

The first library will definitely be [Django REST Framework][9]. 

Which will be your **bread & butter** skill to be used for building REST APIs. 

## API Development Resources
If you are heading towards API development route for Django. 

Focus on adopting tools like [Postman][10] or [Swagger Editor][11] that is based upon [OpenAPI v3][12].

Which is an industry API design specification to speed up your API development process.

[API evangelist][13] provides tons of resources for API ecosystem.

Unless your organisation or company's front-end developer bugs you to use [GraphQL][14], just build REST endpoints due to its maturity & eco-system on it. 

For building GraphQL, there is a project called  [Graphene][15] which extends your Django to provide GraphQL endpoints.

# Deployment
Here I will list down both simple & complex deployment. 

If you really want to learn more about deploying Django. 

Just head over to get your copy of the book called [High-Performance Django][16] or the [Django's Documentation on Deployment][17] to understand Django deployment and scaling it. 

## Simple
My suggestion is to use a cloud hosting provider service like [Linode][18] or [Heroku][19] or [DigitalOcean][20]. 

If it is just a personal website or service with a small number of users, go for these cloud hosting service providers. 

## Complex
Due to the complexity of the various technologies used for deploying Django. 

If you are just starting out use either [mod_wsgi][21] module for [apache web server][22] or using [Gunicorn][23] or [Uwsgi][24] that is served on [Nginx][25].

The use of [Zappa][26] is a great choice.

If you are using AWS to scale Django.

# Conclusion
 These are the concepts that I had encountered along the way to become a better Django developer. 

Do let me know in the comments section if you had any doubts on Django concepts or the article.

Lastly, to end off this article, PyCon SG has invited the creator of [Zappa][26] **Rich Jones** as a keynote speaker. 

If you are interested in learning about Zappa by Rich Jones, you can head on down to get your tickets for [PyCon SG 2019][27]

If you like my article, please **sign up** for Max [Adventurer's Newsletter](http://eepurl.com/dOUoUb) for awesome content I stumble across weekly in **Python**, **Startup** and **Web Development**.

You can also **follow** me to get the **latest** update of my article on **Dev**


This post was originally posted on Max's blog at [Top 9 Django Concepts - Part 3: 3 Mins](https://www.maxongzb.com/9-django-concepts-part-3-read-time-3-mins/) and [Photo by Jaredd Craig on Unsplash](https://unsplash.com/photos/HH4WBGNyltc)

# References
* [9 Django Concepts Part 1][1]
* [9 Django Concepts Part 2][2]
* [9 Django Concepts Part 2][2]
* [Testing Module][3]
* [Unittest][4]
* [Pytest][5]
* [Fixtures][6] 
* [Test Driven Development with Python][7]
* [Django REST Framework][9]
* [Postman][10]
* [Swagger Editor][11]
* [OpenAPI v3][12]
* [API evangelist][13]
* [GraphQL][14]
* [High-Performance Django][16] 
* [Django's Documentation on Deployment][17]
* [mod_wsgi][21] 
* [Gunicorn][23]
* [Uwsgi][24]
* [Nginx][25]
* [Zappa][26]


[1]: https://www.maxongzb.com/top-9-django-concepts-part-1-4-mins/
[2]: https://www.maxongzb.com/top-9-django-concepts-part-2-5-mins/
[3]: https://docs.djangoproject.com/en/2.2/topics/testing/
[4]: https://docs.python.org/3/library/unittest.html#module-unittest
[5]: https://docs.pytest.org/en/latest/
[6]: https://www.tutorialspoint.com/pytest/pytest_fixtures.htm
[7]: http://www.obeythetestinggoat.com/pages/book.html#toc
[8]: https://youtu.be/_rLPDxpXIFc
[9]: https://www.django-rest-framework.org/
[10]: https://www.getpostman.com/
[11]: https://editor.swagger.io/
[12]: https://swagger.io/docs/specification/about/
[13]: http://apievangelist.com/
[14]: https://graphql.org/learn/
[15]: https://graphene-python.org/
[16]: https://highperformancedjango.com/
[17]: https://docs.djangoproject.com/en/2.2/howto/deployment/
[18]: https://www.linode.com/
[19]: https://www.heroku.com/
[20]: https://www.digitalocean.com/
[21]: https://modwsgi.readthedocs.io/en/develop/
[22]: https://httpd.apache.org/
[23]: https://docs.gunicorn.org/en/latest/index.html
[24]: https://uwsgi-docs.readthedocs.io/en/latest/index.html
[25]: https://www.nginx.com/
[26]: https://github.com/Miserlou/Zappa
[27]: http://bit.ly/getPyConSG2019