Re: A server that runs django

2017-02-22 Thread Antonis Christofides
Hi, For many people, including me, nginx is the recommended web server for Django. See, for example, my blog post, "Which components should I use in production? ". You may also be interested in a webinar

Re: django channels in the shell

2017-02-22 Thread Andrew Godwin
I would recommend using the channel layer object directly instead in future: from channels.asgi import get_channel_layer channel_layer = get_channel_layer() That will make sure all settings are applied the same. Andrew On Wed, Feb 22, 2017 at 8:19 PM, chris rose

Re: django channels in the shell

2017-02-22 Thread chris rose
solved it.. I had to explicitly add the hosts parameter from django.conf import settings > from django.utils.module_loading import import_string config = getattr(settings, "CHANNEL_LAYERS", {}) > hosts = config['default']['CONFIG']['hosts'] backend_class =

Re: Django template language resolve url

2017-02-22 Thread chris rose
sorry i typed an s in there, here is that code amended > > -- 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...@googlegroups.com. To

Re: Django template language resolve url

2017-02-22 Thread chris rose
hey xyron.. i replied to your other thread your namespace should actually just be links so the answer should be: -- 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

Re: Django Tutorial Part 2 - Model not showing up on Django Admin

2017-02-22 Thread Dylan Reinhold
Post your admin.py file and make sure that admin.py file is in your app folder. For #3, when you added your app and ran makemigrations it should have built a migration file for any of your models in model.py. On Wed, Feb 22, 2017 at 1:20 PM, t0mgs wrote: > Hi there, > >

Django official tutorial part 2 problem - model won't show on admin site

2017-02-22 Thread t0mgs
Hi there, I've posted another topic but it seems to have gotten lost somehow. Not sure if there's approval needed or something. Anyways - I got stuck in this part of the tutorial , and I've

Re: Routing to database based on user

2017-02-22 Thread Wilkinson Tavares
Hi Tom, Did the solution Ansii suggested work? Have you got some scalability problem with this solution? On Monday, 30 January 2012 19:01:21 UTC-3, Tom Eastman wrote: > > Hey guys, > > I'm writing a django project that will require me to route queries to > certain large databases based on who the

Django Tutorial Part 2 - Model not showing up on Django Admin

2017-02-22 Thread t0mgs
Hi there, This is my first time inside a mailing list. Oh, the jitters! :) Anyways, in the second part of the Django tutorial there's a section in which we are to modify our `admin.py` file in

Re: Issues saving hex format data to binaryfield

2017-02-22 Thread ludovic coues
As you have editable = True, I assume you have read the code a bit. I personnaly stopped reading after RegisterLookupMixin. If looking at the code don't give you a solution, I would try to fallback to raw SQL. That might be a skill more useful than the ability to update BinaryField :) 2017-02-22

Re: Issues saving hex format data to binaryfield

2017-02-22 Thread Brian O'Connell
The database is pre-existing and I'm creating a Django web interface for it. This object holds the 8-digit hex output of the unique mfr identifier of the MiFare rfids. There are remote terminals that interact with database through psycopg2 and have no issue with that field. I could change the

Re: Issues saving hex format data to binaryfield

2017-02-22 Thread Brian O'Connell
I have the model set up as a binaryfield. The problem is I have no idea how to save the information to it. I can retrieve information from it easy enough but if I try and enter in new information, saved in the same format as that it returns Here's what I have in model.py class

Re: Issues saving hex format data to binaryfield

2017-02-22 Thread ludovic coues
Can't you use django's BinaryField ? 2017-02-22 20:09 GMT+01:00 Shawn Milochik : > Why not base64 encode it and just store it in a charfield? There doesn't > seem to be any compelling reason to store it in binary. > > -- > You received this message because you are subscribed

Re: Issues saving hex format data to binaryfield

2017-02-22 Thread Shawn Milochik
Why not base64 encode it and just store it in a charfield? There doesn't seem to be any compelling reason to store it in binary. -- 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,

Re: Using Django Channels to subscribe to a Redis channel

