Re: Limiting choices in a lookup by exclusion

2017-01-31 Thread C. Kirby
django doesn't have an ne operator in the orm. You want to use a negated Q object for your limit_choices_to. try: from django.db.models import Q phone = models.ManyToManyField(Phone, limit_choices_to = ~Q(type_id = 'C')) On Wednesday, February 1, 2017 at 6:17:52 AM UTC+2, Gordon Burgess wrote:

Re: Link to urls containing slug

2017-01-31 Thread 'David Turner' via Django users
Hi Matthew I think I might not have explained my issue fully. Within my jobs models.py I have the following: def get_absolute_url(self): kwargs = { 'job_id': self.job_id, 'slug': self.slug, } return reverse('job_detail', kw

Re: Django 1.9 ./manage.py migrate error

2017-01-31 Thread Owen Chung
That works for me. You save my life. Thank you! On Friday, June 3, 2016 at 12:26:04 PM UTC-4, Tejesh Papineni wrote: > > its working when already have a db because views.py are using Models from > already existing db. But when creating new db, code in views.py is trying > to access Models that h

Limiting choices in a lookup by exclusion

2017-01-31 Thread Gordon R. Burgess
I have this code, and with Django 1.10 it works as expected: class Location(models.Model): name = models.CharField(max_length = 32, unique = True) street = models.CharField(max_length = 32) detail = models.CharField(max_length = 32, blank = True, null = True) city = models.CharFie

Re: Send mail bug needs password passed as bytearray

2017-01-31 Thread elliot
Really? I should look at moving to python 3 but my understanding was that python 2.7 would be supported until Django 2.0 according to the docs On Wednesday, February 1, 2017 at 1:21:21 PM UTC+13, Tim Graham wrote: > > Oh, I see, you're using

Re: video tutorial dating site

2017-01-31 Thread 'Aaron C. de Bruyn' via Django users
One of the first results when Googling 'Django video tutorials' is this: https://www.quora.com/Are-there-any-good-Django-video-tutorials There are many links provided there. -A On Tue, Jan 31, 2017 at 5:28 PM, wrote: > am new using python(django) i built an app lately but i want to build a > d

video tutorial dating site

2017-01-31 Thread engrosswebhost
am new using python(django) i built an app lately but i want to build a dating site using django. I will be comfortable with video tutorials. Any help please??? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and

Re: Send mail bug needs password passed as bytearray

2017-01-31 Thread Tim Graham
Oh, I see, you're using bytearray to try to workaround the issue. Well, Django master no longer supports Python 2.7, that's why force_str() was removed. Is there a problem with Django master and Python 3? On Tuesday, January 31, 2017 at 7:16:41 PM UTC-5, ell...@makecollective.co.nz wrote: > > N

Re: Send mail bug needs password passed as bytearray

2017-01-31 Thread elliot
Neither. I haven't seen anything with webfaction and I have used webfaction in the past on several projects and not had any trouble. On Wednesday, February 1, 2017 at 12:12:56 PM UTC+13, Tim Graham wrote: > > I've never seen a password as a bytearray. Is there webfaction > documentation about t

Re: Send mail bug needs password passed as bytearray

2017-01-31 Thread Tim Graham
I've never seen a password as a bytearray. Is there webfaction documentation about this? On Tuesday, January 31, 2017 at 6:06:04 PM UTC-5, ell...@makecollective.co.nz wrote: > > myMail = EmailMessage('subject', 'message', 'some...@address.com > ', ['mye...@address.com ']) > myMail.send() > > Th

Send mail bug needs password passed as bytearray

2017-01-31 Thread elliot
myMail = EmailMessage('subject', 'message', 'someem...@address.com', ['myem...@address.com']) myMail.send() The error I'm getting: File "/Users/Elliot/.virtualenvs/allright/lib/python2.7/site-packages/django/core/mail/message.py" , line 342, in send return self.get_connection(fail_silent

Re: How to make django sqlite database connection readonly.

2017-01-31 Thread joeg
You just need to read doc: https://docs.djangoproject.com/en/1.10/topics/db/multi-db/ 在 2017年1月31日星期二 UTC+13上午5:19:02,Chetan Gupta写道: > > Hi, > > I am new to django. > My requirement is django application i have 3 db connection. > I want 2 db connection is readonly. > > Please let me know how to

Making email required

2017-01-31 Thread Larry Martell
I want to make the email field required in the user admin add and change pages. Following some posts I read on stackoverflow I did this: class MyUserCreationForm(UserCreationForm): def __init__(self, *args, **kwargs): super(MyUserCreationForm, self).__init__(*args, **kwargs) #

Re: Django Channels alongside Django Rest Framework

2017-01-31 Thread Andrew Godwin
Hi Adam, The two should be able to coexist without any problem. If you put channels into INSTALLED_APPS then "runserver" is actually running Daphne already anyway, so it's worth noting if that's the case. You have two options: - Run everything via Daphne, which will serve both HTTP and WebSocket

formset in form_class

2017-01-31 Thread schaf . mh
Hi All, in a view deriving from UpdateView the form_class attribute gets assigned with a formset. the View then overrides the get_form function. class RLFormView(LoginRequiredMixin, StaffuserRequiredMixin, UpdateView): template_name = 'abc/layout.html' form_class = LayoutFormSet fields

Web-based Voting System for our capstone project

2017-01-31 Thread Genaro Lubong
I just want to ask, how can I customize my admin page and make some dashboard about the students(who have already voted and those who haven't yet), colleges and everything in my web app. As well as, how to print reports. I am very willing to be taught and learn from you guys, I am just a newbie to

RE: Link to urls containing slug

2017-01-31 Thread Matthew Pava
Hi David, Please make sure you have a get_absolute_url method on your JobApplication model in order for that to work and that you passing job_application in through the context in the template. If you don’t have that method, you could use the {% url %} tag, but you would have to provide the pk a

Re: creating models but its not showing in db

2017-01-31 Thread rajanmandanka
please confirm whether you register your app in INSTALL_APP in settings.py file. python manage.py makemigrations python manage.py migrate On Tuesday, January 31, 2017 at 9:38:34 PM UTC+5:30, Kazi Atik wrote: > > Hi i am creating a table in my model but its not showing in my sqlite.db > fi

Re: creating models but its not showing in db

2017-01-31 Thread Александр Христюхин (roboslone)
Did you run makemigrations first and then migrate? Also, do you have any instances of your model? > On 31 Jan 2017, at 19:08, Kazi Atik wrote: > > Hi i am creating a table in my model but its not showing in my sqlite.db > files i also run migrate command and makemigration > Here is my code >

creating models but its not showing in db

2017-01-31 Thread Kazi Atik
Hi i am creating a table in my model but its not showing in my sqlite.db files i also run migrate command and makemigration Here is my code from django.db import models

Re: Link to urls containing slug

2017-01-31 Thread 'David Turner' via Django users
I had tried that but unfortunately it doesn't work but thanks anyway. On 31/01/2017 14:57, Matthew Pava wrote: > > Assuming I’m understanding your question correctly, all you need to do > is reference get_absolute_url in your template. > > Something like so: > > > > {{ job_application }} > >

RE: Link to urls containing slug

2017-01-31 Thread Matthew Pava
Assuming I’m understanding your question correctly, all you need to do is reference get_absolute_url in your template. Something like so: {{ job_application }} From: 'dtdave' via Django users [mailto:django-users@googlegroups.com] Sent: Tuesday, January 31, 2017 8:46 AM To: Django users Subject:

Re: How can I solve the broken home page in the root folder?

2017-01-31 Thread Thames Khi
Thank you very much. I added the following to main site urls.py: url(r'^$', views.home, name='home'), and added the following to the /data/views.py file. def home(request): return HttpResponse("Main Page") This somewhat makes sense, just wondering why the main site does not require a views.py

Link to urls containing slug

2017-01-31 Thread 'dtdave' via Django users
Within my model I have the following that links through to a detail page. def get_absolute_url(self): kwargs = { 'job_id': self.job_id, 'slug': self.slug, } return reverse('job_detail', kwargs=kwargs) Ev

Re: How can I solve the broken home page in the root folder?

2017-01-31 Thread ludovic coues
Try "url(r'^/', include('data.urls'))," in url_patterns. This should do what you want. Alternatively, you can set a simple view on r'^$' that will redirect to your main app. On 31 Jan 2017 1:09 p.m., "Thames Khi" wrote: I followed a simple tutorial to create a sample application in DJango. Her

Re: Can any one help me with this error "Page not found (404)" ?

2017-01-31 Thread ludovic coues
Could you share your urls.py files and the actual error you get ? On 31 Jan 2017 1:09 p.m., "Thames Khi" wrote: Once the polls app is created there is no reference to the root /project site! On Wednesday, April 27, 2011 at 1:48:17 PM UTC+1, Oleg Lomaka wrote: > > Go on read 3rd part of tutorial

Re: I have problem in when submitting song_form

2017-01-31 Thread Александр Христюхин (roboslone)
Hi, it's your model, you probably have "album" field, that is required and not filled by a view. > On 31 Jan 2017, at 14:35, sridhar chary wrote: > > I don't no where i made mistake > > DETAIL.HTML > > > {% extends 'music/base.html'%} > {% block title %}Album detail{%endblock%} > {% block bo

How can I solve the broken home page in the root folder?

2017-01-31 Thread Thames Khi
I followed a simple tutorial to create a sample application in DJango. Here is my code for urls.py in the root folder: from django.conf.urls import url, include from django.contrib import admin #from data import views urlpatterns = [ url(r'^data/', include('data.urls')), url(r'^admin/', adm

Re: Can any one help me with this error "Page not found (404)" ?

2017-01-31 Thread Thames Khi
Once the polls app is created there is no reference to the root /project site! On Wednesday, April 27, 2011 at 1:48:17 PM UTC+1, Oleg Lomaka wrote: > > Go on read 3rd part of tutorial about urls.py configuration > http://docs.djangoproject.com/en/dev/intro/tutorial03/ > > > On Wed, Apr 27, 2011 a

Django Channels alongside Django Rest Framework

2017-01-31 Thread adam . oxley
Hi everyone, We are currently considering using Django Channels for implementing WebSockets into a project. I am wondering if it is known that Django Channels runs perfectly within the same Django project as DRF? I have spent a little time investigating this myself and could manage to get DRF

Re: Django 1.10 with Python 3.5 on Mac with Fink

2017-01-31 Thread Alan
Found the problem, a old wrongly set DJANGO_SETTINGS_MODULE pointing to the offending module. On 30 January 2017 at 22:49, Alan wrote: > So I installed django 1.10 and then when I try to do this; > > python3.5 -m django --version > > Traceback (most recent call last): > File "/sw/lib/python3.5