New Uvicorn release. (Alternative to Daphne for Django Channels)

2018-08-14 Thread Tom Christie
Hi folks, I've been putting a lot of work into Uvicorn lately. It's an ASGI server, similar to Daphne, and can be used as the server to run Django channels (amongst other things). https://www.uvicorn.org/ It's got lots of nice behavior around resource limiting, graceful restarts, support for p

Re: Rest Framework and Swagger

2016-11-07 Thread Tom Christie
https://github.com/marcgibbons/django-rest-swagger On Saturday, 5 November 2016 16:17:10 UTC, pradam.programming wrote: > > Hi Guys, > Please I need an advice on the best approach to take on the following > issues. > > How can i Implement Swagger for CBV and FBV in rest framework ...? > -- You

Re: django 1.9, migrations SUCK

2016-08-03 Thread Tom Christie
I'd suggest using `country = forms.ChoiceField(choices=[])` in the form declaration itself, and having the form `__init__()` method populate the *actual* set of choices. That way the allowable set of choices will always reflect whats currently in the DB at the point that the view runs. -- You

Re: Django Rest Framework Custom Viewsets.

2016-06-24 Thread Tom Christie
Good stuff - make sure to add it to the django packages grid, here: https://www.djangopackages.com/grids/g/django-rest-framework/ You could also create a docs pull request to add a "Third Party Packages" to the viewsets section, here: http://www.django-rest-framework.org/api-guide/viewsets/#vie

Re: No Downtime Code Releases

2016-04-21 Thread Tom Christie
I'd also recommend against splitting your models into a separate repo. There's a decent article on migrations without downtime here: http://pankrat.github.io/2015/django-migrations-without-downtimes/ Essentially "don't run your migrations at the same time as you deploy" and "split deployment/mi

Re: Domain Driven Development

2015-11-17 Thread Tom Christie
Hi Alex, I've written previously about encapsulation and Django models , and I think that's kinda relevant here. If you apply the policy "never write to a model or call .save() directly" then yes, you can ensure that the only access

Re: Django + microservices: What's correct approach?

2015-08-25 Thread Tom Christie
> Create a Django project for each micro-service or all using the same project? Different projects. > Micro-services must communicate themselves using the same REST API, some way for better approach? The API *is* the service boundary yup. > How to deploy the project: Running "python manage.py

Re: Django + microservices: What's correct approach?

2015-08-24 Thread Tom Christie
Django REST framework is a general purpose API toolkit, and more than capable of building microservice-type services. Likewise there are plenty of frameworks in alternative languages that are also suitable for building APIs that could be characterized as 'microservice'. The reason you're findin

Re: Question about subdomains.

2015-02-10 Thread Tom Christie
> Are these 3 different apps in 1 project, or 3 different projects. Either are possible. It depends on the application. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an em

Re: Securing Browseable API & Mocking Models

2015-02-02 Thread Tom Christie
Hi Ari, It looks like Django REST swagger has an `is_admin` flag you can use... http://django-rest-swagger.readthedocs.org/en/latest/settings.html#is-superuser You'll probably also want to disable the browsable API by removing it from the 'DEFAULT_RENDERER_CLASSES' key in the 'REST_FRAMEWORK' s

Re: read GET and POST simultaneously?

2015-01-27 Thread Tom Christie
Absolutely no problem at all doing that. The only thing that's confusing here is that `request.GET` is a misleading name. The query parameters are available on any request, regardless of the HTTP method. > Is this reliable behavior across browsers? Yes. > Is it a dumb idea for reasons I haven'

Re: Use django rest framework with dynamoDB

2015-01-16 Thread Tom Christie
Maybe take a look at this... https://github.com/gtaylor/django-dynamodb-sessions > > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...

Re: Seeking for advise on usage MySQL together with MongoDB

2014-12-16 Thread Tom Christie
Thanks Cal. If you do get the time that'd be fab, positive criticism is always useful. Equally please don't feel obligated - sure you weren't expecting to have to give a blow-by-blow breakdown of pain points you found. :p May be worth taking any further convo over to the django-rest-framework

Re: Seeking for advise on usage MySQL together with MongoDB