2017-02-22 Thread Andrew Godwin
Hi Jochen, Your problem is that if you want to listen to the pubsub channel you will need a dedicated process to do so, as you can't just poll something like that. Given that restriction, you're going to have to write something like a management command that opens a connection to Redis and

Re: Models/Foreign Keys best practice

2017-02-22 Thread Richard Jackson
Hi Melvyn - great reply, thank you so much for taking the time to help! I've got to head out now but will reply tomorrow - just wanted to leave an initial thank you note! Rich On Wednesday, February 22, 2017 at 5:01:36 PM UTC, Melvyn Sopacua wrote: > > Hi Richard, > > > > good questions

Issues saving hex format data to binaryfield

2017-02-22 Thread Brian O'Connell
I have a project where I am saving RFID information (which comes in as hex strings) to a bytea object in my postgres database. I can retrieve this information without issue. I am struggling to overwrite that object with new data (For when someone loses their rfid and needs to replace it). I

Re: "Ask the Django Team Anything" IRC session - Wed Feb 22 18:00 UTC

2017-02-22 Thread Tim Graham
This is starting in about 30 minutes. Any Django team members who want to participate in the question answering, please ping me on IRC. On Monday, February 20, 2017 at 9:02:38 AM UTC-5, Tim Graham wrote: > > In partnership with the freenode community team, the Django team will hold > an "Ask Me

Re: Models/Foreign Keys best practice

2017-02-22 Thread Melvyn Sopacua
Hi Richard, good questions and your initial data model defines your application challenges. It is by far the most important step in application design, so it's important to get it "as right as possible". On Wednesday 22 February 2017 06:25:24 Richard Jackson wrote: > The app lists

Re: Bug? django.contrib.auth.forms using User model by importing from auth.models instead of get_user_model()

2017-02-22 Thread Davor Lučić
Fair enough, I guess subclassing it makes more sense, I saw that it uses `USERNAME_FIELD`[1] so I assumed it could use the custom model by default too, but I guess you can have completely different models and that could create some confusion. Anyway, sorry to take you time and thanks for quick

Re: A server that runs django

2017-02-22 Thread Tim Graham
Nope, there's nothing wrong with using nginx and Django. On Wednesday, February 22, 2017 at 10:53:45 AM UTC-5, Luvpreet Singh wrote: > > Yeah I am running my django on nginx. I just wanted to make sure that if > I'm doing wrong by doing so? > > > On Tuesday, February 7, 2017 at 1:08:01 AM

Re: Bug? django.contrib.auth.forms using User model by importing from auth.models instead of get_user_model()

2017-02-22 Thread Tim Graham
The documentation says you need to rewrite UserCreationForm for a custom user model: https://docs.djangoproject.com/en/stable/topics/auth/customizing/#custom-users-and-the-built-in-auth-forms. On Wednesday, February 22, 2017 at 11:06:14 AM UTC-5, rebus wrote: > > Hello, > > I have issues using

Bug? django.contrib.auth.forms using User model by importing from auth.models instead of get_user_model()

2017-02-22 Thread Davor Lučić
Hello, I have issues using custom user model and forms from contrib.auth.forms When using `UserCreationForm` it says `auth_user table does not exists` which is expected since i have different user model. Looking at the code, some pieces of code use `get_user_model` and `UserModel` while model

Re: Initial data, tests and migrations

2017-02-22 Thread Tim Graham
I'm not trying to be antagonistic, sorry if I came off that way. I wanted to point out the difficulties that Django encountered trying to provide "integration" tests like django-otp does. As others suggested, if django-otp provided tools to build your own integration tests, that might be a

Re: A server that runs django

2017-02-22 Thread Luvpreet Singh
Yeah I am running my django on nginx. I just wanted to make sure that if I'm doing wrong by doing so? On Tuesday, February 7, 2017 at 1:08:01 AM UTC+5:30, Dário Carvalho wrote: > > Hi everyone. So, I now understand a little more about how django works and > I was thinking about how can I run a

Re: A server that runs django

