Entries tagged django
[... 1210 words]
I’m a big believer in the importance of a “recent additions” feed. Any time you’re building an application that involves users adding and editing records it’s useful to have a page somewhere that shows the most recent objects that have been created across multiple different types of data.[... 1647 words]
I’ve been writing a few scripts to backfill my blog with content I originally posted elsewhere. So far I’ve imported answers I posted on Quora (background), answers I posted on Ask MetaFilter and content I recovered from the Internet Archive.[... 560 words]
I’m going to describe a way to put together a world-class continuous deployment infrastructure for your side-project without spending any money.[... 1273 words]
I’ve added a faceted search engine to this blog, powered by PostgreSQL. It supports regular text search (proper search, not just SQL“like” queries), filter by tag, filter by date, filter by content type (entries vs blogmarks vs quotation) and any combination of the above. Some example searches:[... 3049 words]
Heroku’s default setup for Django uses the gunicorn application server. Each Heroku dyno can only run a limited number of gunicorn workers, which means a limited number of requests can be served in parallel (around 4 per dyno is a good rule of thumb).[... 400 words]
No, it’s not slow because it uses Django.[... 36 words]
No.[... 40 words]
Should I use Django forms or pure HTML in order to do not establish borders for the growth of my app?
Use Django forms. Django scales horizontally on the front-end, so if your site needs to handle large amounts of traffic you just need to run multiple front-end servers—your form handling code will scale up just fine.[... 65 words]
http://gnosis.cx/TPiP/ “Text Processing in Python” is a free online book that covers a bunch of useful topics related to data cleanup. It’s over 10 years old now but is still mostly relevant—the chapter on regular expressions is particularly good.[... 61 words]
The Django release process is well documented (see Django’s release process) and has been specifically designed to address the concerns of developers who don’t want to have to spend too much time keeping up to date with the latest version.[... 182 words]
Is it better to create your own framework, or would it be best to just use Django or something like that?
You should absolutely use an existing framework such as Django rather than writing your own.[... 176 words]
For a Django application, deployed on Heroku, what are my options for storing user-uploaded media files?
S3 is really a no-brainer for this, it’s extremely inexpensive, very easy to integrate with and unbelievably reliable. It’s so cheap that it will be practically free for testing purposes (expect to spend pennies a month on it).[... 88 words]
It’s pretty easy to write custom backends for Django’s caching layer—check out https://github.com/sebleier/djan... for example.[... 36 words]
Partly because the first applications developed on Django (before it was even called Django) used PostgreSQL, so it’s had great PostgreSQL support baked in from the start.[... 74 words]
Django scales in exactly the same way as PHP or Rails or any other stateless shared-nothing web technology: you ensure that the web nodes (running your Django code) are independent from your persistence layer (database, caching, session storage etc) and scale then independently.[... 191 words]
My boss wants me to choose drupal over django for website develpment.How can I convince him to choose django?
You could point him to Django (web framework): Why did theonion.com stop using Drupal?[... 40 words]
Build something and put it on the internet. Make sure you have an easy way to deploy new versions (Heroku is a good bet if you don’t want to figure out Fabric). Pick a project that’s useful to you—a simple blogging engine is often a good bet, or maybe something that aggregates together your posts from Twitter and Instagram and so on. Or come up with something a bit more creative![... 109 words]
These days a popular and reliable method is to run gunicorn behind nginx. This tutorial includes notes on using upstart for process management which is handy if you are on Ubuntu: http://lincolnloop.com/django-be...[... 47 words]
No. The web2py GUI is something of an oddity in the Python world.[... 65 words]
You can’t. The best you can do is have Django periodically poll MySQL to see if anything has changed (maybe with a custom management command run by cron)—having a TIMESTAMP field on every table which will be automatically set to the current time when a record is inserted will help you spot things that have changed.[... 80 words]
This isn’t really a Django-specific question—the answer would be the same no matter what server-side tech you use.[... 121 words]
The best way to learn python in my opinion is using the interactive prompt. Install ipython (a massive improvement on the standard python shell) and use it to interactively solve some simple tasks—things like downloading a CSV file from the web using the urllib library, parsing it with the csv module, then poking around in the data using python list comprehensions and saving some of the results out to a JSON file.[... 95 words]
Take a look at redis—it can handle binary strings up to 512 MB and has performance that is similar to memcache. It’s very easy to use from within Django (there’s even a pluggable cache backend for it).[... 61 words]
Get yourself a VPS, set it up from scratch and run some non-critical websites on it (nothing with private user data since you can’t be sure you’ll set it up securely). Both Slicehost and Linode offer a good set of guides to a whole host of common tasks:[... 109 words]
For http://lanyrd.com/ our layout looks something like this:[... 214 words]
I’d argue that it does. If you want to build a REST API you need to be able to map incoming HTTP requests to handler functions based on their URL, run some custom code and return an HTTP response containing JSON (or maybe XML). Django makes all of this really simple.[... 330 words]
What web programming framework best supports ’drag and drop’ actions? Please give examples of sites and/or plug-ins that support the interaction.
Drag and drop is a client-side thing—it has nothing to do with the server-side technology being used.[... 72 words]
Don’t use the Django ORM for bulk imports—the performance overhead is pretty small for regular web page stuff, but it adds up if you are running millions of inserts.[... 63 words]