2014-12-13 Thread Tom Christie
Hi Cal, > DRF has it's own problems and (again imho) does not solve the problems it was originally designed to fix. Attempting to build anything beyond "out of the box CRUD" requires hacky/unclean workarounds, with most of your time spent fighting against the shortcomings of DRF rather than wor

Re: Django Project Website inaccesible

2014-10-27 Thread Tom Christie
Seconding Larry. I don't see any issue. On Monday, 27 October 2014 18:06:17 UTC, Dan wrote: > > I've been trying to access https://www.djangoproject.com > > > since Friday, but

HTML 5 input

2014-10-01 Thread Tom Christie
See the discussion here: https://code.djangoproject.com/ticket/16630#comment:11 -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegr

Re: Change GFK to FK

2014-09-29 Thread Tom Christie
You'll probably want to take this approach: * Create a schema migration, adding the FK. * Create a data migration, populating the FK data. * Create a schema migration, removing the GFK. On Sunday, 28 September 2014 23:15:22 UTC+1, sacrac wrote: > > Hi, is posible to change GenericForeingnKey to F

Django REST framework 3 Kickstarter.

2014-07-17 Thread Tom Christie
Hi all, I've just launched a Kickstarter project aimed at funding development for a major new version of Django REST framework. There's a whole bunch of really exciting stuff that I'd like to be able to work on, including: - Faster, simpler and easier-to-use serializers. - An alternative

Security release for Django REST framework: 2.3.14.

2014-06-12 Thread Tom Christie
Cross-posting this for the benefit of any Django REST framework users who aren't on the REST framework mailing list... The 2.3.14 version of REST framework has just been released to PyPI. Most importantly this includes

Re: Django response with two HTTP 'WWW-Authenticate' headers

2014-01-20 Thread Tom Christie
No, I don't believe that Django's response class supports that slightly esoteric usage. As explained by the stackoverflow answer here, repeated headers should be treated as being the same as a single hea

Re: Django Weekend Cardiff

2013-11-14 Thread Tom Christie
Thanks for that Daniele - will be looking forward to that. Will make sure to promote it at the next Brighton and London meetups, and I'd probably be interested in talking and/or giving a tutorial. What's the best forum for staying in the loop re. conf organization? Cheers, Tom On Wednesday, 1

Re: Geo support with Django Rest Framework

2013-10-21 Thread Tom Christie
Hi Sanjay, I would take a look at these two repos: https://github.com/dmeehan/django-rest-framework-gis https://github.com/mjumbewu/django-rest-framework-gis You might also try searching the REST framework issue list as it's likely either or both of these were at some point discussed there. Als

Re: Django Pagination

2013-10-03 Thread Tom Christie
Hi Hélio, It looks like you're applying pagination to the rendered JSON string itself. You want to be paginating the queryset itself. queryset = Player.objects.filter(name=namepost) paginator = Paginator(queryset, 20) return json.dumps([item.to_dict() for item in paginator.object_list

Re: Error when loading application server

2013-07-03 Thread Tom Christie
Hi Helio, Something somewhere is expecting an integer but receiving an empty string instead. This could be the result of a missing component in the URL eg `http://example.com/users//`, or a field in a JSON or form data request that's missing a value, eg: { "score": "" ... } Hope that hel

Re: Filter more than one level in the related field

2013-06-28 Thread Tom Christie
Hi Hélio, As mentioned before, it's not really appropriate to consistently cross-post your questions. Folks on either list won't be aware if there question has already been answered by someone else, it's more difficult for ot

Re: delete file in GridFS by its id

2013-06-25 Thread Tom Christie
Hi Hélio, I see that you've posted this question separately on each of the `django users`, `mongoengine users`, and `mongoengine developers`. Please don't cross post questions on mailing lists - pick one appropriate mailing list and use that. If you cross post questions there's every cha

Re: Newbie CSRF protection questions

2013-04-13 Thread Tom Christie
One minor correction worth pointing out... "The first defense against CSRF attacks is to ensure that GET requests are >> side-effect free." What's meant by "side effect free"? > > It means that the request must be idempotent - that if you make the same > request on the server multiple times,

Re: Django 1.5 CBV - DeleteView - CustomQuery