2017-02-22 Thread Tim Graham
Sure, do a web search for "nginx django" to find instructions. On Wednesday, February 22, 2017 at 10:41:07 AM UTC-5, Luvpreet Singh wrote: > > Well, I completely agree with you. But can we use Nginx servers? > > > On Tuesday, February 7, 2017 at 1:08:01 AM UTC+5:30, Dário Carvalho wrote: >> >> Hi

Re: Django template language resolve url

2017-02-22 Thread Luvpreet Singh
Iudovic is right, your syntax is wrong. use {% url 'ytlinks:save_ytlinks' %} the original syntax is , {% url 'namespace:url_name' arguments %} On Thursday, February 16, 2017 at 9:42:14 PM UTC+5:30, xyron wrote: > > Code hier eingeben... > > Hey there, > > I'm searching since more than 12 hours

Re: A server that runs django

2017-02-22 Thread Luvpreet Singh
Well, I completely agree with you. But can we use Nginx servers? On Tuesday, February 7, 2017 at 1:08:01 AM UTC+5:30, Dário Carvalho wrote: > > Hi everyone. So, I now understand a little more about how django works and > I was thinking about how can I run a site built with django in my own >

Re: Initial data, tests and migrations

2017-02-22 Thread Melvyn Sopacua
On Wednesday 22 February 2017 15:13:47 'Tom Evans' via Django users wrote: > These tests exercise parts of django_otp that interact with parts of > my code. Successful tests indicate that those two parts interoperate > correctly. The tests are successful when run individually, but fail > when run

Re: Models/Foreign Keys best practice

2017-02-22 Thread Luvpreet Singh
Hi Richard, I am facing a difficulty here. Can you please tell me that how to iterate over this queryset , performance.ensemble_set.all() ?? Thanks. On Wednesday, February 22, 2017 at 7:55:24 PM UTC+5:30, Richard Jackson wrote: > > Hi all, > > I'm putting together my first app, closely

Re: Initial data, tests and migrations

2017-02-22 Thread Adam Stein
On Wed, 2017-02-22 at 15:06 +, 'Tom Evans' via Django users wrote: > On Wed, Feb 22, 2017 at 2:41 PM, Adam Stein wrote: > > > > On Wed, 2017-02-22 at 14:22 +, 'Tom Evans' via Django users > > wrote: > > > > The URL you refer to mentions about loading data for apps.

Re: Initial data, tests and migrations

2017-02-22 Thread Melvyn Sopacua
On Wednesday 22 February 2017 14:22:36 'Tom Evans' via Django users wrote: > On Wed, Feb 22, 2017 at 12:47 AM, Melvyn Sopacua wrote: > > On Tuesday 21 February 2017 19:00:42 'Tom Evans' via Django users wrote: > >> What is the "correct" way of ensuring that these

Re: Initial data, tests and migrations

2017-02-22 Thread 'Tom Evans' via Django users
On Wed, Feb 22, 2017 at 2:40 PM, Tim Graham wrote: > I'm curious if you feel that running django_otp's tests as part of your > project's tests is adding value. I'm curious whether you think I commonly spend my time doing things that I don't think add value... django_otp is

Re: Initial data, tests and migrations

2017-02-22 Thread 'Tom Evans' via Django users
On Wed, Feb 22, 2017 at 2:41 PM, Adam Stein wrote: > On Wed, 2017-02-22 at 14:22 +, 'Tom Evans' via Django users wrote: > > The URL you refer to mentions about loading data for apps. Doesn't mention > anything in regards to tests. Why are fixtures bad for tests? In fact,

Using Django Channels to subscribe to a Redis channel

