Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django for a simple web application

Tags:

python

django

I'm developing an app (an API) in python and I would like to offer some of its functionality through a web interface (like web services do). I've been looking at django, but I don't know if really fits well in my idea. I only want to create a web page that invokes to my API methods in order to acomplish the functionality that offers that web page. But, after followed the tutorial, I feel a little confused about the point of django. It seems to me to be more related with an ORM than a classic web application.

Is django a solution so heavy for such a simple development (as I mentioned, make calls to my API through the web)? Do I always have to use a database?

Thanks.

like image 756
Francisco Avatar asked Oct 22 '25 10:10

Francisco


1 Answers

I love django but there is an lot of it to get your head around! If you don't want the database bit, focus on urls.py and views.py that will process your urls and return the info you want as an http response.

eg. urls.py

urlpatterns += patterns('myapp.views',

    url(r'^getstuff/$', 'getstuff' ),
)

in views.py

def getstuff(request):

   do whatever in python

   return HttpResponse(stuff to return)
like image 135
PhoebeB Avatar answered Oct 24 '25 23:10

PhoebeB



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!