TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Developing a REST User API – Python or PHP?

3 pointsby ilmiontalmost 10 years ago
I am intending to make a new REST user API to let users log into future web apps and projects of mine. I am equally fluent and confident in PHP and Python and I realise that there is no straight answer to this but which would you use and why? Additionally, how should the user data be protected in transmission? I just want a fairly simple user API ... so its a question of PHP or Python, and then security.

3 comments

pcxalmost 10 years ago
You should use Django along with Django Rest Framework[1], which is absolutely amazing at building REST APIs. It lets you use all the goodies that come with Django and provides a very Django-ish way to build APIs.<p>[1] <a href="http:&#x2F;&#x2F;www.django-rest-framework.org&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.django-rest-framework.org&#x2F;</a>
twundealmost 10 years ago
Honestly, both can work. That said, python has a few well-known open-source rest api libraries&#x2F;frameworks that have strong community support like Django Rest Framework or flask.<p>In terms of security, best practices would be to use https, api keys for each application. I&#x27;d also suggest setting up oath2
citruspialmost 10 years ago
&gt; ...which would you use and why?<p>Python. I prefer it as a language over PHP and I&#x27;m more comfortable developing and deploying Python projects.<p>&gt; Additionally, how should the user data be protected in transmission?<p>HTTPS?