2013-03-21 Thread Tom Christie
te > things like the MarkDeleteClass while in CBVs I could inherit from it. > > Am Donnerstag, 21. März 2013 14:11:44 UTC+1 schrieb Tom Christie: >> >> In cases like this, rather than rely on overriding the default behavior >> of the DeleteView, >> I'd recommen

Re: Django 1.5 CBV - DeleteView - CustomQuery

2013-03-21 Thread Tom Christie
Actually you'll probably want the `delete` method to be a `post` instead, but either way hopefully it'll give you the right idea. On Thursday, 21 March 2013 13:11:44 UTC, Tom Christie wrote: > > In cases like this, rather than rely on overriding the default behavior of > th

Re: Django 1.5 CBV - DeleteView - CustomQuery

2013-03-21 Thread Tom Christie
In cases like this, rather than rely on overriding the default behavior of the DeleteView, I'd recommend writing your own base class. It'll be more explicit and more obvious exactly what is going on... from django.views.generic import View class MarkDeletedView(View): """

Re: Django 1.5 & Python 3 - porting packages to Python3

2013-02-27 Thread Tom Christie
Hi Thomas, There's movement on getting Py3k compatibility into pillow. See this, and associated tickets: https://github.com/python-imaging/Pillow/issues/61 > Are there any focus in the community on getting packages ready for python3? Sure, I'm seeing several projects recently updated or active

Re: define form in yaml file

2013-01-25 Thread Tom Christie
Also, you might want to take a look at the Django Forms in an API world talk. A large portion of that is about serializing form definitions into JSON, for use by both HTML and non-HTML clients. (eg mobile) The project it talks a

Re: Generic views and url issues

2013-01-24 Thread Tom Christie
Hi Amy, I'd suggest you check the following... * Your ROOT_URLCONFsetting is correct. * If the `urls.py` module you're referring to here is a project URL conf and not the root URL conf, make sure that it is being included by the

Re: Django/Python vs Grails/Groovy

2013-01-14 Thread Tom Christie
I'm not in a position to draw a comparison between the Grails and Django, but I would say that Django's package ecosystem, and in particular for your use case it's API frameworks, are really rather great. Again, I've no idea how Grails compares, but Django TastyPie and

Re: Django community, is it active?

2012-12-19 Thread Tom Christie
> Is this worth going? --- http://2013.djangocon.eu Yes, yes, yes, yes, and yes. I've been to two DjangoCons, both have been incredible, and have reaffirmed how proud I am to work in this industry, and to be a part of this community. > Who are the top blogs people within the Django community w

Re: Authenticate User with Django 1.5

2012-12-16 Thread Tom Christie
> A custom authentication backend isn't required; the ModelBackend should adapt to any well-defined User model. Thanks Russ, I hadn't realized the ModelBackend tied in nicely with those changes. > Have you tried changing USERNAME_FIELD to 'email'? +1, looks like that's the OP's issue. On Sun

Authenticate User with Django 1.5

2012-12-15 Thread Tom Christie
I believe you'll need a custom authentication backend to tie in with your user model. Take a look at the docs here: https://docs.djangoproject.com/en/dev/ref/authbackends/ Here's an example of an auth backend that takes email/password instead of username/password: https://github.com/dabapps/d

Re: Forbidden (403)

2012-11-13 Thread Tom Christie
You don't need the `c.update` etc... lines, since it's not actually being used anywhere by your view. Also you should probably just use `render` instead of `render_to_response`, since `render` will always use a RequestContext. https://docs.djangoproject.com/en/dev/topics/http/shortcuts/ On Tues

Re: Forbidden (403)

2012-11-12 Thread Tom Christie
Could you include your 'kundendaten' view too, please. Any error text on the 403 page would also be useful. On Monday, 12 November 2012 15:54:50 UTC, Nebros wrote: > > When i put in a variable in my type="text" and push type="submit" (by the > step to next page)... > > > Am Montag, 12. November

Re: How many developers have moved to class-based views?

2012-11-12 Thread Tom Christie
If you're working with the generic CBVs, I would strongly recommend taking a look at the documentation provided by the Classy CBV project - http://ccbv.co.uk/. Because of the way it's auto-generated it allows you to see at a glance exactly what set of methods and attributes are implemented by

ANN: Django REST framework 2 released.

2012-10-30 Thread Tom Christie
Hi all, I'm incredibly pleased to announce the release of Django REST framework 2. REST framework 2 is a comprehensive reworking of the original project. Because this is a major re-design, rather than an incremental release, we've skipped 1.x entirely, and called this version 2. Some of the thi

Re: 1.5: syntax of AUTH_USER_MODEL

2012-10-29 Thread Tom Christie
You don't mention 'app1.MyUser', which is what I think it should be. On Monday, 29 October 2012 14:50:15 UTC, Anil wrote: > > I have the following filesystem structure: > > project > project/app1 > project/app1/models.py <--- class MyUser(AbstractBaseUser) > project/project > project/project/setti

Re: Using email instead of username for registration and login

2012-09-25 Thread Tom Christie
This should cover it: https://github.com/dabapps/django-email-as-username For compatibility with django-registration you'll also want to take a look at the thread on this ticket: https://github.com/dabapps/django-email-as-username/issues/17 Cheers, Tom On Tuesday, 25 September 2012 02:

Release: django-email-as-username

2012-02-06 Thread Tom Christie
Okay, I know there are a handful of other apps that already do this, but I wasn't quite happy with anything that was out there. I've pushed the django-email-as-username package to PyPI. Source and docs available here: https://github.com/dabapps/django-email-as-username I think it's pretty comp

django-private-views

2012-01-31 Thread Tom Christie
Useful little package for y'all, written by Julien Phalip, which I've packaged and pushed to PyPI. django-private-views - https://github.com/dabapps/django-private-views Inverts the usual @login_required logic, and instead makes all your views private by default, and gives you a @login_not_requ

Re: django tests. where to create users

2011-11-29 Thread Tom Christie
What's wrong with just creating them in the .setUp()? Don't sweat the small amount of time it'll take to re-create the users on each test run, it's almost certainly not worth worrying about. -- You received this message because you are subscribed to the Google Groups "Django users" group. To v

Re: Integrating Selenium tests into Django unit tests.

2011-08-04 Thread Tom Christie
This... https://code.djangoproject.com/attachment/ticket/2879/django_live_server_1.0.2.diff With changes to reflect the fact that the database settings layout has changed since 1.0, like so... = # Must do database stuff in this new thread if database in memory.

Integrating Selenium tests into Django unit tests.

2011-08-03 Thread Tom Christie
I just had to do the same thing. Tried to use the django-sane-testing package, but didn't have much success there. In the end this ticket here: https://code.djangoproject.com/ticket/2879 pretty much did the trick, with a bit of updating as it didn't quite work with >= 1.2. I'll see if I can get

Re: django-pdb on PyPI

2011-08-03 Thread Tom Christie
Thanks for that! Yeah there's nothing very complicated about it, but makes for a useful little package. T. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/

django-pdb on PyPI

2011-08-02 Thread Tom Christie
I've thrown up the django-pdb package on PyPI - hopefully some of y'all will find it a useful little tool. PyPI: http://pypi.python.org/pypi/django-pdb/0.1.1 GitHub: https://github.com/tomchristie/django-pdb Suggestions and contributions are of course very welcome. Here's the basic README...

Re: Creating REST APIs in Django...advice

2011-04-12 Thread Tom Christie
  The obvious big difference with REST framework is that the API is entirely web browse-able. To me that's quite a big deal - your API can be genuinely self documenting, and it's massively easier to browse, work with, and debug, than it would be if your working from the command line all the time

Creating REST APIs in Django...advice

2011-04-12 Thread Tom Christie
I've been working on this with some folks: http://django-rest-framework.org Released 0.1 a few weeks ago, and it's coming along *really* nicely. It's under v active development ATM. The auto-generated API browser is particularly cool. Really would advise anyone taking a look at building web API

Re: What is the best server for Django

2011-03-10 Thread Tom Christie
And again, +1 webfaction, they really do rock. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegrou

Announce: Django REST framework

2011-02-22 Thread tom christie
Hey all, I'm superpleased to announce the release of Django REST framework 0.1. http://django-rest-framework.org/ The project is another mini-framework aimed at making it easy to build well-connected, self-describing RESTful web APIs, in the same vein as django-piston and django-tastypie. (T