2017-02-22 Thread Jochen Breuer
Hi! I'm not entirely sure where to start and I hope you can help me. I'm using SaltStack to execute tasks on minions. The results of those jobs (that's the term used in Salt) are then published to a job cache. In this case its a Redis server (Redis Pubsub). Now I would like to subscribe to a

Re: Initial data, tests and migrations

2017-02-22 Thread Tim Graham
I'm curious if you feel that running django_otp's tests as part of your project's tests is adding value. All third-party apps that I've used (including tests for django.contrib apps*) have moved their tests to a separate directory so that they're not installed along with the application. It's

Re: Initial data, tests and migrations

2017-02-22 Thread Adam Stein
On Wed, 2017-02-22 at 14:22 +, 'Tom Evans' via Django users wrote: > On Wed, Feb 22, 2017 at 12:47 AM, Melvyn Sopacua > om> wrote: > > > > On Tuesday 21 February 2017 19:00:42 'Tom Evans' via Django users > > wrote: > > > > > > > > > > > > Previously, these instances were loaded from a

Models/Foreign Keys best practice

2017-02-22 Thread Richard Jackson
Hi all, I'm putting together my first app, closely modelled on the Django tutorial, and wanted some advice regarding when to split the various models into different foreign keys. The app lists performances, who's performing, what my role is with them (i.e. conductor, pianist etc.), the venue

Re: Initial data, tests and migrations

2017-02-22 Thread 'Tom Evans' via Django users
On Wed, Feb 22, 2017 at 12:47 AM, Melvyn Sopacua wrote: > On Tuesday 21 February 2017 19:00:42 'Tom Evans' via Django users wrote: > > > >> Previously, these instances were loaded from a JSON fixtures file, > > > > And you can still do that. > > > >> which used to be the

RE: Looking for Django tutorial that illustrates master/detail data models

2017-02-22 Thread Matthew Pava
I recommend taking a look at Formsets and, in particular, Inline Formsets. The documentation: ModelForms: https://docs.djangoproject.com/en/1.10/topics/forms/modelforms/ ModelFormsets: https://docs.djangoproject.com/en/1.10/topics/forms/modelforms/#model-formsets InlineFormsets:

Re: Is this possible with Django, new to this!

2017-02-22 Thread Melvyn Sopacua
Hi, Being modern is hardly ever a good reason to undertake a project and it shows in how you set your requirements. If however: * You have time to spare and want to learn how to create a web application * Requirement of the project is that everyone should always have access to the

Re: Is this possible with Django, new to this!

2017-02-22 Thread Francis Sunday
I think that is possible with Django On Wednesday, February 22, 2017 at 1:15:15 PM UTC+1, ushills wrote: > > Hi, looking for some advice regarding what's possible with Django before I > go too far. > > Can I create a view into a database with approximately 20 fields that > allows be to drill

Re: extend Media in custom template tag

2017-02-22 Thread guettli
I see replies. Now I am unsure what happened: - nobody read my question - someone read it, but did not understand it - someone read it, understood it, but had no solution. - ... other. Just for the records, here the related StackOverflow question:

Re: extend Media in custom template tag

2017-02-22 Thread guettli
I see replies. Now I am unsure what happened: - nobody read my question - someone read it, but did not understand it - someone read it, understood it, but had no solution. - ... other. Am Montag, 9. Mai 2016 10:25:49 UTC+2 schrieb guettli: > > I have a custom Django template tag which

Is this possible with Django, new to this!

2017-02-22 Thread ushills
Hi, looking for some advice regarding what's possible with Django before I go too far. Can I create a view into a database with approximately 20 fields that allows be to drill down into each row and that allows me to view and enter transactional information and view an audit path for how

Privacy settings like Facebook in Django.

2017-02-22 Thread Alex Richards
I want to implement privacy settings on my extended UserProfile Model where the user can decide who can see his field (say email for now). The options looks something like this, *public* - any one can view his email *friends_of_friends* - only friends and friends of friends can view his email

How do I implement a Facebook like privacy settings for extended User?

2017-02-22 Thread Alex Richards
I have an extended UserProfile to which I want to add some privacy settings as in Facebook. the options for a single field (say email for now) should be, *public *- any one can view his email *friends_of_friends* - only friends and friends of friends can view his email *friends *- only his

Registration form

2017-02-22 Thread RISHABH BANSAL
How can i add registration.backends.hmac,urls> tell the complete procedure -- 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

Re: Django-channels disconnects right after sending a message

2017-02-22 Thread Nikoleta Misheva
I tried it and it works fine, but as soon as I try to hang this to a button it disconnects, so this line $('#arg_form').on('submit',function () is the problem, if I send message without hanging it to a button submit function it is ok with or without JSON.stringify сряда, 22 февруари 2017 г.,