Re: Jasper Reports

2007-06-12 Thread Joel

I went down the exact same path as you.  I wanted to use Jasper/iReport
with Django.  In the end, it ended up being easier just using Report Lab
which has produced some very nice results.  I do miss iReport, but for
our purposes we didn't need a graphical editor for the reports on this
project - they were very custom.

It's nice that ReportLab integrates tightly with Django.  I think that
trying to use Jasper would have been a kludge at best.

-- Joel

[EMAIL PROTECTED] wrote:
> Has anyone successfully used Jasper Reports on the server being called
> from a Django view?
> 
> I've done a few things with ReportLab, but we have the need for a
> graphical Report Designer, which I don't believe exists for Report
> Lab...so we were talking about the possibiltiy of using Jasper
> Reports...thought I'd see if anyone had done this before?
> 
> 
> > 
> 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: How to setup Django on Apache with correct rights and owners

2007-06-20 Thread Joel


> If you are not going to modify your application directories/files
> through apache, a read permission for apache would be sufficient. 

Is this correct?  I'm under the impression apache needs write access to
the directories so it can create the pyc files.  Otherwise you're going
to have really poor performance since the py files will have to compiled
each page request.  (Unless you're uploading the pyc files along with
the py files??)

I've been struggling with this issue lately... I'm glad to be proven
wrong and/or shown the correct way to do it.

-- Joel

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: When 1.0 ?

2007-09-10 Thread Joel

I suspect you'll find many of those on django-users prefer django over
other frameworks.  Go to a turbogears user group and you might get
another opinion.  I happen to like Django over all of the other
frameworks I've used.


est wrote:
> Hi I am a new web developer in django. Could anyone tell me when will
> django go to 1.0? Will django support py3k? Is django worth learning
> compared with other web frameworks like turbogears, RoR?
> 
> 
> > 
> 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: IDE

2008-03-06 Thread Joel

Two thumbs up for Eclipse+PyDev.

Plus all the other Eclipse goodies:
* Source control integration
* Aptana for CSS, JS, and HTML editing

PyDev even has a for-pay python debugger, although I don't use it.

-- Joel

Peter Danielczyk wrote:
> I agree with casseen.
> 
> Eclipse & Pydev works great for Django.
> 
> See
> http://pydev.blogspot.com/2006/09/configuring-pydev-to-work-with-django.html
> for intructions.
> 
> BTW: " is a memory hungry monster " --> 1 Gig RAM is 20-25 Dollars :-)
> 
> 
> 
> 
>> I use eclipse + pydev. Eclipse is a memory hungry monster( it's java
>> based after all), but in my opinion its still the best free and open
>> IDE out there. And its platform independent which is a double extra
>> plus for eclipse.
>>
>> I see no use for a dedicated django plugin. Any python supporting IDE
>> should work fine. Try some different IDEs and see which one fits your
>> personal requirements best.
>>
>> By the way the _free_ eclipse/pydev debugger works like a treat with
>> django.
>>
>> On Mar 6, 9:24 am, Jarek Zgoda <[EMAIL PROTECTED]> wrote:
>>> gabriel napisa³(a):
>>>
>>>> I am at the point of changing IDE before my next project ( a huge one
>>> ).
>>>> So far I've used Geany for python but now I am supposed to use django.
>>>> Is it anythong with special support for Django??
>>>> I know that recommendations include SPE and Eclipse but I wonder if
>>> you
>>>> happened to work with IDE with a nice django support - does anything
>>>> alike exist??
>>> I use PIDA (http://pida.co.uk/). While it has no explicit Django
>>> support, embedded Vim pleases me enough (Vim syntax coloring for Django
>>> templates is enough for me --
>>> seehttp://www.vim.org/scripts/script.php?script_id=1487).
>>>
>>> Other options I tried was Komodo Edit (nice project management) and Kate
>>> (overall good editor, but project management plugin is a PITA), but
>>> neither one appealed to me.
>>>
>>> --
>>> Jarek Zgoda
>>> Skype: jzgoda | GTalk: [EMAIL PROTECTED] | voice: +48228430101
>>>
>>> "We read Knuth so you don't have to." (Tim Peters)
>>>
>>
> 
> 
> > 
> 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



IOError with Apache/mod_python

2008-05-05 Thread Joel

A symptom has just developed on our production server
(Apache/mod_python/Python 2.3).

Sporadically, a 'print' statement (used for logging during development)
will fail with the following error:

exceptions.IOError
[Errno 9] Bad file descriptor

In Django development, 'print' statements go to the console.  I don't
know where the print statements are going to under mod_python, though.
I'm sure the end solution is to use a better logging mechanism but I'm
really curious why a print statement would crash the app with the error
above.

It's especially odd that this only happens every hundred requests or so.

Thanks for helping!
-- Joel

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Integrating Jasper reports / Reporting in general ??

2007-04-09 Thread Joel

I saw that someone has let Ruby use JasperReports with a simple script:

http://wiki.rubyonrails.org/rails/pages/HowtoIntegrateJasperReports

I would love to use Jasper Reports because we use it on other (Java and
PHP) projects and it has a great, free report editor
(http://jasperforge.org/sf/wiki/do/viewPage/projects.ireport/wiki/Screenshots)

Has anyone seen something like this for Python?  Or even Django?  I want
to avoid re-writing something that's already been done.

In general, what are you using for your PDF-reporting needs?

Thanks!
-- Joel

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Integrating Jasper reports / Reporting in general ??

2007-04-09 Thread Joel

Ahh - forget it.  I looked further into ReportLab and found out just how
impressive it is.

-- Joel

Joel wrote:
> I saw that someone has let Ruby use JasperReports with a simple script:
> 
> http://wiki.rubyonrails.org/rails/pages/HowtoIntegrateJasperReports
> 
> I would love to use Jasper Reports because we use it on other (Java and
> PHP) projects and it has a great, free report editor
> (http://jasperforge.org/sf/wiki/do/viewPage/projects.ireport/wiki/Screenshots)
> 
> Has anyone seen something like this for Python?  Or even Django?  I want
> to avoid re-writing something that's already been done.
> 
> In general, what are you using for your PDF-reporting needs?
> 
> Thanks!
> -- Joel
> 
> > 
> 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Calling templates within templates - a'la Mason

2005-12-12 Thread Joel

I gave django a try at work to develop a survey application. Turned out
pretty sweet, I felt very productive and spent most of my time
concentrating on survey tasks. I felt frustrated twice, these are the
hurdles I faced that I feel I have probably missed obvious solutions

- Parsing data from the users. I decided not to use the admin framework
to get the answers from the questions. I needed fine grained control
over user input and it looked too complicated and not geared towards
what I was doing. So I made my own function that turned the ID's of
checkboxes, radio buttons etc, into ID's to lookup in the question
table. It worked o.k. but was a bit of a hack in parts.

- Printing questions. I wanted to have a question template that defined
how questions should be printed, then I could print them in multiple
contexts. Except I couldn't find an easy way to do this. I saw I could
define a filter and pass the question object into a "printQuestion"
filter but this seemed counterintuitive. Perhaps I could have
pre-rendered and passed rendered questions to the templates but this
didn't seem right either. When I used Mason we componentized everything
and plugged bits and pieces back together in all kinds of ways.
Obviously, to get that level of control you need to have code at the
template level, and I understand django's aims of moving the code away
from the templates (and I agree with it). What is the right way to
define a standard way you want an object to be printed?

One more quick one, sometimes I wanted data in the objects but not in
the tables. What I wanted was to have an error message associated with
each Question, but I didn't want that stored in the database. How would
you do that?

Django  is an awesome project. I have been spreading the word. 

Joel



Unexpected behavior with icontains in query filter

2018-08-10 Thread Joel
I'm trying to do a case insensitive search for a substring within a field 
in my model.

My model:


class doctor(models.Model):
docid = models.AutoField(primary_key=True, unique=True) # Need 
autoincrement, unique and primary
name = models.CharField(max_length=35)
username = models.CharField(max_length=15)
regid = models.CharField(max_length=15, default="", blank=True)
photo = models.CharField(
max_length=35, default="", blank=True)
email = models.EmailField(default="", blank=True)
phone = models.CharField(max_length=15)
qualifications = models.CharField(
max_length=50, default="", blank=True)
about = models.CharField(
max_length=35, default="", blank=True)
specialities = models.CharField(
max_length=50, default="", blank=True)
department = models.CharField(max_length=50, default="ENT", blank=
True)
fees = models.FloatField(default=300.0)
displayfee = models.IntegerField(default=0, blank=True)
slotrange = models.CharField(max_length=50, blank=True)
slotdurn = models.IntegerField(default=10)
breakrange = models.CharField(
max_length=50, default="", blank=True)
slotsleft = models.CharField(
max_length=50, default="", blank=True)
def __str__(self):
return self.name
def Range(self):
return self.slotrange
def listslots(self):
SlotRange = self.slotrange
SlotDurn = self.slotdurn
startime = SlotRange.split('-')[0]
endtime = SlotRange.split('-')[1]
sthr, stmin = SplitTimeString(startime)
enhr, enmin = SplitTimeString(endtime)
print(stamptoday(sthr, stmin))
print(stamptoday(enhr, enmin))
startstamp = stamptoday(sthr, stmin)
endstamp = stamptoday(enhr, enmin)
secdurn = SlotDurn*60
slotlist = []
for sec in range(startstamp, endstamp, secdurn):
enttime = sec + secdurn
myrange = ("%s - %s" % (HumanTime(sec),
HumanTime(enttime)))
slotlist.append(myrange)
    return slotlist


Under the field 'name' in my mysql database, are two rows with values for 
name as 'Joel' and 'Jaffy Joel'.

When I do the search like this:


from appointments.models import customer, doctor, appointment
doctor.objects.filter(name__icontains='joel')


Output:





But when I do:

doctor.objects.filter(name__icontains='Joel')



Output:

   
 , ]>


Why isnt the case insensitive search working for a lowercase search?

I'm on django 2.0.7

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/46579c92-8a12-4977-814c-9c3fcaa14711%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Compiling django filters into a variable and executing it at runtime?

2018-08-15 Thread Joel
I'm trying to write a search function for my model.
A customer has the following fields:

cstid = models.AutoField(primary_key=True, unique=True)
name = models.CharField(max_length=35)
age=models.IntegerField()
gender = models.CharField(max_length=10, default='')
mobile = models.CharField(max_length=15, default='')
email = models.CharField(max_length=50, default='')
address = models.CharField(max_length=80, default='')
city = models.CharField(max_length=25, default='')

My html form will submit the following data by POST via an ajax call to django:

var data = {
"name": name,
"age": age,
"email": email,
"address": address,
"phone": phone,
"city": city
};
data = $(this).serialize() + "&" + $.param(data);

These will be verified in the django view, and a search query
performed, as below:

def searchpat_for_docwise_appt (request):
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Q
from django.db.models import CharField
from django.db.models.functions import Lower
CharField.register_lookup(Lower, "lower")
if request.method == 'POST':
name = request.POST.get('name')
age = request.POST.get('age')
# gender = request.POST.get('gender')
phone = request.POST.get('phone')
email = request.POST.get('email').lower()
address = request.POST.get('address')
city = request.POST.get('city')
if age.isdigit():
ANDSearchResult =
customer.objects.filter(name__lower__contains=name.lower(), age=age,
mobile__contains=phone, email__lower__contains=email.lower(
), address__lower__contains=address.lower(), city__lower__contains=city.lower())
else:
ANDSearchResult =
customer.objects.filter(name__lower__contains=name.lower(),
mobile__contains=phone, email__lower__contains=email.lower(
), address__lower__contains=address.lower(), city__lower__contains=city.lower())
if len(ANDSearchResult) < 1:
errmsg = 'No search results for AND search'
print("Error message is <%s>" % errmsg)
else:
print ("ANDSearchResult is <%s>" % ANDSearchResult)
errmsg = ''

if age.isdigit():
ORSearchResult = customer.objects.filter(
Q(name__lower__contains=name.lower()) | Q(age=age) | Q(
mobile__contains=phone) | Q(email__lower__contains=email.lower()) |
Q(address__lower__contains=address.lower()) |
Q(city__lower__contains=city.lower()))
else:
ORSearchResult = customer.objects.filter(
Q(name__lower__contains=name.lower()) | Q(
mobile__contains=phone) | Q(email__lower__contains=email.lower()) |
Q(address__lower__contains=address.lower()) |
Q(city__lower__contains=city.lower()))
if len(ORSearchResult) < 1:
errmsg = errmsg + 'No search results for OR search'
print("Error message is <%s>" % errmsg)
else:
print ("ORSearchResult is <%s>" % ORSearchResult)
print(errmsg)
return HttpResponse(errmsg)
else:
errmsg = 'No correct POST request. No valid response.'
print("Error message is <%s>" % errmsg)
return HttpResponse(errmsg)

As you can note above, I am doing two different queries
simultaneously. I want an AND operator like query where search has to
satisfy all input parameters. I also need an OR operator which should
provide a result if any of the fields matches the entered string for
the corresponding field. By this I mean that if a patient has a name
Jeff with age 56, and a patient Kane with age 23; and I enter jef in
the name field and 23 in the age field, both should be listed.

The problem arises when there are empty strings in the search boxes.
An OR search with an empty string gives all objects as results.
Obviously I dont want to return a patient record just because my
search strings are null.

Other than the long winded solution of checking for all combinations
of search queries like this:

if (name != '' and age != '' and phone != '' and email != '' and
address != '' and city != '':
ORSearchResult =
customer.objects.filter(Q(name__lower__contains=name.lower()) |
Q(age=age) | Q(mobile__contains=phone) |
Q(email__lower__contains=email.lower()) |
Q(address__lower__contains=address.lower()) |
Q(city__lower__contains=city.lower()))
elif (age != '' and phone != '' and email != '' and address != '' and
city != '':
ORSearchResult = customer.objects.filter(Q(age=age) |
Q(mobile__contains=phone) | Q(email__lower__contains=email.lower()) |
Q(address__lower__contains=address.lower()) |
Q(city__lower__contains=city.lower()))
elif (phone != '' and email != '' and address != '' and city != '':
ORSearchResult = customer.objects.filter(Q(mobile__contains=phone) |
Q(email__lower__contains=email.lower()) |
Q(address__lower__contains=address.lower()) |
Q(city__lower__contains=city.lower()))

 Other permutations ...

What is a better solution?
An obvious idea that comes to mind is, to try to compile these filters
into a variable and pass it to the filter function. Am I on the right
track? How can I do this?

-- 
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 post to this

Re: text editor

2018-09-02 Thread Joel
One can carry on discussion about something as subjective as "best text
editor" for days and still not be done. IMO, this is a silly question to be
asking in a django group.

On Mon 3 Sep, 2018, 3:16 AM victor jack,  wrote:

> More like vim and vs code are the best editors
>
> On Sun, 2 Sep 2018 06:51 RONAK JAIN,  wrote:
>
>> Atom is best editor.
>>
>> On Sun, 2 Sep 2018, 11:11 a.m. sankar ardhas, 
>> wrote:
>>
>>>
>>> Hi to all,
>>> Which is the best editor for django framework  in Ubuntu os
>>> 18.04
>>>
>>> Get Outlook for Android 
>>>
>>>
>>>
>>>
>>> On Sun, Sep 2, 2018 at 1:46 AM +0530, "RONAK JAIN" <
>>> jainronak...@gmail.com> wrote:
>>>
>>> Namaste !!

 Dear ,

 I have two models categories and Project.

  created like that :

 class Category(models.Model):
 categorys = models.ManyToManyField('Category',blank=True)
 name = models.CharField(max_length=100)
 created_at = models.DateTimeField(auto_now=False, auto_now_add=True)
 updated_at = models.DateTimeField(auto_now=True)



 class Meta:
 verbose_name_plural = "Categories"

 def __str__(self):
 return self.name

 def __unicode__(self):
 return self.categorys

 class Project(models.Model):
 categorys = models.ManyToManyField('Category',blank=True)
 name = models.CharField(max_length=100)
 description = models.CharField(max_length=100)
 created_at = models.DateTimeField(auto_now=False, auto_now_add=True)
 updated_at = models.DateTimeField(auto_now=True)
 photo = models.ImageField(upload_to="pictures")


 def __str__(self):
 return self.name

 def __unicode__(self):
 return self.categorys

 *and Views I did here :*

 *from web.models import Category,Project*

 class Portfolio(TemplateView):
 template_name = "web/protfolio.html"

 def post(self, request, *args, **kwargs):
 context = self.get_context_data()
 return super(TemplateView, self).render_to_response(context)

 def portfolio(request):
   context = RequestContext(request)
   # Project_list = Project.objects.order_by('-likes')[:3]
   # context_dict = {'Project': project_list}
   # return render(template_name, context_dict, context
   brand_list = Category.objects.all()
   return render(template_name, {'brand_list' : brand_list},
 context)

 *I need correct relationship both I mean project and categories. How
 can I do correct here ? *
 Note : I attached picture please analyse briefly.

 How to do approch html page and   I want  the html(view) page should
 load from our db.
 please give me quickly answer.
 How can i do ?


 Thanks
 Ronak

 --
 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 post to this group, send email to django-users@googlegroups.com.
 Visit this group at https://groups.google.com/group/django-users.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/63ecd6f1-411a-4581-b245-296efbd49303%40googlegroups.com
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>> --
>>> 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 post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/39ABAA35669F59A4.eb8de1ab-f7fe-4f09-ac86-ab24def151d1%40mail.outlook.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.goog

Re: How do I display the human readable name of a choice?

2018-09-06 Thread Joel
This is clearly described in the polls application tutorial.
https://docs.djangoproject.com/en/2.1/intro/tutorial01/

On Thu 6 Sep, 2018, 9:38 PM Ousseynou Diop,  wrote:

> Hi friend ,
>
> use this function to display the choices field.
>
> models.py
>
>
> class Article(models.Model):
>
> ARTICLE_CHOICES = (
>
> )
>
>
> status = models.CharField(max_length=120, choices=ARTICLE_CHOICES, )
>
> in your templates
>
> {% article in articles %}
>
> {{artcile.get_status_display}}
>
>
> {% endfor %}
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/c308257a-1140-41a8-9ea9-9a051963a242%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw__rWAjNixS8VbsLtHQaddmfgLRgmCx73b4uTwYbeg1DaQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Recreate all tables in mysql after dropping the database

2018-09-17 Thread Joel
Thank you. That is how I fixed it yesterday late night after spending hours
on it.

For anyone else that may find it useful,
I had dropped the tables to fix this. But that ended complaining about
missing tables. Then I dropped the database, since all I had was
development data.
It wouldn't do the makemigrations, still complaining about missing columns.
I deleted migration files, pycache.. Nothing helped.
Finally, I commented imports of models and forms in my code, and then ran
python3 manage.py app makemigrations
And then it worked.

On Mon 17 Sep, 2018, 1:04 PM Michal Petrucha, 
wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA512
>
> Hi Joel,
>
> On Sun, Sep 16, 2018 at 10:16:42PM +0530, Joel Mathew wrote:
> > I tried to fix mysql problems in my database by dropping tables. When
> that
> > didnt work, I dropped the database.
> > I then recreated the database, and tried to run makemigrations. But I am
> > getting errors about missing tables:
> >
> > joel@hp:~/myappointments$ python3 manage.py makemigrations
>
> […]
>
> >   File "/home/joel/myappointments/appointments/forms.py", line 68, in
> > 
> > class AddAppointmentFormReadOnly(forms.Form):
> >   File "/home/joel/myappointments/appointments/forms.py", line 70, in
> > AddAppointmentFormReadOnly
> > for doc in doctor.objects.all():
>
> […]
>
> >
> > How can I remove all database data and revert as if to a fresh database.
> > I have tried a rm -rf myappointments/appointments/migrations/*
> >
> > On django 2.1, ubuntu
>
> The immediate problem that you're facing here is that your application
> is making database queries while it is being imported – see line 70 in
> /home/joel/myappointments/appointments/forms.py. You will need to
> rewrite your forms (and any other classes) in such a way that they do
> not query the database while they are being imported, for example by
> making use of ModelChoiceFields, or generating any dynamic choices in
> your views, and/or forms' __init__. Otherwise, if you keep hitting the
> database on import, it will be pretty much impossible for you to set
> up your application in an environment where the database schema does
> not already match your model definitions.
>
> Second, you should treat your migrations as any other code, because
> that's what they are. Treat makemigrations as just a helper to give
> you a starting point when writing migrations, rather than as a magic
> silver bullet to fix all database problems, and once you have a
> migration that does what you want it to do, commit it into the
> revision history of your code base.
>
> Good luck,
>
> Michal
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1
>
> iQIcBAEBCgAGBQJbn1kHAAoJEHA7T/IPM/klAxQQAIRjUj2R5XFOO0Q457AX0mWA
> BM05wwLHEqxR0KxGkkV6M/6IN2qkhD0Sg9AJLTjQBvmKB+0OH85RrOHem85JaoCW
> 3H0vhgukM5yDIcZYNUDephAj6pvjR0gAFmVWPW9PY8+5hHBTkFLLwEAMvL96uNdO
> TVerrRNcDw7QeiihyHa23JPEP9sYd3g9GEH8gtwJQ1q68oGOaNkEbESK8kQIv5hq
> Zu1Dlf01h+dJzZNaKjvMlZJlNsuQNkPxpiuus5mKv/EFWLyIbwqS9r/Uy15NLTo9
> Lg5dLi9mSPr6yDiNI24u/WFQI//YyRIOKc7w6d0DRKPBR7NP3Xw8h7DYOGCpwJns
> xkgw0wqsdRw7Wjblao3TLCcgaYRe11B6YkyxwYMFo0rL/foT9NYD5OCxNwZjmgs/
> 9paC8Ye8SDzamza78WEL9EIBkGjzSUSqgHvBwlMjiHXAEXRDMaFM/vbz+Cb3YFAR
> jEa5LLgBXrfjcVxE+pROBsB+jfgONTo+M9Y/4Xw3WiuDiYxF8FQGBqr3QLcMfIyp
> 4KoHqAN04/yvFtXbZNs7097fNLfi0vhYjRLPqp/HDqYOvS/LIlnHkJ/EJBHK0CqQ
> RRRpS42Sin6Mqoz3XyGOxQFfU3fxUl/lBnwdKAB3IrrOPZQvf7Uw03+CCflOeYFZ
> 8Ksm4yD3EHXidQCYkeDN
> =Uc5m
> -END PGP SIGNATURE-
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/20180917073432.GX1181%40konk.org
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_8MU2PPofg9fAhLuy8Q2HqfV%3DG8CxbjPQPnMdhkhP%2Bt0Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Refer tutorials to make multitenant application with shared database with multiple schma

2018-09-19 Thread Joel
Follow the django tutorial. Once you complete part 2, you can easily start
writing.

https://docs.djangoproject.com/en/2.0/intro/tutorial01/

You don't have to worry too much about schema as you use models.


On Wed 19 Sep, 2018, 12:39 PM Devender Kumar,  wrote:

> Hi,
> I need a help from you I wanna start a project which is a multitenant
> application and I want the tenant can register themselves and schema is
> created for him from the shared database across tenants.
> I want to make this application in Django I know all the terminology of
> how multitenancy can be achieved I just want to how to write the code for
> this as I have never played with schemas and other stuff.
> You refer to any project where I can get an insight, Any tutorial link for
> this project.
> Thanks
> Dev
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/9e3918ae-7e2c-4ee9-9f20-eceb55983c79%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw__dcopPcoVL8r3wg6RoDKHE%3DBvoVyPu%3DZ_R0npqMVZoRQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error running Django tutorial

2018-09-20 Thread Joel
Show the urls.py after adding everything. Note that there must be two
urls.py. One in the project folder, another in the app folder

On Fri 21 Sep, 2018, 12:18 AM Asong nkemzi,  wrote:

> Hello, Ruth did you ever solve this problem? I am experiencing exactly the
> same issue
>
> On Thursday, March 17, 2016 at 4:07:11 PM UTC-4, Ruth wrote:
>>
>> I am getting the very same problem, despite adding include to my
>> mysite\urls.py file.
>> I am using Python 2.7.6, Django 1.9.4 and Ubuntu 14.04.3 LTS
>> Could it be a python 2.7 problem?
>> Thanks,
>> Ruth
>>
>> On Saturday, February 27, 2016 at 11:50:39 AM UTC-8, Mike Kipling wrote:
>>>
>>> I am working through the Django tutorial *Writing your first Django
>>> app, part 1.*
>>> I am using Windows 10, python 3.5.1 and Django 1.9.2 .
>>>
>>> In the *Write your first view* section:
>>> after writing the polls/views.py and polls/urls.py files,
>>> and modifying the manage/urls.py file,
>>> and starting the server,
>>>
>>> When I go to http://localhost:8000/polls/ in the browser I get the
>>> following error:
>>>
>>> Page not found (404)
>>> Request Method: GET
>>> Request URL: http://localhost:8000/polls/
>>>
>>> Using the URLconf defined in mysite.urls, Django tried these URL
>>> patterns, in this order:
>>>
>>>1. ^admin/
>>>
>>> The current URL, polls/, didn't match any of these.
>>>
>> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/778da3c3-92a0-4560-b2e2-7b7d5539ad85%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_8tX_Vr5%3DN95%3DKSGUr6uyzxMB5Dta-FjnqSjg%3DywkO8QA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to add form field dynamically?

2018-09-26 Thread Joel
Describe what you mean by add dynamically. If blocks in templates allow a
great deal of flexibility.

On Wed 26 Sep, 2018, 5:16 PM Django Lover,  wrote:

> I am creating a model form, i need to add a field dynamically can you
> please give me the solution by using your sharp intelligence?
>
> [image: synm.png]
>
>
> Product/service are coming from the model field.they are not static.
>
>
> Add New is unlimited.
>
>
>
> please help
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f144ae51-a036-4aeb-94d5-d058a4067489%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw__1LTyN4jt0R41HRudNFMUwzss%2BL9AdwLQcs8A6Sf6Png%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to add form field dynamically?

2018-09-26 Thread Joel
I don't think django alone can help you here. You need to do that with
JavaScript.

On Wed 26 Sep, 2018, 6:01 PM Django Lover,  wrote:

> Hi joel Thank for response.
>
> *I want something like this-*
>
> [image: form.png]
>
>
>
>
>
>
>
>
>
> 1- when I click on *add row* button a new Row (*No-2)* will
> create dynamically.
> 2- In the select *product/service* its an options dropdown. the option
> should have related *model data*(from table product and service list)
> 3-  when i save all records in the dynamic field save to the database.
>
>
> I hope it clear to you. but if you need more information please let me
> know i am glad to discuss with you.
>
> :)
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/768d0fb2-4155-40c3-b0fc-fc4dbd2ad553%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/768d0fb2-4155-40c3-b0fc-fc4dbd2ad553%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_9EXkE7h9rU%3Dwyy02AZcM2rKnAFZ2Bn_hKRQP1Q4wS2MA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: favicon.ico

2018-09-30 Thread Joel
Please produce complete error report.

On Sun, 30 Sep, 2018, 5:37 PM Prajesh Parekh, 
wrote:

> how to solve error of favicon.ico in url.py ?  server is showing error of
> favicon.ico
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/ca50829c-8487-44e6-9d66-3c9ffe328910%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-FgWj1njZnKxxQ-wWNkND_8YtyEAx%2BQAyqQTX9JLW%3DyQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Best option for hosting django website

2018-10-08 Thread Joel
You need to know something about webservers too to set it up, though with
helper modules like wsgi_express it has become easy.
Get a vps, or a droplet from digitalocean or linode.

On Mon, 8 Oct, 2018, 4:39 PM Muhammad Tahir,  wrote:

> i need to host my django website on live server. what are the best options?
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/df4fabdc-c644-4f04-9bda-8307ee5aaf4b%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_8z6dbwTi8MA%3DJS1nrVKzHaB3xaGJuuWv_A6DW0L5K9dA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 2.1.1 creating CharField in a Form in Django on a Raspberry pi

2018-10-09 Thread Joel
instead of  {{ frm }}, try:

 {{ form }}

I think you'll understand what you did wrong.

On Tue, 9 Oct, 2018, 5:07 PM ,  wrote:

> hello,
>
> I've tried to create a simple CharField in a Form and show it in my
> webbrowser
> but I didn't see anything on my webbrowser?
>
>
> Below my code:
>
> *forms.py*
> from django import forms
>
>
>
> class  menuForm(forms.Form):
> image = forms.CharField(initial = 'Your Name')
> date = forms.DateField()
>
>
>
>
>
> *urls.py*
> from django.urls import path
> from . import views
>
> urlpatterns = [
> path('', views.menu),
>
> ]
>
> *Views.py*
> from django.shortcuts import render
> from django.http import HttpResponse
> from .forms import menuForm
>
> def menu(request):
> frm = menuForm()
>
> return  render(request, 'base.html',  {' form ': frm} )
>
>
>
> *html-file*
>
> 
>
> 
>  Menu
>
> 
> 
> Hallo
> {{ frm }}
>
> 
> 
>
> I can only see "Hallo" on my webbrowser but no input for a CharField?
>
> Can anybody help?
>
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/abc9ba3c-1d3b-4d84-9915-16c4fc02a27e%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_9w2hC5sEUOyvWgC%2BPOysiptQTJizdVp1acS91dra_gHQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 2.1.1 creating CharField in a Form in Django on a Raspberry pi

2018-10-09 Thread Joel
You passed form to template, so you have to refer to that.

On Tue, 9 Oct, 2018, 5:33 PM konstantin Heinrich, 
wrote:

> I declared in views.py variable called frm so I have to use it
> in my html file to have access to that file.?
>
>
>
> Am Di., 9. Okt. 2018 um 13:54 Uhr schrieb Joel :
>
>> instead of  {{ frm }}, try:
>>
>>  {{ form }}
>>
>> I think you'll understand what you did wrong.
>>
>> On Tue, 9 Oct, 2018, 5:07 PM ,  wrote:
>>
>>> hello,
>>>
>>> I've tried to create a simple CharField in a Form and show it in my
>>> webbrowser
>>> but I didn't see anything on my webbrowser?
>>>
>>>
>>> Below my code:
>>>
>>> *forms.py*
>>> from django import forms
>>>
>>>
>>>
>>> class  menuForm(forms.Form):
>>> image = forms.CharField(initial = 'Your Name')
>>> date = forms.DateField()
>>>
>>>
>>>
>>>
>>>
>>> *urls.py*
>>> from django.urls import path
>>> from . import views
>>>
>>> urlpatterns = [
>>> path('', views.menu),
>>>
>>> ]
>>>
>>> *Views.py*
>>> from django.shortcuts import render
>>> from django.http import HttpResponse
>>> from .forms import menuForm
>>>
>>> def menu(request):
>>> frm = menuForm()
>>>
>>> return  render(request, 'base.html',  {' form ': frm} )
>>>
>>>
>>>
>>> *html-file*
>>>
>>> 
>>>
>>> 
>>>  Menu
>>>
>>> 
>>> 
>>> Hallo
>>> {{ frm }}
>>>
>>> 
>>> 
>>>
>>> I can only see "Hallo" on my webbrowser but no input for a CharField?
>>>
>>> Can anybody help?
>>>
>>>
>>> --
>>> 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 post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/abc9ba3c-1d3b-4d84-9915-16c4fc02a27e%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/abc9ba3c-1d3b-4d84-9915-16c4fc02a27e%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAA%3Diw_9w2hC5sEUOyvWgC%2BPOysiptQTJizdVp1acS91dra_gHQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAA%3Diw_9w2hC5sEUOyvWgC%2BPOysiptQTJizdVp1acS91dra_gHQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHKy%2BPnYcLS8M3ZPp-G3gT%2BmYgaxo6z2U1jay3OvmpwKJ7UhQg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAHKy%2BPnYcLS8M3ZPp-G3gT%2BmYgaxo6z2U1jay3OvmpwKJ7UhQg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_8afmPOAVW8Bo0nRz288XQx6ggbUghkpDer0zLaaH2JDg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Regarding static media setup

2018-10-11 Thread Joel
Post the relevant files if you want someone to help

On Fri, 12 Oct, 2018, 11:44 AM ashok kumar reddy, <
ashok1101kuma...@gmail.com> wrote:

> Hello everyone . When I try to setup static Media ,I am repeatedly getting
> error in URLs.py(urlpatterns not defined ). could you solve this.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAL3x8KNbwLjxXQ3GwP6UXzWHG_0om%3DhQJZ1G%2BeMfARCOCKEmzg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_8CWif2FLauKE39NfpwHrG_eyBuNdaWFrK%2BOd9WiygCHg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: mysql client error

2018-10-13 Thread Joel
What exactly is the error?

On Sat, 13 Oct, 2018, 6:56 PM highnes joseph,  wrote:

> how to fix pip install mysqlclient error?
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/233b7426-cd70-45c2-bbb2-fd9cc367cf60%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_95pbrpOqOtDHNax1ym%2BxahJcxf%3Djyp%3DFokH9A6pKv8dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Use tables from database with creating models

2018-10-16 Thread Joel
Any reason why you hate models?

On Wed, 17 Oct, 2018, 11:16 AM Rakhee Menon, 
wrote:

>
>
> Yes Thank You..
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/46b3230e-7897-4aa1-ac0c-4d85ce5e53d7%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw__DaS%3Dk4C3Wa2Yia%2BfhtYf90YY2Bao%2B95T8koY6jnEC5A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django username and password error

2018-10-17 Thread Joel
Yes, my server did support ssl. But on my local development environment it
doesn't support ssl.

On Wed, 17 Oct, 2018, 4:41 PM mottaz hejaze,  wrote:

> does your server support SSL ? did you configure your server for SSL ?
>
> On Wed, Oct 17, 2018 at 12:10 PM Joel Mathew  wrote:
>
>> After attempting to redirect http to https by setting SECURE_SSL_REDIRECT
>> to True and a few other changes, suddenly I found myself locked out of
>> django login. It didnt accept my password, so I tried resetting it via
>> manage.py passwd and manage.py changepassword. I even created a new
>> superuser account and tried to login.
>>
>> I am unable to login to django admin site and to the custom login which
>> used to work until yesterday night. I'm at a loss to think of what next to
>> check. Any ideas?
>>
>>
>> Joel G Mathew
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAA%3Diw_-Md09MU-c7s2hHJ00zEdM0w4yf7hW4t1Cr24VeCEs8-g%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAA%3Diw_-Md09MU-c7s2hHJ00zEdM0w4yf7hW4t1Cr24VeCEs8-g%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHV4E-eC2uA7uDQWHm_A0Dh_%3D1txWdqD%2B2H1S4pMT7%3DDbn043w%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAHV4E-eC2uA7uDQWHm_A0Dh_%3D1txWdqD%2B2H1S4pMT7%3DDbn043w%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-pDy8usVQL6PFeEmNArTnGQxRfUKtfhyaU%2B9C_yuOwdw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: new to django

2018-10-18 Thread Joel
Or you may need to add the location of your installation directory to the
system path.

On Fri, 19 Oct, 2018, 9:00 AM Shubham Bajaj, 
wrote:

> Thank u..
>
> On Fri 19 Oct, 2018, 8:35 AM Joel Mathew,  wrote:
>
>> just purge and reinstall django
>>
>>
>> On Fri, 19 Oct 2018 at 08:14, Shubham Bajaj 
>> wrote:
>> >
>> > I tried this but it showing no module found django.core
>> > Pls help me..
>> >
>> > On Fri 19 Oct, 2018, 6:37 AM satyam mishra,  wrote:
>> >>
>> >> just install all the necessary module needed, just open the location
>> of project where you want your project located to be..for example if you
>> want your project to be located in desktop then use cmd in cmd prompt 'cd
>> desktop' then create your project by using the command ;django-admin
>> startproject projectname
>> >>
>> >> On Thursday, October 18, 2018 at 2:51:02 PM UTC+5:30,
>> shubham...@gmail.com wrote:
>> >>>
>> >>> "django-admin startproject mysite" i tried to run this in cmd propmt
>> but it is not working showing "django-admin' is not recognized as an
>> internal or external command," what to do?
>> >>
>> >> --
>> >> 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 post to this group, send email to django-users@googlegroups.com.
>> >> Visit this group at https://groups.google.com/group/django-users.
>> >> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/d5574242-bfa6-4d42-a74c-18cab55b296a%40googlegroups.com
>> .
>> >> For more options, visit https://groups.google.com/d/optout.
>> >
>> > --
>> > 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 post to this group, send email to django-users@googlegroups.com.
>> > Visit this group at https://groups.google.com/group/django-users.
>> > To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAMT57gi8y61x_XXgdM95P0BkQEp5-sLBdAC4qBn8jkjDbYy4cA%40mail.gmail.com
>> .
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAA%3Diw__1eS_JFh_X82v27%3DiDbt7cq4cy_yqSh6UeEO7x6ZGR%3DA%40mail.gmail.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMT57gjNJKfscLSJx13YeK1vRVvhCVnqPB3btX-Y%2B8YPHBQRhw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAMT57gjNJKfscLSJx13YeK1vRVvhCVnqPB3btX-Y%2B8YPHBQRhw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-2KmLfdBm5AiAVXht%2Bg2Z7BwBBRi860RxMtfdVBCCirw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: new to django

2018-10-18 Thread Joel
No, sorry.

On Fri, 19 Oct, 2018, 9:18 AM Shubham Bajaj, 
wrote:

> I already did these all...
> Can u help me with team viewer if possible
>
> On Fri 19 Oct, 2018, 9:14 AM Joel,  wrote:
>
>> Or you may need to add the location of your installation directory to the
>> system path.
>>
>> On Fri, 19 Oct, 2018, 9:00 AM Shubham Bajaj, 
>> wrote:
>>
>>> Thank u..
>>>
>>> On Fri 19 Oct, 2018, 8:35 AM Joel Mathew,  wrote:
>>>
>>>> just purge and reinstall django
>>>>
>>>>
>>>> On Fri, 19 Oct 2018 at 08:14, Shubham Bajaj 
>>>> wrote:
>>>> >
>>>> > I tried this but it showing no module found django.core
>>>> > Pls help me..
>>>> >
>>>> > On Fri 19 Oct, 2018, 6:37 AM satyam mishra, 
>>>> wrote:
>>>> >>
>>>> >> just install all the necessary module needed, just open the location
>>>> of project where you want your project located to be..for example if you
>>>> want your project to be located in desktop then use cmd in cmd prompt 'cd
>>>> desktop' then create your project by using the command ;django-admin
>>>> startproject projectname
>>>> >>
>>>> >> On Thursday, October 18, 2018 at 2:51:02 PM UTC+5:30,
>>>> shubham...@gmail.com wrote:
>>>> >>>
>>>> >>> "django-admin startproject mysite" i tried to run this in cmd
>>>> propmt but it is not working showing "django-admin' is not recognized as an
>>>> internal or external command," what to do?
>>>> >>
>>>> >> --
>>>> >> 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 post to this group, send email to django-users@googlegroups.com.
>>>> >> Visit this group at https://groups.google.com/group/django-users.
>>>> >> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/django-users/d5574242-bfa6-4d42-a74c-18cab55b296a%40googlegroups.com
>>>> .
>>>> >> For more options, visit https://groups.google.com/d/optout.
>>>> >
>>>> > --
>>>> > 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 post to this group, send email to django-users@googlegroups.com.
>>>> > Visit this group at https://groups.google.com/group/django-users.
>>>> > To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/django-users/CAMT57gi8y61x_XXgdM95P0BkQEp5-sLBdAC4qBn8jkjDbYy4cA%40mail.gmail.com
>>>> .
>>>> > For more options, visit https://groups.google.com/d/optout.
>>>>
>>>> --
>>>> 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 post to this group, send email to django-users@googlegroups.com.
>>>> Visit this group at https://groups.google.com/group/django-users.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/django-users/CAA%3Diw__1eS_JFh_X82v27%3DiDbt7cq4cy_yqSh6UeEO7x6ZGR%3DA%40mail.gmail.com
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> --
>>> 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 post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAMT57gjNJKfscLSJx13YeK1vRVvhCVnqPB3btX-Y%2B8YPHBQRhw%40mail.gmail.com
>>> <https://gro

Re: generate username and password

2018-10-19 Thread Joel
You can choose anything. Username and password creation happens
simultaneously with that command

On Fri, 19 Oct, 2018, 7:03 PM ,  wrote:

> and to generate the username?
>
> Le vendredi 19 octobre 2018 03:05:26 UTC, Joel a écrit :
>>
>> newpassword = RandomPassword()
>> user = User.objects.create_user(username, email, newpassword)
>>
>> Joel G Mathew
>>
>> On Fri, 19 Oct 2018 at 06:55,  wrote:
>> >
>> > Bonjour! Je voudrais lorsqu'un utilisateur s'inscrit avec ses
>> informations personnelles puis soumet le formulaire, je lui génère un nom
>> d'utilisateur et un mot de passe qu'on envoie dans son mail fourni.
>> >
>> > --
>> > 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...@googlegroups.com.
>> > To post to this group, send email to django...@googlegroups.com.
>> > Visit this group at https://groups.google.com/group/django-users.
>> > To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/ba2ee416-84fa-4688-a461-a482a3890175%40googlegroups.com.
>>
>> > For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/3b4a5f12-539d-4049-99ed-1fe37f196849%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/3b4a5f12-539d-4049-99ed-1fe37f196849%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_8EcZHJH21oUHUX%3DT1ceM%2B6i%3Dmbm0v6_f2dNpTpHwZnSw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Urls in Django model for dynamic template loading

2018-10-19 Thread Joel
which is your error? The one with "unable to load files.js? If so, check
your template. Probably available static files path issue.

On Fri, 19 Oct, 2018, 5:29 PM Tosin Ayoola,  wrote:

> got little project on the project, i'm working on, can't seems
> to able to  save my form to database and move to the next page, can someone
> help out
>
> On Fri, Oct 19, 2018 at 12:28 PM Akash Purandare 
> wrote:
>
>> I am creating a website in django and I was wondering how I can add a url
>> to Django Model and then retrieve that url to provide to the {% url
>> 'url_in_db'%} in the templates. If not, can anyone give me any other
>> suggestions to achieve this?
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/9d7b6ce9-5c3a-461d-a45f-3efe1d6ef3df%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHLKn73voNLU9cnROyNr%2B0E_LaYUsBfReR0STDE9o1nSqYpXHA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-jEWU_rNmnMiXOcFgockuC7RKfy%2BkOGj-rw1w_kBa40A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: error 501

2018-10-19 Thread Joel
Probably going to need a little more context (pun intended) on this one

On Fri, 19 Oct, 2018, 4:58 PM Neethi Ramaiah, 
wrote:

> how to solve this error Error response
>
> Error code 501.
>
> Message: Unsupported method ('GET').
>
> Error code explanation: 501 = Server does not support this operation.
>
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/95158f01-9984-407b-bb00-f26515a8ccdd%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw__ObdAWB5WCY7JO%3DZzeGK7T4-EDyt0%3Dh3ELmciEvNxJOQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Displaying items differently on one template based on age

2018-10-19 Thread Joel
You're using three different database queries. You could just fetch the
most recent 11 objects,  into a variable, use [0] for the most recent one.
And then display the next 10 and break them into columns with css wrap.


On Sat, 20 Oct, 2018, 9:20 AM Daniel Veazey,  wrote:

> I'm using 2.1. I have a list of blog posts, and I want to display them
> differently based on their age. The most recent post will be displayed
> prominently, and the 10 most recent posts after that will be displayed in
> two columns below it. The way I'm passing the view to the template is:
>
> class PostListView(ListView):
> model = Post
> template_name = 'mainapp/home.html'
>
>
> def get_context_data(self, **kwargs):
> context = super().get_context_data(**kwargs)
> context['latest'] = Post.objects.all().order_by('-date_posted')[0]
> context['first_column'] = Post.objects.all().order_by(
> '-date_posted')[1:6]
> context['second_column'] = Post.objects.all().order_by(
> '-date_posted')[6:10]
> return context
>
> Then I use 'latest', 'first_column' and 'second_column' in the template to
> display those things in their separate divs.
>
> Doing it this way works, but I am very new and I think I might have bodged
> it when there's a better way to do it. Any suggestions?
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/83be2580-6e11-4b99-b854-04aa47486480%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-Cu%2B-NtdGZeY9fC2VJ%2B13h4YWUyMY181Vez9E5E8C0Vw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: test error

2018-10-21 Thread Joel
He's using literal string interpolation.
Read: https://www.python.org/dev/peps/pep-0498/

On Sun, 21 Oct, 2018, 5:49 PM Tommaso Bellini, 
wrote:

> What does mean 'f' ? It is not imported or instanced..what is it?
>
> Il dom 21 ott 2018, 06:24 Tim Vogt (Tim Vogt)  ha
> scritto:
>
>> I try to make a test with has an error
>> any suggestions?
>> tim
>>
>>
>> expected_author = f'{post.author}
>> ^
>> SyntaxError: EOL while scanning string literal
>>
>>
>> --
>> Ran 1 test in 0.000s
>>
>> FAILED (errors=1)
>> Destroying test database for alias 'default'...
>> MacBook-Pro-15-Officerebel:blogapi timvogt$
>>
>>
>> from django.test import TestCase
>> from django.contrib.auth.models import User
>>
>> from .models import Post
>>
>> class BlogTests(TestCase):
>>
>> @classmethod
>> def setUpTestData(cls):
>> #Create a user
>> testuser1 = User.objects.create_user(
>> username='testuser1', password='abc123')
>> testuser1.save()
>>
>> # Create a blog post
>> test_post = Post.objects.create(
>> author=testuser1, title='Blog title', body='Body content...')
>> test_post.save()
>>
>> def test_blog_content(self):
>> post = Post.objects.get(id=1)
>> expected_author = f'{post.author}'
>> expected_title = f'{post.title}'
>> expected_body = f'{post.body}'
>> self.assertEquals(expected_author, 'testuser1')
>> self.assertEquals(expected_title,'Blog title')
>> self.assertEquals(expected_body, 'Body content ...')
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/FCBEF0A0-EDB1-4842-BB4E-42249F3F48EB%40gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CA%2BhSpwe4fVqaHU6JWvoc6%2B3D9RFF7beXhGzHu%3DaGs0Ez5fggtw%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_9rmPgKP-pzk8RB1icpJ8VGzM_XAWVukcn5s2gCF%3DsTiA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: test error

2018-10-21 Thread Joel
What is your version of python? f strings were introduced in 3.6

On Sun, 21 Oct, 2018, 9:54 AM Tim Vogt (Tim Vogt), 
wrote:

> I try to make a test with has an error
> any suggestions?
> tim
>
>
> expected_author = f'{post.author}
> ^
> SyntaxError: EOL while scanning string literal
>
>
> --
> Ran 1 test in 0.000s
>
> FAILED (errors=1)
> Destroying test database for alias 'default'...
> MacBook-Pro-15-Officerebel:blogapi timvogt$
>
>
> from django.test import TestCase
> from django.contrib.auth.models import User
>
> from .models import Post
>
> class BlogTests(TestCase):
>
> @classmethod
> def setUpTestData(cls):
> #Create a user
> testuser1 = User.objects.create_user(
> username='testuser1', password='abc123')
> testuser1.save()
>
> # Create a blog post
> test_post = Post.objects.create(
> author=testuser1, title='Blog title', body='Body content...')
> test_post.save()
>
> def test_blog_content(self):
> post = Post.objects.get(id=1)
> expected_author = f'{post.author}'
> expected_title = f'{post.title}'
> expected_body = f'{post.body}'
> self.assertEquals(expected_author, 'testuser1')
> self.assertEquals(expected_title,'Blog title')
> self.assertEquals(expected_body, 'Body content ...')
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/FCBEF0A0-EDB1-4842-BB4E-42249F3F48EB%40gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_8VU9J9QGUz_LNGjBRCQSGo0rpJ1FTtY5H00U_Di_7oiw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Where to start - New to Django and Python

2018-10-22 Thread Joel
If you don't know python, spend time on basic language and structure before
starting django. The python documentation has a good tutorial. The courses
on udemy are good.
For learning django, the official django tutorial set is sufficient.

On Mon, 22 Oct, 2018, 5:31 PM Lokendar Singh,  wrote:

> Hi Community,
>
> I'm new to django and python, however I've experience in development.
>
> Can someone suggest me the best book/content/tutor to enhance my skills as
> a lead developer?
> Currently I'm going through django documentation.
>
>
> Thanks in advance!
> Lokendar
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/0c69fb3c-1ddf-4781-b94c-d3c28faefb71%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-40gpfeikRpix22a0VUSYzzNk6pM5der%2BZVzqZztOCqw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django auto-deletes field related to MySQL Transactions

2018-10-23 Thread Joel
You could have a signal which captures all these and logs its origin.

On Tue, 23 Oct, 2018, 9:35 PM RyanW,  wrote:

> Yes, I honestly don't see how Django could be doing this either.  The only
> I could think of was user deletion, but no one has claimed to have done so.
>
> No other apps are connected.
>
> Thanks for the tip!!
>
> On Tuesday, October 23, 2018 at 10:05:51 AM UTC-5, Matthew Pava wrote:
>>
>> It doesn’t seem like Django would be doing this.
>>
>> Do you have any other apps connected to the database?
>>
>> You’ll probably want to surround your URL in quotation marks.  > href=”{% url ‘epedelete’ epe.id %}”>
>>
>>
>>
>>
>>
>> *From:* django...@googlegroups.com [mailto:django...@googlegroups.com] *On
>> Behalf Of *RyanW
>> *Sent:* Tuesday, October 23, 2018 9:33 AM
>> *To:* Django users
>> *Subject:* Re: Django auto-deletes field related to MySQL Transactions
>>
>>
>>
>> I have a button to delete a record by the user, displayed inside a
>> template as:
>>
>>
>>
>> > type="button" value="Delete" />
>>
>>
>> and the function in views.py
>>
>>
>>
>> def delete(request, part_id=None):
>>
>> obj = epe.objects.get(id=part_id)
>>
>> obj.delete()
>>
>> return HttpResponseRedirect(reverse('epe_home'))
>>
>>
>> Other than that, I have some ForeignKey restraints on_delete to preserve
>> integrity, like so:
>>
>> epe_ani2 = models.ForeignKey(
>>
>> Subjects,
>>
>> on_delete=models.PROTECT,
>>
>> null=True,
>>
>> blank=True
>>
>> )
>>
>>
>> As for the authentication backend, I'm using the default provided by
>> Django:
>>
>> ['django.contrib.auth.backends.ModelBackend']
>>
>>
>>
>> Thank you for the help!
>>
>>
>> On Tuesday, October 23, 2018 at 9:16:24 AM UTC-5, Matthew Pava wrote:
>>
>> Check your source code for any delete commands.
>>
>> This might also be your authentication backend.  Which one are you using?
>>
>>
>>
>> *From:* django...@googlegroups.com [mailto:django...@googlegroups.com] *On
>> Behalf Of *RyanW
>> *Sent:* Monday, October 22, 2018 7:55 PM
>> *To:* Django users
>> *Subject:* Django auto-deletes field related to MySQL Transactions
>>
>>
>>
>> I have a Django site I'm developing, which I've connected to a MySQL db.
>> I haven't deployed into production yet, as I'm still working on a couple of
>> things, however I leave the server running in development for initial data
>> entry.
>>
>>
>>
>> I've noticed that some of the records already inputted gets deleted,
>> seemingly randomly. I enabled logging on MySQL and found logs like the
>> following:
>>
>>
>>
>> 6798 Connect
>> rya...@cobb.eyes.uab.edu on downswebdb2
>>
>> 6798 Query
>> SET NAMES utf8
>>
>> 6798 Query
>> set autocommit=0
>>
>> 6798 Query
>> set autocommit=1
>>
>> 6798 Query
>> SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED
>>
>> 6798 Query
>> SELECT `Epe_epe`.`id`, `Epe_epe`.`epe_type`, `Epe_epe`.`epe_type2_id`,
>> `Epe_epe`.`epe_date`, `Epe_epe`.`epe_ani`, `Epe_epe`.`epe_ani2_id`,
>> `Epe_epe`.`epe_apn`, `Epe_epe`.`epe_apn2_id`, `Epe_epe`.`epe_weight`,
>> `Epe_epe`.`epe_drug_type1`, `Epe_epe`.`epe_drug1`, `Epe_epe`.`epe_dose1`,
>> `Epe_epe`.`epe_amount1`, `Epe_epe`.`epe_route1`, `Epe_epe`.`epe_time1`,
>> `Epe_epe`.`epe_drug_type2`, `Epe_epe`.`epe_drug2`, `Epe_epe`.`epe_dose2`,
>> `Epe_epe`.`epe_amount2`, `Epe_epe`.`epe_route2`, `Epe_epe`.`epe_time2`,
>> `Epe_epe`.`epe_drug_type3`, `Epe_epe`.`epe_drug3`, `Epe_epe`.`epe_dose3`,
>> `Epe_epe`.`epe_amount3`, `Epe_epe`.`epe_route3`, `Epe_epe`.`epe_time3`,
>> `Epe_epe`.`epe_drug_type4`, `Epe_epe`.`epe_drug4`, `Epe_epe`.`epe_dose4`,
>> `Epe_epe`.`epe_amount4`, `Epe_epe`.`epe_route4`, `Epe_epe`.`epe_time4`,
>> `Epe_epe`.`epe_drug_type5`, `Epe_epe`.`epe_drug5`, `Epe_epe`.`epe_dose5`,
>> `Epe_epe`.`epe_amount5`, `Epe_epe`.`epe_route5`, `Epe_epe`.`epe_time5`,
>> `Epe_epe`.`epe_drug_type6`, `Epe_epe`.`epe_drug6`, `Epe_epe`.`epe_dose6`,
>> `Epe_epe`.`epe_amount6`, `Epe_epe`.`epe_route6`, `Epe_epe`.`epe_time6`,
>> `Epe_epe`.`epe_iso_start`, `Epe_epe`.`epe_iso_end`, `Epe_epe`.
>> `epe_o2_end`, `Epe_epe`.`epe_start1`, `Epe_epe`.`epe_start2`, `Epe_epe`.
>> `epe_start3`, `Epe_epe`.`epe_start4`, `Epe_epe`.`epe_start5`, `Epe_epe`.
>> `epe_start6`, `Epe_epe`.`epe_start7`, `Epe_epe`.`epe_start8`, `Epe_epe`.
>> `epe_hr1`, `Epe_epe`.`epe_hr2`, `Epe_epe`.`epe_hr3`, `Epe_epe`.`epe_hr4`,
>> `Epe_epe`.`epe_hr5`, `Epe_epe`.`epe_hr6`, `Epe_epe`.`epe_hr7`, `Epe_epe`.
>> `epe_hr8`, `Epe_epe`.`epe_spo2_1`, `Epe_epe`.`epe_spo2_2`, `Epe_epe`.
>> `epe_spo2_3`, `Epe_epe`.`epe_spo2_4`, `Epe_epe`.`epe_spo2_5`, `Epe_epe`.
>> `epe_spo2_6`, `Epe_epe`.`epe_spo2_7`, `Epe_epe`.`epe_spo2_8`, `Epe_epe`.
>> `epe_temp1`, `Epe_epe`.`epe_temp2`, `Epe_epe`.`epe_temp3`, `Epe_epe`.
>> `epe_temp4`, `Epe_epe`.`epe_temp5`, `Epe_epe`.`epe_temp6`, `Epe_epe`.
>> `epe_temp7`, `Epe_epe`.`epe_temp8`, `Epe_epe`.`epe_etco2_1`, `Epe_epe`.
>> `epe_etco2_2`, `Epe_epe`.`epe_etco2_3`, `Epe_epe`.`epe_etco2_4`,
>> `Epe_epe`.`epe_etco2_5`, `Epe_epe`.`epe_etco2_6`, `Epe_epe`.`epe_etco2_7`
>>

Re: Trigger actions independently of url request

2018-10-26 Thread Joel
There's nothing that prevents you from doing the necessary imports of your
django model and other required modules in a python script, and then have
it run by cron. Is there?

I've operated python scripts outside of the django application, just to
import certain files into the database, which needs to be done only on the
server side, infrequently. This seems just like this, except it needs to be
done frequently. The linux cron does this very well.

On Tue, 23 Oct, 2018, 1:41 AM Charley Paulus, 
wrote:

> Hi Andrew,
>
> Thank you for your answer.
>
> To better clarify my need, here is one use case:
> 1) I would like my server (where Django is) to ping a remote address
> (let's say google.com) every 10 minutes, and put the result
> (communication ok or not) in a Django-generated database.
> 2) Then I will have a Django view that displays some statistics based on
> this database records. No worries for this point. My question is strictly
> on point 1.
>
> So what I need is my server itself to run code on a regular basis.
> Can I simply start a thread in manage.py, like here:
> https://eldarion.com/blog/2013/02/14/entry-point-hook-django-projects/ ?
>
> It seems that Celery and AWS Lambda are external tools that can remotely
> call my Django API.
>
> I hope the example helps.
>
> Thanks again.
>
> Best regards,
> Charley
>
>
> On Monday, October 22, 2018 at 1:10:52 PM UTC-4, Andrew Pinkham wrote:
>>
>> On Oct 22, 2018, at 12:08, Charley Paulus  wrote:
>> > After reading the Django tutorial, my understanding (I hope I’m wrong)
>> is that the only way to trigger a function of a Django app is when someone
>> on the client side request the url related to that function.
>>
>> That is correct. A view function/object is only called when a site
>> visitor is routed to that callable by the URL configuration.
>>
>> > But what if I want the server to run a function indenpendently of a url
>> call, for example:
>> > - every 10 minutes
>> > - when a pre-defined combination of variables become true
>>
>> I'm not clear on your second condition, but you are probably interested
>> in Celery for the first.
>>
>> http://www.celeryproject.org/
>> 
>>
>> Alternatively, some clouds provide the ability to run code on a regular
>> basis. If your Django code is not closely coupled with cron job, you could
>> use AWS Lambda.
>>
>> https://docs.aws.amazon.com/lambda/latest/dg/with-scheduled-events.html
>>
>> If it is tightly coupled and Celery is too powerful for your needs, you
>> could use an AWS Lambda (or Azure Function, etc) to send a request to your
>> Django API on a regular basis.
>>
>> Andrew
>> https://jambonsw.com
>> https://django-unleashed.com
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/73e3ded5-45be-4185-95e5-968ef803c75b%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_9SAgunm1_0qSTi8mqAGwmS2pJNNwRm2HO4kYTUHGA7zw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django table with checkboxes

2018-10-27 Thread Joel
Very simple. Give each checkbox a unique name, and process the submit
request by reading request.POST.getlist.

On Sat, 27 Oct, 2018, 5:52 PM nitesh rawat,  wrote:

> Hi Stanislav,
> I hope you get the solution to your problem, if you can , share the code.
> Thanks.
>
> On Monday, August 1, 2011 at 1:38:33 PM UTC+5:30, Stanislav Nedelchev
> wrote:
>>
>> Hi everyone,
>> I'm quite new to django and still learning.
>> But I face a problem that i can't solve.
>> I have the following very simple example.
>> Let say that I have one model for Books.
>>
>> class Book(models.Model):
>> name = models.CharField(max_length=50,unique = True)
>> description = models.TextField(blank = True)
>> status = models.CharField(max_length=50,unique = True)
>> created_on = models.DateTimeField(auto_now=True)
>> def __unicode__(self):
>> return self.name
>>
>> If I search for all books for example.
>> I want to display table with result where first column is checkbox.
>> And if I check some books and hit button delete to be able to delete
>> them.
>> Also I what to have one input field or drop down where i can choose
>> "out of order" and click button update to change status of all slected
>> books to "out of order"
>> I'm reading the documentaion but I can't find how to do it.
>> I made one template where I generate table with results.But I can't
>> process checked books.
>> I added manually delete button and form in template.
>> But maybe I must use Forms instead.
>> Any hint or example how to acomplish this will be very usefull.
>>
>>
>> And sorry for my bad english.
>> Best regards
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/1b83c976-4432-4183-b60f-df8fc110a9e3%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_8uFWpmJLcTO%2BWUCy3saceqL_qTmwVd5Krs5ZkaE-QUgQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django table with checkboxes

2018-10-27 Thread Joel
Something like this:

@login_required
def batch_delete_bill_item(request):
if request.method == 'POST':
if request.POST.getlist('checks[]'):
selecteditems = request.POST.getlist('checks[]')
for sel in selecteditems:
item = get_object_or_404(billitem, code=sel)
try:
code = item.code

In the template you can have something like this:

{% for item in appointment_items %}
   
{% endfor %}

On Sat, 27 Oct 2018 at 18:01, Joel  wrote:
>
> Very simple. Give each checkbox a unique name, and process the submit request 
> by reading request.POST.getlist.
>
> On Sat, 27 Oct, 2018, 5:52 PM nitesh rawat,  wrote:
>>
>> Hi Stanislav,
>> I hope you get the solution to your problem, if you can , share the code.
>> Thanks.
>>
>> On Monday, August 1, 2011 at 1:38:33 PM UTC+5:30, Stanislav Nedelchev wrote:
>>>
>>> Hi everyone,
>>> I'm quite new to django and still learning.
>>> But I face a problem that i can't solve.
>>> I have the following very simple example.
>>> Let say that I have one model for Books.
>>>
>>> class Book(models.Model):
>>> name = models.CharField(max_length=50,unique = True)
>>> description = models.TextField(blank = True)
>>> status = models.CharField(max_length=50,unique = True)
>>> created_on = models.DateTimeField(auto_now=True)
>>> def __unicode__(self):
>>> return self.name
>>>
>>> If I search for all books for example.
>>> I want to display table with result where first column is checkbox.
>>> And if I check some books and hit button delete to be able to delete
>>> them.
>>> Also I what to have one input field or drop down where i can choose
>>> "out of order" and click button update to change status of all slected
>>> books to "out of order"
>>> I'm reading the documentaion but I can't find how to do it.
>>> I made one template where I generate table with results.But I can't
>>> process checked books.
>>> I added manually delete button and form in template.
>>> But maybe I must use Forms instead.
>>> Any hint or example how to acomplish this will be very usefull.
>>>
>>>
>>> And sorry for my bad english.
>>> Best regards
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/1b83c976-4432-4183-b60f-df8fc110a9e3%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_8TfnxL4PB00sV3Y2EEqmDAeni3_zkhx7m0WyFfxsLJ0Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to move readonly_fields on top of page?

2018-11-04 Thread Joel
Explain. What do you mean move on top of page?

On Mon, 5 Nov, 2018, 2:46 AM Karol Ołtarzewski <2004ka...@gmail.com wrote:

> Good morning guys.
>
> I have a problem namely:
> I have to place readonly_fields on top of
> /admin///change page, higher than normal fields.
> I was looking through docs and I can't find proper function to achieve
> that.
>
> What I have to do to reach my goal?
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/2d680835-393a-4011-8599-495ef8d3da29%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-9u1HAJCsDh00YzCUR2ONQ6MJOW7kvT5fEPYShtr1Khw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: hi everyone

2018-11-11 Thread Joel
I don't really understand what you mean. How can you put something on your
resume when you haven't contributed to it?

On Mon, 12 Nov, 2018, 12:06 PM ramakurthy swamy  hi sir thank u for giving reply and the real time means what the present
> projects are going on company based on python and django,,,
> And i have a two years gap in my academic period based on that project i
> want to fill-up that gap so plz kindly help
>
> On Sun, Nov 11, 2018 at 7:45 PM PASCUAL Eric  wrote:
>
>> Hi,
>>
>>
>> What do you mean exactly by "real time" ? Can you describe the project
>> you are thinking about ?
>>
>>
>> "Real time" relates to a very specific class of software, which one of
>> the characteristics is to react to external events in a (most often) short
>> and, *deterministic* time. For sure, neither Python nor Django fulfill
>> the involved technical requirements, especially considering the
>> deterministic property which is one of the RT non negotiable aspect.
>>
>>
>> BTW can you elaborate a bit on what you mean by "i want to keep that
>> project in my resume" ?
>>
>>
>> Regards
>>
>>
>> Eric
>> --
>> *From:* django-users@googlegroups.com  on
>> behalf of ramakurthy swamy 
>> *Sent:* Sunday, November 11, 2018 2:29:51 PM
>> *To:* Django users
>> *Subject:* hi everyone
>>
>> i am looking for real time project based on python and django plz help
>> `me and i want to keep that project in my resume plz help me guiess
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/f7b6adcd-4d1a-4f3a-abc7-b659be3c842c%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/VI1P193MB04326D4B9AAA3A7EA2A856348CC00%40VI1P193MB0432.EURP193.PROD.OUTLOOK.COM
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHa6oC9WoybinQcMjYR2FvzcSohAfz6Yk_99xAP5_zB669MvAg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_9G4xEckEM7OW11cZAnS_Zu7s%3DMenTE-W2_k6mpVhs66A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: I'm new in Django. please help me out

2018-11-13 Thread Joel
You're bound to be trolled if you post a question which clearly looks like
an assignment, with zero effort on your part. Where's your code? What did
you try?

On Tue, 13 Nov, 2018, 3:38 PM Dheeraj Kumar  if you guys do not help ,plz ignore it insist of trying to be over
> smart.this is home work or any thing else you are not authorized to comment
> like this.
>
> just stop it.
>
> On Tue, 13 Nov 2018 at 15:30, amit pant  wrote:
>
>>  sometimes
>>
>> On Tue, Nov 13, 2018 at 3:23 PM PASCUAL Eric 
>> wrote:
>>
>>> > hey, you need to pay for that.
>>>
>>>
>>> Seen quite frequently : some of the visitors of community groups such as
>>> this one confuse them with "do_my_job_for_free.com" or "
>>> do_my_homework.com" 😊
>>>
>>>
>>> Eric
>>> --
>>> *From:* django-users@googlegroups.com 
>>> on behalf of amit pant 
>>> *Sent:* Tuesday, November 13, 2018 10:27:13 AM
>>> *To:* django-users@googlegroups.com
>>> *Subject:* Re: I'm new in Django. please help me out
>>>
>>> hey, you need to pay for that.
>>>
>>> On Tue, Nov 13, 2018 at 2:55 PM  wrote:
>>>
>>> Hi All,
>>>
>>> can you please solve this.
>>>
>>> 1) Create a simple Category model using DRF with following fields :
>>> Id,name,parent,is_featured,image,is_active,description
>>> 2) Create CRUD APIs for the same.
>>> 3) Validate input at every event/API.
>>> 4) Implement ordering and filtering.
>>> 5) GET API should take params to return :
>>> Ex. /abc.com?params=id|name|is_featured
>>>  : this should return
>>> Array of JSON
>>> object with specified keys, along with an authenticated key mentioning
>>> user
>>> authentication status.
>>>
>>> Thanks
>>>
>>> --
>>> 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 post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/dfdb2b20-66a3-4e56-b548-45c0f59a48ee%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>> --
>>> 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 post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAF2Ah_FcL0UEGVFhJBE_nCdCHXFTQyWbzmqPbPV5v13k04r_6A%40mail.gmail.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>> --
>>> 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 post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/VI1P193MB043255EC430059412851527A8CC20%40VI1P193MB0432.EURP193.PROD.OUTLOOK.COM
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAF2Ah_Et%3DhoYJnBVhzXCaHRO%2B_iyRS4x1-6vrPaOYPUGTxjS2Q%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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, s

Re: PDF extarcting

2018-11-13 Thread Joel
use pip3.
It would be nice if you could keep the non django discussion out of this
group.

On Tue, 13 Nov, 2018, 6:47 PM swathi2801 Yadhav  pdf text tool not installing in this version what to do next?
>
>
> On Tue, Nov 13, 2018 at 6:41 PM swathi2801 Yadhav <
> swathi2801yad...@gmail.com> wrote:
>
>> please can ping me the code if u have done soo
>>
>> On Tue, Nov 13, 2018 at 6:30 PM m1chael  wrote:
>>
>>> i recently achieved this by using pdf2text tool, and then using regular
>>> expressions to parse out what I want.
>>>
>>> VERY DIFFICULT
>>>
>>>
>>>
>>> On Tue, Nov 13, 2018 at 6:45 AM swathi2801 Yadhav <
>>> swathi2801yad...@gmail.com> wrote:
>>>
 by using resular we can only extract  doc files but to for extracting
 the data from pdf we need to import any package or not

 On Tue, Nov 13, 2018 at 10:33 AM Manjunath 
 wrote:

> I think regular expression would be a better option for your
> requirements.
> If you provide some sample resume docs, we can help better.
>
> On Tuesday, November 13, 2018 at 7:04:06 AM UTC+5:30, swathi2801
> Yadhav wrote:
>>
>> Hi everyone, there is a project given to us to develop an application
>> I need to extract data from resume only specific fields like name,
>> mail, dob, phone number   by importing a package pyPdf2 I can only 
>> extract
>> a data to text the whole part but there is no need of whole data only
>> specific data need to extract
>> if any were are familiar with pdPdf2 extracting the data please help
>> me .!!
>>
>>
>> thanks
>> Swathi
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/cf376fbd-4b81-4e73-a7b0-d9d9a7a0a516%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
 --
 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 post to this group, send email to django-users@googlegroups.com.
 Visit this group at https://groups.google.com/group/django-users.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/CAGnx2uOv_0Qh6gN6qBNqxCVR_6cEisYbzH1XF%3DUeyCX41_r4mQ%40mail.gmail.com
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>> --
>>> 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 post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAAuoY6PHSj06s5tA-%3DTRwPrWHLJ5_8boxLLoG-3hrXvSsMVtuw%40mail.gmail.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAGnx2uOc74528nMVPUq7CkHOMqgsJy-eq_PAQZgb6rxikFEMQQ%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, 

Re: Sending PDF from javascript to django

2018-11-14 Thread Joel
Ideally I would love to generate the pdf on the server. Hovered I am yet to
discover an easy way to create a pdf easily with the ease of jspdf's table
plugin.

Perhaps someone can shed light on a good python library to do this without
much ado.

On Wed, 14 Nov, 2018, 7:12 PM Jason  your original error was due to exceding django's max upload size.  check
> out
> https://docs.djangoproject.com/en/2.1/ref/settings/#data-upload-max-memory-size
>
> also, you should check out https://djangopackages.org/grids/g/pdf/
>
> What I would do is generate the pdf in the view from a rendered template
> and then send from email.  No need to generate it on the client and upload
> for an email.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/506231af-2c44-4e8c-9c9d-36d8ea913b7b%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_9QAr_Y2deWgjsXmZcmM8HALA3Gg0jDz_dZVtnSt9Vtog%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Render works but url does not change

2018-11-15 Thread Joel
Post details.. The url, your urls.py etc

On Fri, 16 Nov, 2018, 8:05 AM Derrick Lu  HI,
> I am having trouble with url when rendering to a new page via a button.
> The new page renders but the url does not reflect the new page.
> Has anyone had that problem before?
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8a745765-e3a8-4929-baae-b51ed922ae2d%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_8s46%3DSmDWA%3D4jGSuDsaSS-jGFL8OvdqjHpPTPZq%3DKfww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to download a file when a django function is called by javascript instead of navigation to the url?

2018-11-17 Thread Joel
Yes. But it's not usable when we're using JavaScript to fetch the url.

On Sat, 17 Nov, 2018, 9:20 PM Jason  oh, I didn't know that was a thing.  TIL.
>
>
> https://docs.djangoproject.com/en/2.1/ref/request-response/#django.http.FileResponse
>
> note the bit about as_attachment setting content disposition
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/a950f7f3-2e7e-490d-b271-3125829a9376%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_8mx5-wsdR39naUt%2BPYiTCGP5dD%2BMCJ8QObB9%2BLGxGqrg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: API project example

2018-11-17 Thread Joel
Follow the initial two django tutorials and you'll get the idea.

On Sun, 18 Nov, 2018, 5:23 AM Arturo Fernandez  Hi guys, I'm developing an idea, but the funny things is that I'm learning
> Django at the same time. Do you guys know of any SIMPLE project that
> requests data from an api and displays it on the font end (html)?
>
> I'm working with themoviedb using https://github.com/celiao/tmdbsimple. I
> got the shell as the example there but how do I do it on the html so it can
> be displayed?
>
> If you know of any project please let me know so I can learn by seeing it.
>
> Many thanks
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/6b544943-ab9f-41da-b9ad-045a4b9615cd%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw__npjHhC9GbVbjzC0wD0sam7UTChHyVR-5FbvOkLDuWgw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: iss api

2018-11-18 Thread Joel
Isn't this reverse geocoding? I think it's already an example in the
official tutorial.

On Sun, 18 Nov, 2018, 7:45 PM gokul s  hi i want create model that get the longitude and lattitude for
> International Space Station and plot the longitude and lattitude on map so
> that we can track the live location on map.i  have wrote function to
> receive lattitude and longitude but i dont know how to plot it with map.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/6fd2de51-bcca-4778-8d5a-0d22329132cc%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-Cfcs_8BhOXGsKDKreQM5otdQa-h5gC8X7cYhzOtD%3D%2Bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: mail sending

2018-11-22 Thread Joel
django-kronos is probably the easiest to do this. As mentioned, you could
create a management command to check a database or file for the time when
you want to run this, with any other data, then you'd set an interval at
which you want to check if mails need be sent, and then execute your mail
sending function if the criteria is satisfied.

On Thu, 22 Nov, 2018, 8:19 PM Jani Tiainen  Hi.
>
> Essentially you need to record the time you want your mail to be sent and
> then you need some kind of background worker to check (periodically) if
> there are any mails to be sent.
>
> Celery is one tool that can do that.
>
> I personally use simple cron job that uses django management command to
> achieve same stuff (sending emails asynchronously).
>
> Tushar Nadkar  kirjoitti to 22. marrask. 2018
> klo 8.53:
>
>> when a button is clicked , i want to send specific mail after 3 days ?
>> how can i do that in django
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAAHYEvMUPoT%2BivTkPx%2BekvksnVWo%3DiByAt48iQX8m-HjTSQMTw%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHn91ocf3eFL7QMiXj0Mspg4zDCovE0VGaJ8-onEaRdsq02TXA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-KvAkYrF0hhKfvc_GZo_wueLrTM%2B1kCHXtQvJH8VfjQg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Working with kronos

2018-11-22 Thread Joel
Yes, the language of the documentation certainly needs tweaking. I had done
the installtasks and it did work. Thank you very much for your help.
Now, I can have my app check for upcoming appointments and send reminders.
It was a much needed functionality.

On Fri, 23 Nov, 2018, 9:06 AM Jason  the documentation is ambiguous in that regard.  that said, I feel it says
> you can register the cron tasks either way, but it doesn't do anything to
> actually install the commands.  you can see the code of the installtasks
> management command:
>
>
> https://github.com/jgorset/django-kronos/blob/v1.0/kronos/management/commands/installtasks.py
>
> which then runs the functions in
> https://github.com/jgorset/django-kronos/blob/v1.0/kronos/__init__.py#L117-L154
>
> as you can see there, it uses the python crontab package to install the
> crontab task.
>
> Furthermore, in
> https://github.com/jgorset/django-kronos/blob/v1.0/kronos/__init__.py#L107-L114,
> you can see what exactly the decorator consists of.  It just adds the task
> to a task registry set and doesn't do anything about actual installation.
>
> as an aside, one of the things I've found to be pretty valuable is to look
> at the project repository when it comes to questions like this.  this is
> not meant to be mean, and I'm sorry if it comes across that way.  I didn't
> know about this project before your question, but a brief look in the repo
> revealed those links and functions above, which are the most likely answers
> to your question above.  you're asking good questions here and giving good
> help in return, so if you internalize a method of investigating problems
> like this, or have more specific and focused questions that your
> investigations have unearthed.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/7e5feb84-d1d6-4dfe-bc48-2e36ac0f0e30%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_8W%3Dwk5PZv2MJbrcrbBokD7JwMCO3sfJq0V5CkDEzFLjA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Working with kronos

2018-11-22 Thread Joel
Thanks for the advise regarding understanding the issue in depth. My
initiation to python has been all of three months, and to django since two.
So far, I'd been scared to look under the hood, and any further than the
documentation. But I realize that it's not as daunting now add it used to
be. And coming from perl, I'm impressed at how cleaner it is.

Now I'm feeling power packed to examine the innards of django and python.
Thank you!

On Fri, 23 Nov, 2018, 9:06 AM Jason  the documentation is ambiguous in that regard.  that said, I feel it says
> you can register the cron tasks either way, but it doesn't do anything to
> actually install the commands.  you can see the code of the installtasks
> management command:
>
>
> https://github.com/jgorset/django-kronos/blob/v1.0/kronos/management/commands/installtasks.py
>
> which then runs the functions in
> https://github.com/jgorset/django-kronos/blob/v1.0/kronos/__init__.py#L117-L154
>
> as you can see there, it uses the python crontab package to install the
> crontab task.
>
> Furthermore, in
> https://github.com/jgorset/django-kronos/blob/v1.0/kronos/__init__.py#L107-L114,
> you can see what exactly the decorator consists of.  It just adds the task
> to a task registry set and doesn't do anything about actual installation.
>
> as an aside, one of the things I've found to be pretty valuable is to look
> at the project repository when it comes to questions like this.  this is
> not meant to be mean, and I'm sorry if it comes across that way.  I didn't
> know about this project before your question, but a brief look in the repo
> revealed those links and functions above, which are the most likely answers
> to your question above.  you're asking good questions here and giving good
> help in return, so if you internalize a method of investigating problems
> like this, or have more specific and focused questions that your
> investigations have unearthed.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/7e5feb84-d1d6-4dfe-bc48-2e36ac0f0e30%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_9zVznFM3pp3rG1%3DrGepULA6TmzmaefDSMsRfWEv-M25w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unexpected behavior on delete of model

2018-11-27 Thread Joel
I think you made a typo in the code. doctor can't be a Foreign key for
class Doctor. Anyway I get your point, and this is the same way I solved it
yesterday.

On Wed, 28 Nov, 2018, 11:07 AM Saurabh Agrawal 
>>
>>
>> class Doctor(models.Model):
>>
>> name = models.CharField(max_length=35)
>>
>> username = models.CharField(max_length=15)
>>
>>
>>
>> class DoctorProfilePic (models.Model):
>>
>> name = models.CharField(max_length=255, blank=True)
>>
>> pic = StdImageField(upload_to="data/media/%Y/%m/%d", blank=True,
>> variations={
>>
>> 'large': (600, 400),
>>
>> 'thumbnail': (150, 140, True),
>>
>> 'medium': (300, 200),
>>
>> })
>>
>> doctor = models.OneToOneField(Doctor, blank=True,
>>
>> null=True, on_delete=models.SET_NULL,
>> related_name="profile_pic")
>>
>>
>>
>
> Setting on_delete to SET_NULL doesn't make much sense here, I think. This
> implies that if a doctor is deleted, the profile pic will be preserved,
> with the FK to doc being set to NULL in db (which doesn't seem desirable).
> I think here CASCADE should work good and will not have the issue that the
> OP is facing.
>
>
>
>
>
>
>>
>>
>> …and after saying all that, I wouldn’t make a separate model for the
>> profile picture.  This is what I would do:
>>
>> class Doctor(models.Model):
>>
>> name = models.CharField(max_length=35)
>>
>> username = models.CharField(max_length=15)
>>
>>     profile_pic = StdImageField(upload_to="data/media/%Y/%m/%d",
>> blank=True, variations={
>>
>> 'large': (600, 400),
>>
>> 'thumbnail': (150, 140, True),
>>
>> 'medium': (300, 200),
>>
>> })
>>
>>
>>
>>
>>
>>
>>
>> *From:* django-users@googlegroups.com [mailto:
>> django-users@googlegroups.com] *On Behalf Of *Joel Mathew
>> *Sent:* Tuesday, November 27, 2018 12:24 PM
>> *To:* django-users@googlegroups.com
>> *Subject:* Unexpected behavior on delete of model
>>
>>
>>
>> Situation:
>>
>>
>>
>> I have two Model classes, in two different apps which are part of the
>> same project. class doctor defined in appointments.models is a set of
>> attributes associated with a doctor, like name, username, email, phone etc.
>> class DoctorProfilePic is a Model defined in clinic.models, which has a
>> StdImageField which stores images. doctor has a One to One mapping to
>> DoctorProfilePic.
>>
>>
>>
>> class doctor(models.Model):
>>
>> docid = models.AutoField(primary_key=True, unique=True) # Need
>> autoincrement, unique and primary
>>
>> name = models.CharField(max_length=35)
>>
>> username = models.CharField(max_length=15)
>>
>> ...
>>
>> profilepic = models.ForeignKey(DoctorProfilePic, blank=True,
>> null=True, on_delete=models.CASCADE)
>>
>> ...
>>
>>
>>
>> class DoctorProfilePic (models.Model):
>>
>> id = models.AutoField(primary_key=True, unique=True)
>>
>> name = models.CharField(max_length=255, blank=True)
>>
>> pic = StdImageField(upload_to="data/media/%Y/%m/%d", blank=True,
>> variations={
>>
>> 'large': (600, 400),
>>
>> 'thumbnail': (150, 140, True),
>>
>> 'medium': (300, 200),
>>
>> })
>>
>> doc = models.ForeignKey('appointments.doctor', blank=True,
>>
>> null=True, on_delete=models.CASCADE)
>>
>>
>>
>> Anticipated response:
>>
>>
>>
>> When user selects one of the profile pics from a selection box, and
>> clicks Delete, django is supposed to delete the picture from the collection
>> of pictures uploaded by the doctor.
>>
>>
>>
>> Problem:
>>
>>
>>
>> When the delete button is clicked, django deletes both the picture and
>> the doctor, instead of just the former.
>>
>>
>>
>> Code:
>>
>>
>>
>> def removeprofpic(request, docid):
>>
>>

Re: Unexpected behavior on delete of model

2018-11-27 Thread Joel
Ignore the last post. Formatting blues in my main editor.

On Wed, 28 Nov, 2018, 11:34 AM Joel  I think you made a typo in the code. doctor can't be a Foreign key for
> class Doctor. Anyway I get your point, and this is the same way I solved it
> yesterday.
>
> On Wed, 28 Nov, 2018, 11:07 AM Saurabh Agrawal  wrote:
>
>>
>>>
>>>
>>> class Doctor(models.Model):
>>>
>>> name = models.CharField(max_length=35)
>>>
>>> username = models.CharField(max_length=15)
>>>
>>>
>>>
>>> class DoctorProfilePic (models.Model):
>>>
>>> name = models.CharField(max_length=255, blank=True)
>>>
>>> pic = StdImageField(upload_to="data/media/%Y/%m/%d", blank=True,
>>> variations={
>>>
>>> 'large': (600, 400),
>>>
>>> 'thumbnail': (150, 140, True),
>>>
>>> 'medium': (300, 200),
>>>
>>> })
>>>
>>> doctor = models.OneToOneField(Doctor, blank=True,
>>>
>>> null=True, on_delete=models.SET_NULL,
>>> related_name="profile_pic")
>>>
>>>
>>>
>>
>> Setting on_delete to SET_NULL doesn't make much sense here, I think. This
>> implies that if a doctor is deleted, the profile pic will be preserved,
>> with the FK to doc being set to NULL in db (which doesn't seem desirable).
>> I think here CASCADE should work good and will not have the issue that the
>> OP is facing.
>>
>>
>>
>>
>>
>>
>>>
>>>
>>> …and after saying all that, I wouldn’t make a separate model for the
>>> profile picture.  This is what I would do:
>>>
>>> class Doctor(models.Model):
>>>
>>> name = models.CharField(max_length=35)
>>>
>>> username = models.CharField(max_length=15)
>>>
>>> profile_pic = StdImageField(upload_to="data/media/%Y/%m/%d",
>>> blank=True, variations={
>>>
>>> 'large': (600, 400),
>>>
>>> 'thumbnail': (150, 140, True),
>>>
>>> 'medium': (300, 200),
>>>
>>> })
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *From:* django-users@googlegroups.com [mailto:
>>> django-users@googlegroups.com] *On Behalf Of *Joel Mathew
>>> *Sent:* Tuesday, November 27, 2018 12:24 PM
>>> *To:* django-users@googlegroups.com
>>> *Subject:* Unexpected behavior on delete of model
>>>
>>>
>>>
>>> Situation:
>>>
>>>
>>>
>>> I have two Model classes, in two different apps which are part of the
>>> same project. class doctor defined in appointments.models is a set of
>>> attributes associated with a doctor, like name, username, email, phone etc.
>>> class DoctorProfilePic is a Model defined in clinic.models, which has a
>>> StdImageField which stores images. doctor has a One to One mapping to
>>> DoctorProfilePic.
>>>
>>>
>>>
>>> class doctor(models.Model):
>>>
>>> docid = models.AutoField(primary_key=True, unique=True) # Need
>>> autoincrement, unique and primary
>>>
>>> name = models.CharField(max_length=35)
>>>
>>> username = models.CharField(max_length=15)
>>>
>>> ...
>>>
>>> profilepic = models.ForeignKey(DoctorProfilePic, blank=True,
>>> null=True, on_delete=models.CASCADE)
>>>
>>> ...
>>>
>>>
>>>
>>> class DoctorProfilePic (models.Model):
>>>
>>> id = models.AutoField(primary_key=True, unique=True)
>>>
>>> name = models.CharField(max_length=255, blank=True)
>>>
>>> pic = StdImageField(upload_to="data/media/%Y/%m/%d", blank=True,
>>> variations={
>>>
>>> 'large': (600, 400),
>>>
>>> 'thumbnail': (150, 140, True),
>>>
>>> 'medium': (300, 200),
>>>
>>> })
>>>
>>> doc = models.ForeignKey('appointments.doctor', blank=True,
>>>
>>> null=True, on_delete=mod

Re: CSRF token not adding hidden form field

2010-06-10 Thread Joel Klabo
yeah, still 403. CSRF token missing or incorrect.

On Jun 10, 7:20 pm, Lee Hinde  wrote:
> Is the error the same?
>
>
>
> On Thu, Jun 10, 2010 at 5:41 PM, joelklabo  wrote:
> > Still won't work. Here is my views.py:
>
> > def login(request):
> >        c = {}
> >        c.update(csrf(request))
> >        if request.POST:
> >                username = request.POST['username']
> >                password = request.POST['password']
> >        else:
> >                request = 'it is not there.'
> >        return render_to_response('feed.html', c)
>
> > On Jun 10, 2:22 pm, Lee Hinde  wrote:
> >> You need to add:
>
> >> from django.core.context_processors import csrf
> >> at the top of Views.py
>
> >> and
>
> >>    c = {}
> >>    c.update(csrf(request))
>
> >> to each response/view
>
> >>  since you're using render_to_response
>
> >> On Thu, Jun 10, 2010 at 8:10 AM, joelklabo  wrote:
> >> > This is my source on GitHub if anyone is 
> >> > interested:http://github.com/joelklabo/Brooski
>
> >> > On Jun 10, 8:00 am, joelklabo  wrote:
> >> >> This is my urls.py:
>
> >> >>         (r'^site_media/(?P.*)$', 'django.views.static.serve',
> >> >> {'document_root': settings.MEDIA_ROOT}),
> >> >>     (r'^$', feed),
> >> >>     (r'^admin/', include(admin.site.urls)),
> >> >>         (r'^accounts/login/$', '.contrib.auth.views.login', 
> >> >> {'template_name':
> >> >> 'base.html'}),
> >> >>         (r'^accounts/logout/$', logout),
> >> >>     (r'^profile/(\w+)', profile),
> >> >>         (r'^brew/(\d+)', brewDetail),
> >> >>         (r'^brewery/(.+)', breweryDetail),
> >> >>         (r'^style/(.+)', styleDetail),
>
> >> >> I'm not sure how I would turn off CSRF. My form is in base.html as a
> >> >> login form with some logic like {% if not logged in %} display form.
>
> >> >> On Jun 9, 11:43 pm, Roshan Mathews  wrote:
>
> >> >> > On Thu, Jun 10, 2010 at 11:45,joelklabo wrote:
> >> >> > > Looks like it did something, I didn't get a 403 but I got this 
> >> >> > > error:
>
> >> >> > Okay, so it seems, 'django.middleware.csrf.CsrfResponseMiddleware' is
> >> >> > not required.  Please remove that.
>
> >> >> > Are your forms working without csrf protection turned on?  That stack
> >> >> > trace looks like it couldn't resolve some url, and given that your
> >> >> > form is not posting to the same view it came from, that might be a
> >> >> > source of the problem.  Check your urls.py ...
>
> >> >> > --http://roshan.mathews.in/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: CSRF token not adding hidden form field

2010-06-12 Thread Joel Klabo
I finally got it to work by adding the RequestContext to my
render_to_response. I think the issue was that it was redirecting and
the csrf_token wasn't getting sent to the new page by the
requestcontext, here is what it looks like now: (csrf_token is also in
the form)

return render_to_response('profile.html', {'drinks' : drinks,
'followers' : followers},

context_instance=RequestContext(request))

Thanks for all the help!

On Jun 11, 9:32 pm, Ali Kusnadi  wrote:
> On 6/11/10, Joel Klabo  wrote:
>
> > yeah, still 403. CSRF token missing or incorrect.
>
> try add the  'django.core.context_processors.csrf' in your settings.py
>
> TEMPLATE_CONTEXT_PROCESSORS = (
>
>         'django.core.context_processors.csrf',
>
> )
>
>
>
>
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django architecture question

2010-06-14 Thread Joel Klabo
I am working on a simple site right now and the views are pretty easy.
Usually just iterate a loop of objects. But, I am trying to figure out
how a website with all different kinds of data, including a sign in
form, is setup in django. Is that all in one big view? Or, is there
some way to combine them?

Any insight would be helpful, thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django architecture question

2010-06-15 Thread Joel Klabo
Thanks, good info. So the template tag can do the DB query and all
that without going through a view function?

On Jun 15, 8:09 am, Paul  wrote:
> On 15 Jun., 06:55, Joel Klabo  wrote:
>
> > I am working on a simple site right now and the views are pretty easy.
> > Usually just iterate a loop of objects. But, I am trying to figure out
> > how a website with all different kinds of data, including a sign in
> > form, is setup in django. Is that all in one big view? Or, is there
> > some way to combine them?
>
> > Any insight would be helpful, thank you.
>
> Hi Joel,
>
> very good question, I take it you want to know how "composition" is
> done at the "page level" without dragging all the logic into one view.
> In django you can generate recurring elements with template tags, for
> adding variables to the request or generate markup directly.
>
> say you want a list of users that joined your site recently:
>
> class RecentUsersNode(template.Node):
>     def __init__(self, limit):
>         try: self.limit = int(limit)
>         except ValueError: self.limit = 10
>
>     def render(self, context):
>         profiles = UserProfile.objects.order_by('user__date_joined')
> [:self.limit]
>         context['recent_users'] = profiles
>         return ''
>
> @register.tag
> def recent_users(parser, token):
>     args = token.split_contents()
>     if len(args) <= 1:
>         return RecentUsersNode(10)
>
>     num = args[1]
>     if(num[0] == num[-1] and num[0] in ('"', "'")):
>         num = num[1:-1] # strip quotes
>     return RecentUsersNode(num)
>
> {% recent_users %} will add a list of UserProfile objects to your
> request and you can use it like:
>
> {% for profile in recent_users %}
>   
> {% endfor %}
>
> In the old days of web 1.0 there was a natural 1:1 mapping from the
> page to a script/function which generates the content. With ajax it's
> becoming more like a desktop app where you have many parts/widgets
> with callbacks or events. If you want the page to display without JS,
> you still have to generate the page with one request though...
>
> cheers
>  Paul

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django architecture question

2010-06-15 Thread Joel Klabo
I guess what I'm am trying say is that I was under the impression that
when you go to a URL, a view is called. And only one view can be
called per URL. And that view needs to serve all of the data for that
page. It seems like there is a way to have multiple views being
rendered simultaneously. Is it all javascript or just a huge view
with: user login, feeds of current data, etc...

On Jun 15, 8:09 am, Paul  wrote:
> On 15 Jun., 06:55, Joel Klabo  wrote:
>
> > I am working on a simple site right now and the views are pretty easy.
> > Usually just iterate a loop of objects. But, I am trying to figure out
> > how a website with all different kinds of data, including a sign in
> > form, is setup in django. Is that all in one big view? Or, is there
> > some way to combine them?
>
> > Any insight would be helpful, thank you.
>
> Hi Joel,
>
> very good question, I take it you want to know how "composition" is
> done at the "page level" without dragging all the logic into one view.
> In django you can generate recurring elements with template tags, for
> adding variables to the request or generate markup directly.
>
> say you want a list of users that joined your site recently:
>
> class RecentUsersNode(template.Node):
>     def __init__(self, limit):
>         try: self.limit = int(limit)
>         except ValueError: self.limit = 10
>
>     def render(self, context):
>         profiles = UserProfile.objects.order_by('user__date_joined')
> [:self.limit]
>         context['recent_users'] = profiles
>         return ''
>
> @register.tag
> def recent_users(parser, token):
>     args = token.split_contents()
>     if len(args) <= 1:
>         return RecentUsersNode(10)
>
>     num = args[1]
>     if(num[0] == num[-1] and num[0] in ('"', "'")):
>         num = num[1:-1] # strip quotes
>     return RecentUsersNode(num)
>
> {% recent_users %} will add a list of UserProfile objects to your
> request and you can use it like:
>
> {% for profile in recent_users %}
>   
> {% endfor %}
>
> In the old days of web 1.0 there was a natural 1:1 mapping from the
> page to a script/function which generates the content. With ajax it's
> becoming more like a desktop app where you have many parts/widgets
> with callbacks or events. If you want the page to display without JS,
> you still have to generate the page with one request though...
>
> cheers
>  Paul

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: CSRF verification failed - 403 error

2010-07-16 Thread Joel Klabo
I had this same problem. Try this for your return statements, if
you're using render_to_response:

return render_to_response("a_template.html", c,
context_instance=RequestContext(request))

The context_instance was the key in my case. You'll need to add it to
all your views though.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



ModelForm and a new model instance

2010-07-16 Thread Joel Klabo
I am using modelForm to make a form for my Brew model. The form shows
up and works fine. And saves it when I call save. But it does not
catch the errors correctly. I set it up mostly based on this example:

from django.core.validators import ValidationError, NON_FIELD_ERRORS
try:
article.full_clean()
except ValidationError, e:
non_field_errors = e.message_dict[NON_FIELD_ERRORS]


First of all, NON_FIELD_ERRORS was unknown to django and caused an
error.

What I really want is to see a full code example of how to do this
seemingly simple thing. Just a form from a model that allows users to
create a new instance of the model and save it to the database. And
how the errors are dealt with. Please help, I swear I have looked all
through the docs.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: ModelForm and a new model instance

2010-07-17 Thread Joel Klabo
That did it! That example was what I was looking for. The error
handling led me astray, it's all taken care of. Thanks a lot.

On Jul 17, 2:42 am, Karen Tracey  wrote:
> On Fri, Jul 16, 2010 at 6:27 PM, Joel Klabo  wrote:
> > I am using modelForm to make a form for my Brew model. The form shows
> > up and works fine. And saves it when I call save. But it does not
> > catch the errors correctly. I set it up mostly based on this example:
>
> > from django.core.validators import ValidationError, NON_FIELD_ERRORS
> > try:
> >    article.full_clean()
> > except ValidationError, e:
> >    non_field_errors = e.message_dict[NON_FIELD_ERRORS]
>
> > First of all, NON_FIELD_ERRORS was unknown to django and caused an
> > error.
>
> That was an error in the doc. The import should be:
>
> from django.core.exceptions import ValidationError, NON_FIELD_ERRORS
>
> > What I really want is to see a full code example of how to do this
> > seemingly simple thing. Just a form from a model that allows users to
> > create a new instance of the model and save it to the database. And
> > how the errors are dealt with. Please help, I swear I have looked all
> > through the docs.
>
> The simplest thing is the regular Django form idiom of calling is_valid() on
> the form and re-displaying the form (now annotated with error information)
> in the case where is_valid() returns False, 
> see:http://docs.djangoproject.com/en/1.2/topics/forms/#using-a-form-in-a-...
>
> The fragment of code you posted is from the documentation for the new model
> validation feature, but it is not clear from what you have written that you
> actually want/need to use that feature? For the simplest case, it isn't
> needed.
>
> Karen
>  --http://tracey.org/kmt/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



comment template tag not working

2010-07-17 Thread Joel Klabo
I am trying to use the get_comment_list template tag and I keep
getting errors. Any ideas? http://dpaste.org/nCx0/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: comment template tag not working

2010-07-17 Thread Joel Klabo
I got it to work by adding: {% load comments %}. I had put the load
comments tag in my base.html but didn't work there for some reason.

On Jul 17, 1:00 pm, Joel Klabo  wrote:
> I am trying to use the get_comment_list template tag and I keep
> getting errors. Any ideas?http://dpaste.org/nCx0/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



django autocomplete search with jQuery

2010-07-29 Thread Joel Klabo
I have been looking around for some examples but I can't find anything
recent. This is my first AJAX experience so I would love to just see
an example because it's not quite making sense to me. Does anyone know
of a tutorial? Or have some code samples I could check out? I have
checked google btw.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Custom clean() method

2010-08-24 Thread Joel Klabo
When you write a custom clean method for a form, does is get called by
is_valid? Or does it call the standard version? Do I need to
explicitly call it?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Custom clean() method

2010-08-24 Thread Joel Klabo
Thank you, question answered.

On Aug 24, 11:45 am, Shawn Milochik  wrote:
> Your version automatically gets called during the cleaning process
> (assuming it's named properly). You don't need to call it explicitly.
> The default cleaning of the field will happen automatically. All you
> have to do is get the value from cleaned_data and make sure you return
> the value in your function.
>
> http://docs.djangoproject.com/en/dev/ref/forms/validation/#cleaning-a...
>
> Shawn

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



method on the User model?

2010-08-24 Thread Joel Klabo
I am trying to find a way to get a list of users ranked by the most
"drinks". The drink model has a User field so I am doing this to get
the info, based on the Drink model:

http://dpaste.com/hold/233600/

But, this seems like craziness. Can't I just search the
User.objects.all().order_by('drinks') or something? Can i make a User
method? I'm confused, obviously.

Here is my Drink model so you have the whole picture:

http://dpaste.com/hold/233601/

Any help on this would be great, I know there is something to be
learned from this

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



apache won't start now for some reason....

2010-08-26 Thread Joel Klabo
Apache was running fine, as far as I know I didn't change anything.
This is the error log:
http://dpaste.com/234582/

SIGTERM?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: apache won't start now for some reason....

2010-08-26 Thread Joel Klabo
Got it, I had accidentally deleted my error.log file and when it
couldn't find it it borked itself.

On Aug 26, 3:36 pm, Joel Klabo  wrote:
> Apache was running fine, as far as I know I didn't change anything.
> This is the error log:http://dpaste.com/234582/
>
> SIGTERM?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



question on directory structure for deploying project

2010-08-26 Thread Joel Klabo
on my VPS i have my project at: /srv/www/brooski.net/brooski/(all my
files, settings.py, url.py are here)

and my VirtualHost is setup like this:


ServerAdmin r...@brooski.net
ServerName brooski.net
ServerAlias www.brooski.net
DocumentRoot /srv/www/brooski.net/public_html/
PythonPath "['/srv/www/brooski.net/brooski', '/usr/lib/
pymodules/python2.6/'] + sys.path"

SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE settings
PythonDebug Off


ErrorLog /srv/www/brooski.net/logs/error.log
CustomLog /srv/www/brooski.net/logs/access.log combined


And when i goto brooski.net i get the django error page saying:

ImportError at /
No module named brooski.urls

So, I tried going and removing the 'brooski.' everywhere in my project
and that got me through a bunch of similar errors but I eventually got
one where it was using 'brooski.net' as my module name and it was
causing a problem.

Basically I don't know how to set up this structure, am I doing
something wrong? Thanks for any advice, and please don't use my
sensitive information against me...

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: question on directory structure for deploying project

2010-08-26 Thread Joel Klabo
also, when I change the virtual host path to: /srv/www/brooski.net
(instead of /srv/www/brooski.net/brooski/) I get an internal server
error. Whereas with '/srv/www/brooski.net/brooski/' I get the actual
django error page

On Aug 26, 4:20 pm, Joel Klabo  wrote:
> on my VPS i have my project at: /srv/www/brooski.net/brooski/(all my
> files, settings.py, url.py are here)
>
> and my VirtualHost is setup like this:
>
> 
>         ServerAdmin r...@brooski.net
>         ServerName brooski.net
>         ServerAliaswww.brooski.net
>         DocumentRoot /srv/www/brooski.net/public_html/
>         PythonPath "['/srv/www/brooski.net/brooski', '/usr/lib/
> pymodules/python2.6/'] + sys.path"
>         
>                 SetHandler python-program
>                 PythonHandler django.core.handlers.modpython
>                 SetEnv DJANGO_SETTINGS_MODULE settings
>                 PythonDebug Off
>         
>
>         ErrorLog /srv/www/brooski.net/logs/error.log
>         CustomLog /srv/www/brooski.net/logs/access.log combined
> 
>
> And when i goto brooski.net i get the django error page saying:
>
> ImportError at /
> No module named brooski.urls
>
> So, I tried going and removing the 'brooski.' everywhere in my project
> and that got me through a bunch of similar errors but I eventually got
> one where it was using 'brooski.net' as my module name and it was
> causing a problem.
>
> Basically I don't know how to set up this structure, am I doing
> something wrong? Thanks for any advice, and please don't use my
> sensitive information against me...

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: question on directory structure for deploying project

2010-08-26 Thread Joel Klabo
It does have __init__.py, but not the server isn't seeing it... '500
internal server error'

On Aug 26, 4:48 pm, Kenneth Gonsalves  wrote:
> On Thu, 2010-08-26 at 16:44 -0700, Joel Klabo wrote:
> > also, when I change the virtual host path to: /srv/www/brooski.net
> > (instead of /srv/www/brooski.net/brooski/) I get an internal server
> > error. Whereas with '/srv/www/brooski.net/brooski/' I get the actual
> > django error page
>
> the question is that does brooski directory have an __init__.py file in
> it. If so, It should not be on the path - only the parent directory
> should be in the path.
> --
> regards
> Kenneth Gonsalves

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: question on directory structure for deploying project

2010-08-26 Thread Joel Klabo
Could someone just show me how theirs is set up?

On Aug 26, 4:54 pm, Joel Klabo  wrote:
> It does have __init__.py, but not the server isn't seeing it... '500
> internal server error'
>
> On Aug 26, 4:48 pm, Kenneth Gonsalves  wrote:
>
>
>
> > On Thu, 2010-08-26 at 16:44 -0700, Joel Klabo wrote:
> > > also, when I change the virtual host path to: /srv/www/brooski.net
> > > (instead of /srv/www/brooski.net/brooski/) I get an internal server
> > > error. Whereas with '/srv/www/brooski.net/brooski/' I get the actual
> > > django error page
>
> > the question is that does brooski directory have an __init__.py file in
> > it. If so, It should not be on the path - only the parent directory
> > should be in the path.
> > --
> > regards
> > Kenneth Gonsalves

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: question on directory structure for deploying project

2010-08-27 Thread Joel Klabo
bmp

On Aug 26, 8:14 pm, Joel Klabo  wrote:
> Could someone just show me how theirs is set up?
>
> On Aug 26, 4:54 pm, Joel Klabo  wrote:
>
>
>
>
>
>
>
> > It does have __init__.py, but not the server isn't seeing it... '500
> > internal server error'
>
> > On Aug 26, 4:48 pm, Kenneth Gonsalves  wrote:
>
> > > On Thu, 2010-08-26 at 16:44 -0700, Joel Klabo wrote:
> > > > also, when I change the virtual host path to: /srv/www/brooski.net
> > > > (instead of /srv/www/brooski.net/brooski/) I get an internal server
> > > > error. Whereas with '/srv/www/brooski.net/brooski/' I get the actual
> > > > django error page
>
> > > the question is that does brooski directory have an __init__.py file in
> > > it. If so, It should not be on the path - only the parent directory
> > > should be in the path.
> > > --
> > > regards
> > > Kenneth Gonsalves

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



mod_wsgi setup issue

2010-08-27 Thread Joel Klabo
All the files are shown here: http://gist.github.com/554724

I don't know what I'm doing wrong but I'm still getting 500

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



mod_wsgi, apache, ubuntu setup question (noob alert)

2010-08-27 Thread Joel Klabo
This is my situation: http://gist.github.com/554724

I am getting 500 internal server error, don't know what's up...

I would appreciate any info, I'm a total apache noob.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: mod_wsgi, apache, ubuntu setup question (noob alert)

2010-08-27 Thread Joel Klabo
problem solved for the time being, I needed to add quotes around the
'settings'

On Aug 27, 10:08 pm, Joel Klabo  wrote:
> This is my situation:http://gist.github.com/554724
>
> I am getting 500 internal server error, don't know what's up...
>
> I would appreciate any info, I'm a total apache noob.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Saving a location with a model

2010-08-30 Thread Joel Klabo
I want to tie a location to each instance of a model. I am planning on
getting the lat/long. from navigator.geolocation through javascript.
My original idea is to have a location model with fields, latitude,
longitude, and the id of whatever model it is linked to. Is that the
way to go? Anyone have experience with this?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Saving a location with a model

2010-08-30 Thread Joel Klabo
looks cool. Any problems with just adding lattitude and longitute
float fields?

On Aug 30, 3:38 pm, Mikhail Korobov  wrote:
> You may find this useful:http://bitbucket.org/barttc/django-generic-location
>
> On 31 авг, 04:05, Joel Klabo  wrote:
>
>
>
> > I want to tie a location to each instance of a model. I am planning on
> > getting the lat/long. from navigator.geolocation through javascript.
> > My original idea is to have a location model with fields, latitude,
> > longitude, and the id of whatever model it is linked to. Is that the
> > way to go? Anyone have experience with this?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



django achievements

2010-09-11 Thread Joel Klabo
Does anyone know of an example of someone using django signals to do
achievements for a website? similar to foursquare or something like
that? I am going to attempt it and i don't really know where to start.
I would love some example or a nudge in the right direction.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django achievements

2010-09-12 Thread Joel Klabo
that looks perfect, thanks.

On Sep 11, 12:44 pm, "nick.l...@gmail.com" 
wrote:
> Not sure if this will help ya...but the guys at Eldarion have brabeion for
> doing badges (awards).http://github.com/eldarion/brabeion
>
> That's all I got right now!
>
> n
>
>
>
>
>
> On Sat, Sep 11, 2010 at 12:26 PM, Joel Klabo  wrote:
> > Does anyone know of an example of someone using django signals to do
> > achievements for a website? similar to foursquare or something like
> > that? I am going to attempt it and i don't really know where to start.
> > I would love some example or a nudge in the right direction.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com > groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> --
> Guadajuko! Vamos a correr!
>  -"Cool! we are going to run!"

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



RSS Questions

2010-09-17 Thread Joel Davis
Hello,

I am trying to set up a blog on my django-based website. I followed
the examples here:

http://docs.djangoproject.com/en/1.1/ref/contrib/syndication/

The docs are great, and it was pretty easy to set up. And it sort-of
works. But there are a couple of problems I can't figure out.

First: Autodiscovery in google reader (and others). When I put most
websites with a link rel="alternate" type="application/rss+xml" tag
into Google Reader, the reader can find the RSS feed and subscribe.
However, when I try this with my site, i get "This site doesn't have a
feed, google can auto-generate one for you.." As far as I can tell
I've followed everything that google suggests for autodiscovery, I
can't tell what's different about my setup vs. others.  I'm sure I'm
doing something basic and stupid but I can't spot it.

Secondly, I'd like to include the entire post in the RSS feed, not
just the description. Looking at other feeds, it looks like these are
stuffed into a "content:encoded" tag? Is that right? How to I get the
RSS feed to generate that?

The website is at http://www.tapnik.com/ and the feed is
http://www.tapnik.com/feeds/blog

I did notice that this was all refactored in django 1.2, I'd rather
stick with 1.1 if I can, but if this might be a lot easier in 1.2 then
I'll consider that.

Thanks for any advice!
Joel

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: RSS Questions

2010-09-20 Thread Joel Davis
Thanks for trying it. And it works for me now. I guess google had to
index it or something... I gave it 24 hours but I guess it needed more
time.

I thought the description had to be text. I'll try stuffing the html
into there and see if it works.

Thanks for your help!
Joel

On Sep 20, 8:17 am, Nuno Maltez  wrote:
> Hi,
>
> I didn't have any problems subscribing to your blog with google reader
> fromhttp://www.tapnik.com/
>
>
>
> > Secondly, I'd like to include the entire post in the RSS feed, not
> > just the description. Looking at other feeds, it looks like these are
> > stuffed into a "content:encoded" tag? Is that right? How to I get the
> > RSS feed to generate that?
>
> What's wrong with including the post's html in the description field?
>
> http://djangogigs.com/feeds/gigs/
>
> hth,
> Nuno
>
> On Fri, Sep 17, 2010 at 6:52 PM, Joel Davis  wrote:
> > Hello,
>
> > I am trying to set up a blog on my django-based website. I followed
> > the examples here:
>
> >http://docs.djangoproject.com/en/1.1/ref/contrib/syndication/
>
> > The docs are great, and it was pretty easy to set up. And it sort-of
> > works. But there are a couple of problems I can't figure out.
>
> > First: Autodiscovery in google reader (and others). When I put most
> > websites with a link rel="alternate" type="application/rss+xml" tag
> > into Google Reader, the reader can find the RSS feed and subscribe.
> > However, when I try this with my site, i get "This site doesn't have a
> > feed, google can auto-generate one for you.." As far as I can tell
> > I've followed everything that google suggests for autodiscovery, I
> > can't tell what's different about my setup vs. others.  I'm sure I'm
> > doing something basic and stupid but I can't spot it.
> > The website is athttp://www.tapnik.com/and the feed is
> >http://www.tapnik.com/feeds/blog
>
> > I did notice that this was all refactored in django 1.2, I'd rather
> > stick with 1.1 if I can, but if this might be a lot easier in 1.2 then
> > I'll consider that.
>
> > Thanks for any advice!
> > Joel
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Signals problem

2010-09-22 Thread Joel Klabo
I keep getting this import error and I can't figure out why? Any ideas
would be greatly appreciated: http://dpaste.org/BgtI/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Signals problem

2010-09-22 Thread Joel Klabo
Update:
http://dpaste.org/kK5p/

On Sep 22, 11:41 pm, Joel Klabo  wrote:
> I keep getting this import error and I can't figure out why? Any ideas
> would be greatly appreciated:http://dpaste.org/BgtI/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Signals problem

2010-09-23 Thread Joel Klabo
Thanks for the help, all working now!

On Sep 22, 11:52 pm, Russell Keith-Magee 
wrote:
> On Thu, Sep 23, 2010 at 2:41 PM, Joel Klabo  wrote:
> > I keep getting this import error and I can't figure out why? Any ideas
> > would be greatly appreciated:http://dpaste.org/BgtI/
>
> It's a circular import problem. signals.py imports objects from
> models.py, and models.py imports objects from signals.py. Python can't
> handle circular imports -- hence, the import error.
>
> To fix this, you either need to:
>
>  * Put everything in models.py
>  * Refactor signals.py so that it doesn't need to import models.py at
> the global level.
>
> The second approach can be handled in two ways -- either make the
> import internal to the 'drink_activity' method:
>
> def drink_activity(sender, **kwargs):
>     from models import Activity
>     
>
> or use Django's dynamic model loading to determine the model at runtime:
>
> from django.db.models import get_model
>
> def drink_activity(sender, **kwargs):
>     Activity = get_model('myapp','Activity)
>     ...
>
> Django 1.3 will probably introduce a third option -- a reliable place
> to register signals. We need this for completely separate reasons, but
> providing a safe home for signal registration will be a happy
> consequence.
>
> Yours,
> Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Image Upload question

2010-09-23 Thread Joel Klabo
I have a form trying to upload an image. In the docs it says that the
form must be bound to save a file. This is an issue for me because I
wan't to save the file with other data such as the User object that
saved it. I can't put a User object in a form so I put the username in
a hidden form field which allows me to find the user in the view and
use it. But, I can't bind the form with data not from POST right? I
need to do request.FILES, in combination with data not coming from
post. I'm obviously confused I would appreciate some guidance here

Here's the code: http://gist.github.com/594136

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Image Upload question

2010-09-23 Thread Joel Klabo
Thanks, upload is now working. But, only for smallish .png files, what
are the constraints on file type and size django sets? I can't find
the information anywhere? Beyond that, can I set them myself?

On Sep 23, 1:41 pm, Peter Bengtsson  wrote:
> By being bound it means that you will have run the .is_valid() method
> of the form instance once you've instanciated it with your POST and
> FILES data.
> E.g.
> form = BrewImageFrom(data=request.POST, files=request.FILES)
> if form.is_valid():
>     brewimage = form.save()
>
> On Sep 23, 3:00 pm, Joel Klabo  wrote:
>
>
>
> > I have a form trying to upload an image. In the docs it says that the
> > form must be bound to save a file. This is an issue for me because I
> > wan't to save the file with other data such as the User object that
> > saved it. I can't put a User object in a form so I put the username in
> > a hidden form field which allows me to find the user in the view and
> > use it. But, I can't bind the form with data not from POST right? I
> > need to do request.FILES, in combination with data not coming from
> > post. I'm obviously confused I would appreciate some guidance here
>
> > Here's the code:http://gist.github.com/594136

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Image Upload question

2010-09-23 Thread Joel Klabo
from the django docs:

inherits all attributes and methods from FileField, but also validates
that the uploaded object is a VALID IMAGE.

what does valid image mean?

On Sep 23, 2:40 pm, Joel Klabo  wrote:
> Thanks, upload is now working. But, only for smallish .png files, what
> are the constraints on file type and size django sets? I can't find
> the information anywhere? Beyond that, can I set them myself?
>
> On Sep 23, 1:41 pm, Peter Bengtsson  wrote:
>
>
>
> > By being bound it means that you will have run the .is_valid() method
> > of the form instance once you've instanciated it with your POST and
> > FILES data.
> > E.g.
> > form = BrewImageFrom(data=request.POST, files=request.FILES)
> > if form.is_valid():
> >     brewimage = form.save()
>
> > On Sep 23, 3:00 pm, Joel Klabo  wrote:
>
> > > I have a form trying to upload an image. In the docs it says that the
> > > form must be bound to save a file. This is an issue for me because I
> > > wan't to save the file with other data such as the User object that
> > > saved it. I can't put a User object in a form so I put the username in
> > > a hidden form field which allows me to find the user in the view and
> > > use it. But, I can't bind the form with data not from POST right? I
> > > need to do request.FILES, in combination with data not coming from
> > > post. I'm obviously confused I would appreciate some guidance here
>
> > > Here's the code:http://gist.github.com/594136

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Image Upload question

2010-09-23 Thread Joel Klabo
The problem was no PIL and libjpeg...

On Sep 23, 2:43 pm, Joel Klabo  wrote:
> from the django docs:
>
> inherits all attributes and methods from FileField, but also validates
> that the uploaded object is a VALID IMAGE.
>
> what does valid image mean?
>
> On Sep 23, 2:40 pm, Joel Klabo  wrote:
>
>
>
> > Thanks, upload is now working. But, only for smallish .png files, what
> > are the constraints on file type and size django sets? I can't find
> > the information anywhere? Beyond that, can I set them myself?
>
> > On Sep 23, 1:41 pm, Peter Bengtsson  wrote:
>
> > > By being bound it means that you will have run the .is_valid() method
> > > of the form instance once you've instanciated it with your POST and
> > > FILES data.
> > > E.g.
> > > form = BrewImageFrom(data=request.POST, files=request.FILES)
> > > if form.is_valid():
> > >     brewimage = form.save()
>
> > > On Sep 23, 3:00 pm, Joel Klabo  wrote:
>
> > > > I have a form trying to upload an image. In the docs it says that the
> > > > form must be bound to save a file. This is an issue for me because I
> > > > wan't to save the file with other data such as the User object that
> > > > saved it. I can't put a User object in a form so I put the username in
> > > > a hidden form field which allows me to find the user in the view and
> > > > use it. But, I can't bind the form with data not from POST right? I
> > > > need to do request.FILES, in combination with data not coming from
> > > > post. I'm obviously confused I would appreciate some guidance here
>
> > > > Here's the code:http://gist.github.com/594136

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django Registration password reset problem

2010-10-05 Thread Joel Klabo
This is the error and location of the problem: http://gist.github.com/612210,
I can't see what it's looking for. It seems like I could hard code the
arguments it wants into the reverse() but that doesn't seem like the
correct way to do it. Any advice?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django Registration password reset problem

2010-10-05 Thread Joel Klabo
Need to bump this, sorry. I don't get it.

On Oct 5, 1:04 pm, Joel Klabo  wrote:
> This is the error and location of the problem:http://gist.github.com/612210,
> I can't see what it's looking for. It seems like I could hard code the
> arguments it wants into the reverse() but that doesn't seem like the
> correct way to do it. Any advice?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django Registration password reset problem

2010-10-05 Thread Joel Klabo
Ok, so I'm pretty sure this has to do with the fact that the
post_reset_redirect argument defaults to the
django.contrib.auth.views.password_reset_done if no
post_reset_redirect is passed to the view. I am using django-
registration and it seems like there would be a better way to deal
with this... There is something I'm missing. If anyone has used this
and gotten it to work I would be grateful to hear about it. All the
other parts of the registration system work which makes me think this
has something to do with the fact that it is reverting back to the
django.contrib views and now using the ones that come with django-
registration... Here is the view where the error first pops up, this
is where post_reset_redirect is as well: http://dpaste.org/gatU/

Thanks for your time



On Oct 5, 1:56 pm, Steve Holden  wrote:
> On 10/5/2010 4:45 PM, Joel Klabo wrote:> Need to bump this, sorry. I don't 
> get it.
>
> > On Oct 5, 1:04 pm, Joel Klabo  wrote:
> >> This is the error and location of the 
> >> problem:http://gist.github.com/612210,
> >> I can't see what it's looking for. It seems like I could hard code the
> >> arguments it wants into the reverse() but that doesn't seem like the
> >> correct way to do it. Any advice?
>
> I can quite see how 41 minutes would appear to be an infinity to someone
> who is wanting the answer to a problem. Please remember, though, that
> people who post on this list aren't paid to do so, and mostly have
> full-time jobs.
>
> So a little patience will make it more likely people will help you.
>
> regards
>  Steve
> --
> DjangoCon US 2010 September 7-9http://djangocon.us/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django Registration password reset problem

2010-10-06 Thread Joel Klabo
So now I am redirecting to the named url in the URL conf. That is now
giving me the error: The included urlconf registration.auth_urls
doesn't have any patterns in it ... http://dpaste.org/OOw5/ any ideas
would be greatly appreciated

On Oct 5, 5:56 pm, Joel Klabo  wrote:
> Ok, so I'm pretty sure this has to do with the fact that the
> post_reset_redirect argument defaults to the
> django.contrib.auth.views.password_reset_done if no
> post_reset_redirect is passed to the view. I am using django-
> registration and it seems like there would be a better way to deal
> with this... There is something I'm missing. If anyone has used this
> and gotten it to work I would be grateful to hear about it. All the
> other parts of the registration system work which makes me think this
> has something to do with the fact that it is reverting back to the
> django.contrib views and now using the ones that come with django-
> registration... Here is the view where the error first pops up, this
> is where post_reset_redirect is as well:http://dpaste.org/gatU/
>
> Thanks for your time
>
> On Oct 5, 1:56 pm, Steve Holden  wrote:
>
>
>
> > On 10/5/2010 4:45 PM,JoelKlabowrote:> Need to bump this, sorry. I don't get 
> > it.
>
> > > On Oct 5, 1:04 pm,JoelKlabo wrote:
> > >> This is the error and location of the 
> > >> problem:http://gist.github.com/612210,
> > >> I can't see what it's looking for. It seems like I could hard code the
> > >> arguments it wants into the reverse() but that doesn't seem like the
> > >> correct way to do it. Any advice?
>
> > I can quite see how 41 minutes would appear to be an infinity to someone
> > who is wanting the answer to a problem. Please remember, though, that
> > people who post on this list aren't paid to do so, and mostly have
> > full-time jobs.
>
> > So a little patience will make it more likely people will help you.
>
> > regards
> >  Steve
> > --
> > DjangoCon US 2010 September 7-9http://djangocon.us/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django Registration password reset problem

2010-10-06 Thread Joel Klabo
Thanks for checking it out, this is the way it's set up: http://dpaste.org/e6Ra/

it looks like it's using registration.auth_urls to direct to the
django.contrib.auth.urls ? I don't understand why
registration.auth_urls would exist...

On Oct 6, 6:32 pm, Ian Lewis  wrote:
> I just took a cursory look at this but did you make sure to add
> something like the following to your urlpatterns in urls.py?
>
> urlpatterns=patterns('',
>     ...
>     (r'^accounts/', include('django.contrib.auth.urls')),
>     ...
> )
>
>
>
>
>
> On Thu, Oct 7, 2010 at 1:29 AM, Joel Klabo  wrote:
> > So now I am redirecting to the named url in the URL conf. That is now
> > giving me the error: The included urlconf registration.auth_urls
> > doesn't have any patterns in it ...http://dpaste.org/OOw5/any ideas
> > would be greatly appreciated
>
> > On Oct 5, 5:56 pm, Joel Klabo  wrote:
> >> Ok, so I'm pretty sure this has to do with the fact that the
> >> post_reset_redirect argument defaults to the
> >> django.contrib.auth.views.password_reset_done if no
> >> post_reset_redirect is passed to the view. I am using django-
> >> registration and it seems like there would be a better way to deal
> >> with this... There is something I'm missing. If anyone has used this
> >> and gotten it to work I would be grateful to hear about it. All the
> >> other parts of the registration system work which makes me think this
> >> has something to do with the fact that it is reverting back to the
> >> django.contrib views and now using the ones that come with django-
> >> registration... Here is the view where the error first pops up, this
> >> is where post_reset_redirect is as well:http://dpaste.org/gatU/
>
> >> Thanks for your time
>
> >> On Oct 5, 1:56 pm, Steve Holden  wrote:
>
> >> > On 10/5/2010 4:45 PM,JoelKlabowrote:> Need to bump this, sorry. I don't 
> >> > get it.
>
> >> > > On Oct 5, 1:04 pm,JoelKlabo wrote:
> >> > >> This is the error and location of the 
> >> > >> problem:http://gist.github.com/612210,
> >> > >> I can't see what it's looking for. It seems like I could hard code the
> >> > >> arguments it wants into the reverse() but that doesn't seem like the
> >> > >> correct way to do it. Any advice?
>
> >> > I can quite see how 41 minutes would appear to be an infinity to someone
> >> > who is wanting the answer to a problem. Please remember, though, that
> >> > people who post on this list aren't paid to do so, and mostly have
> >> > full-time jobs.
>
> >> > So a little patience will make it more likely people will help you.
>
> >> > regards
> >> >  Steve
> >> > --
> >> > DjangoCon US 2010 September 7-9http://djangocon.us/
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en.
>
> --
> Ian
>
> http://www.ianlewis.org/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django Registration password reset problem

2010-10-07 Thread Joel Klabo
My version is: VERSION = (0, 8, 0, 'alpha', 1)

Yeah, I have that include in my version as well...

It sends and email with this link:
http://brooski.net/accounts/password/reset/confirm/1-2r2-ce8f57c2669d29e5f24e/

<http://brooski.net/accounts/password/reset/confirm/1-2r2-ce8f57c2669d29e5f24e/>and
then when I click the link I get this error: http://dpaste.org/vrLp/



On Thu, Oct 7, 2010 at 5:48 AM, Felipe Prenholato wrote:

> Actually auth urls is 'appended' to urls in default backend (and should be
> added to your own backend if you create one).
>
> Take a look at this line: http://1l.to/bf1/ ... so you don't need to add
> it (again) to your urls.
>
> I don't have this error with password_reset_complete view , but I'm using
> my clone of original repo with some useful patches (additions). What is
> version that you are using?
>
> 2010/10/7 Joel Klabo 
>
>> Thanks for checking it out, this is the way it's set up:
>> http://dpaste.org/e6Ra/
>>
>> it looks like it's using registration.auth_urls to direct to the
>> django.contrib.auth.urls ? I don't understand why
>> registration.auth_urls would exist...
>>
>> On Oct 6, 6:32 pm, Ian Lewis  wrote:
>> > I just took a cursory look at this but did you make sure to add
>> > something like the following to your urlpatterns in urls.py?
>> >
>> > urlpatterns=patterns('',
>> > ...
>> > (r'^accounts/', include('django.contrib.auth.urls')),
>> > ...
>> > )
>> >
>> >
>> >
>> >
>> >
>> > On Thu, Oct 7, 2010 at 1:29 AM, Joel Klabo  wrote:
>> > > So now I am redirecting to the named url in the URL conf. That is now
>> > > giving me the error: The included urlconf registration.auth_urls
>> > > doesn't have any patterns in it ...http://dpaste.org/OOw5/any ideas
>> > > would be greatly appreciated
>> >
>> > > On Oct 5, 5:56 pm, Joel Klabo  wrote:
>> > >> Ok, so I'm pretty sure this has to do with the fact that the
>> > >> post_reset_redirect argument defaults to the
>> > >> django.contrib.auth.views.password_reset_done if no
>> > >> post_reset_redirect is passed to the view. I am using django-
>> > >> registration and it seems like there would be a better way to deal
>> > >> with this... There is something I'm missing. If anyone has used this
>> > >> and gotten it to work I would be grateful to hear about it. All the
>> > >> other parts of the registration system work which makes me think this
>> > >> has something to do with the fact that it is reverting back to the
>> > >> django.contrib views and now using the ones that come with django-
>> > >> registration... Here is the view where the error first pops up, this
>> > >> is where post_reset_redirect is as well:http://dpaste.org/gatU/
>> >
>> > >> Thanks for your time
>> >
>> > >> On Oct 5, 1:56 pm, Steve Holden  wrote:
>> >
>> > >> > On 10/5/2010 4:45 PM,JoelKlabowrote:> Need to bump this, sorry. I
>> don't get it.
>>
>> >
>> > >> > > On Oct 5, 1:04 pm,JoelKlabo wrote:
>> > >> > >> This is the error and location of the problem:
>> http://gist.github.com/612210,
>> > >> > >> I can't see what it's looking for. It seems like I could hard
>> code the
>> > >> > >> arguments it wants into the reverse() but that doesn't seem like
>> the
>> > >> > >> correct way to do it. Any advice?
>> >
>> > >> > I can quite see how 41 minutes would appear to be an infinity to
>> someone
>> > >> > who is wanting the answer to a problem. Please remember, though,
>> that
>> > >> > people who post on this list aren't paid to do so, and mostly have
>> > >> > full-time jobs.
>> >
>> > >> > So a little patience will make it more likely people will help you.
>> >
>> > >> > regards
>> > >> >  Steve
>> > >> > --
>> > >> > DjangoCon US 2010 September 7-9http://djangocon.us/
>> >
>> > > --
>> > > You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> > > To post to this group, send email to django-us...@googlegroups.com.
>> > 

Re: Django Registration password reset problem

2010-10-07 Thread Joel Klabo
Also, all my code is on Github if you would like to see something else:
http://github.com/joelklabo/brooski

I really appreciate your help, thank you.

On Thu, Oct 7, 2010 at 9:43 AM, Joel Klabo  wrote:

> My version is: VERSION = (0, 8, 0, 'alpha', 1)
>
> Yeah, I have that include in my version as well...
>
> It sends and email with this link:
> http://brooski.net/accounts/password/reset/confirm/1-2r2-ce8f57c2669d29e5f24e/
>
>
> <http://brooski.net/accounts/password/reset/confirm/1-2r2-ce8f57c2669d29e5f24e/>and
> then when I click the link I get this error: http://dpaste.org/vrLp/
>
>
>
> On Thu, Oct 7, 2010 at 5:48 AM, Felipe Prenholato wrote:
>
>> Actually auth urls is 'appended' to urls in default backend (and should be
>> added to your own backend if you create one).
>>
>> Take a look at this line: http://1l.to/bf1/ ... so you don't need to add
>> it (again) to your urls.
>>
>> I don't have this error with password_reset_complete view , but I'm using
>> my clone of original repo with some useful patches (additions). What is
>> version that you are using?
>>
>> 2010/10/7 Joel Klabo 
>>
>>> Thanks for checking it out, this is the way it's set up:
>>> http://dpaste.org/e6Ra/
>>>
>>> it looks like it's using registration.auth_urls to direct to the
>>> django.contrib.auth.urls ? I don't understand why
>>> registration.auth_urls would exist...
>>>
>>> On Oct 6, 6:32 pm, Ian Lewis  wrote:
>>> > I just took a cursory look at this but did you make sure to add
>>> > something like the following to your urlpatterns in urls.py?
>>> >
>>> > urlpatterns=patterns('',
>>> > ...
>>> > (r'^accounts/', include('django.contrib.auth.urls')),
>>> > ...
>>> > )
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > On Thu, Oct 7, 2010 at 1:29 AM, Joel Klabo 
>>> wrote:
>>> > > So now I am redirecting to the named url in the URL conf. That is now
>>> > > giving me the error: The included urlconf registration.auth_urls
>>> > > doesn't have any patterns in it ...http://dpaste.org/OOw5/any ideas
>>> > > would be greatly appreciated
>>> >
>>> > > On Oct 5, 5:56 pm, Joel Klabo  wrote:
>>> > >> Ok, so I'm pretty sure this has to do with the fact that the
>>> > >> post_reset_redirect argument defaults to the
>>> > >> django.contrib.auth.views.password_reset_done if no
>>> > >> post_reset_redirect is passed to the view. I am using django-
>>> > >> registration and it seems like there would be a better way to deal
>>> > >> with this... There is something I'm missing. If anyone has used this
>>> > >> and gotten it to work I would be grateful to hear about it. All the
>>> > >> other parts of the registration system work which makes me think
>>> this
>>> > >> has something to do with the fact that it is reverting back to the
>>> > >> django.contrib views and now using the ones that come with django-
>>> > >> registration... Here is the view where the error first pops up, this
>>> > >> is where post_reset_redirect is as well:http://dpaste.org/gatU/
>>> >
>>> > >> Thanks for your time
>>> >
>>> > >> On Oct 5, 1:56 pm, Steve Holden  wrote:
>>> >
>>> > >> > On 10/5/2010 4:45 PM,JoelKlabowrote:> Need to bump this, sorry. I
>>> don't get it.
>>>
>>> >
>>> > >> > > On Oct 5, 1:04 pm,JoelKlabo wrote:
>>> > >> > >> This is the error and location of the problem:
>>> http://gist.github.com/612210,
>>> > >> > >> I can't see what it's looking for. It seems like I could hard
>>> code the
>>> > >> > >> arguments it wants into the reverse() but that doesn't seem
>>> like the
>>> > >> > >> correct way to do it. Any advice?
>>> >
>>> > >> > I can quite see how 41 minutes would appear to be an infinity to
>>> someone
>>> > >> > who is wanting the answer to a problem. Please remember, though,
>>> that
>>> > >> > people who post on this list aren't paid to do so, and mostly have
>>> > >

Re: Django Registration password reset problem

2010-10-07 Thread Joel Klabo
I am just using it as is. I haven't modified any of the code from
django-registration. I'm confused as to how these are connected. Thanks for
looking.

On Thu, Oct 7, 2010 at 10:20 AM, Felipe Prenholato wrote:

> This auth_views.py doesn't exist in trunk (that is this version), sounds
> like you writing custom admin views? Or you just copied admin/views.py
> locally?
>
> You already tried to resolve via name of url?
> Else, if you writing custom admin views, isn't right to reference this
> custom views?
>
> (anyway, tonight I'll check the code)
>
> 2010/10/7 Joel Klabo 
>
>> Also, all my code is on Github if you would like to see something else:
>> http://github.com/joelklabo/brooski
>>
>> I really appreciate your help, thank you.
>>
>> On Thu, Oct 7, 2010 at 9:43 AM, Joel Klabo  wrote:
>>
>>> My version is: VERSION = (0, 8, 0, 'alpha', 1)
>>>
>>> Yeah, I have that include in my version as well...
>>>
>>> It sends and email with this link:
>>> http://brooski.net/accounts/password/reset/confirm/1-2r2-ce8f57c2669d29e5f24e/
>>>
>>>
>>> <http://brooski.net/accounts/password/reset/confirm/1-2r2-ce8f57c2669d29e5f24e/>and
>>> then when I click the link I get this error: http://dpaste.org/vrLp/
>>>
>>>
>>>
>>> On Thu, Oct 7, 2010 at 5:48 AM, Felipe Prenholato 
>>> wrote:
>>>
>>>> Actually auth urls is 'appended' to urls in default backend (and should
>>>> be added to your own backend if you create one).
>>>>
>>>> Take a look at this line: http://1l.to/bf1/ ... so you don't need to
>>>> add it (again) to your urls.
>>>>
>>>> I don't have this error with password_reset_complete view , but I'm
>>>> using my clone of original repo with some useful patches (additions). What
>>>> is version that you are using?
>>>>
>>>> 2010/10/7 Joel Klabo 
>>>>
>>>>> Thanks for checking it out, this is the way it's set up:
>>>>> http://dpaste.org/e6Ra/
>>>>>
>>>>> it looks like it's using registration.auth_urls to direct to the
>>>>> django.contrib.auth.urls ? I don't understand why
>>>>> registration.auth_urls would exist...
>>>>>
>>>>> On Oct 6, 6:32 pm, Ian Lewis  wrote:
>>>>> > I just took a cursory look at this but did you make sure to add
>>>>> > something like the following to your urlpatterns in urls.py?
>>>>> >
>>>>> > urlpatterns=patterns('',
>>>>> > ...
>>>>> > (r'^accounts/', include('django.contrib.auth.urls')),
>>>>> > ...
>>>>> > )
>>>>> >
>>>>> >
>>>>> >
>>>>> >
>>>>> >
>>>>> > On Thu, Oct 7, 2010 at 1:29 AM, Joel Klabo 
>>>>> wrote:
>>>>> > > So now I am redirecting to the named url in the URL conf. That is
>>>>> now
>>>>> > > giving me the error: The included urlconf registration.auth_urls
>>>>> > > doesn't have any patterns in it ...http://dpaste.org/OOw5/anyideas
>>>>> > > would be greatly appreciated
>>>>> >
>>>>> > > On Oct 5, 5:56 pm, Joel Klabo  wrote:
>>>>> > >> Ok, so I'm pretty sure this has to do with the fact that the
>>>>> > >> post_reset_redirect argument defaults to the
>>>>> > >> django.contrib.auth.views.password_reset_done if no
>>>>> > >> post_reset_redirect is passed to the view. I am using django-
>>>>> > >> registration and it seems like there would be a better way to deal
>>>>> > >> with this... There is something I'm missing. If anyone has used
>>>>> this
>>>>> > >> and gotten it to work I would be grateful to hear about it. All
>>>>> the
>>>>> > >> other parts of the registration system work which makes me think
>>>>> this
>>>>> > >> has something to do with the fact that it is reverting back to the
>>>>> > >> django.contrib views and now using the ones that come with django-
>>>>> > >> registration... Here is the view where the error first pops up,
>>>>> thi

Re: Django Registration password reset problem

2010-10-07 Thread Joel Klabo
Awesome, that fixed it. All I had to do was change "from registration import
auth_views" to "from django.contrib.auth import views as auth_views"

Thank you so much


On Thu, Oct 7, 2010 at 12:56 PM, Ted  wrote:

> I think your problem is in auth_urls.py
>
> 28 - from registration import auth_views
>
> in my version of registration this is:
> from django.contrib.auth import views as auth_views
>
>
> Then you can understand why you get this error:
> NoReverseMatch: Reverse for
> 'django.contrib.auth.views.password_reset_complete' with arguments
> '()' and keyword arguments '{}' not found.
>
> Because, you aren't mapping a URL to
> django.contrib.auth.views.password_reset_complete.  You are mapping a
> URL to registration.auth_views.password_reset_complete.  Django
> doesn't know that registration.auth_views.password_reset_complete is
> where you handle django.contrib.auth.views.password_reset_complete.
>
> You have two ways out of this:
>
> 1) don't use your local copy of auth_views, switch back to the
> imported version.
>
> 2) In auth_views.py update:
> 110 - post_reset_redirect =
> reverse('django.contrib.auth.views.password_reset_done')
> 144 -  post_reset_redirect =
> reverse('django.contrib.auth.views.password_reset_complete')
> 177 - post_change_redirect =
> reverse('django.contrib.auth.views.password_change_done')
>
> to
> 110 - post_reset_redirect =
> reverse('registration.auth_views.password_reset_done')
> 144 -  post_reset_redirect =
> reverse('registration.auth_views.password_reset_complete')
> 177 - post_change_redirect =
> reverse('registration.auth_views.password_change_done')
>
> It also bears mentioning that name spacing registration can cause a
> similar set of errors.
>
> Let me know if that worked,
> Ted
>
> On Oct 7, 10:59 am, Joel Klabo  wrote:
> > I am just using it as is. I haven't modified any of the code from
> > django-registration. I'm confused as to how these are connected. Thanks
> for
> > looking.
> >
> > On Thu, Oct 7, 2010 at 10:20 AM, Felipe Prenholato  >wrote:
> >
> >
> >
> > > This auth_views.py doesn't exist in trunk (that is this version),
> sounds
> > > like you writing custom admin views? Or you just copied admin/views.py
> > > locally?
> >
> > > You already tried to resolve via name of url?
> > > Else, if you writing custom admin views, isn't right to reference this
> > > custom views?
> >
> > > (anyway, tonight I'll check the code)
> >
> > > 2010/10/7 Joel Klabo 
> >
> > >> Also, all my code is on Github if you would like to see something
> else:
> > >>http://github.com/joelklabo/brooski
> >
> > >> I really appreciate your help, thank you.
> >
> > >> On Thu, Oct 7, 2010 at 9:43 AM, Joel Klabo 
> wrote:
> >
> > >>> My version is: VERSION = (0, 8, 0, 'alpha', 1)
> >
> > >>> Yeah, I have that include in my version as well...
> >
> > >>> It sends and email with this link:
> > >>>
> http://brooski.net/accounts/password/reset/confirm/1-2r2-ce8f57c2669d...
> >
> > >>> <
> http://brooski.net/accounts/password/reset/confirm/1-2r2-ce8f57c2669d..
> .>and
> > >>> then when I click the link I get this error:http://dpaste.org/vrLp/
> >
> > >>> On Thu, Oct 7, 2010 at 5:48 AM, Felipe Prenholato <
> philipe...@gmail.com>wrote:
> >
> > >>>> Actually auth urls is 'appended' to urls in default backend (and
> should
> > >>>> be added to your own backend if you create one).
> >
> > >>>> Take a look at this line:http://1l.to/bf1/... so you don't need to
> > >>>> add it (again) to your urls.
> >
> > >>>> I don't have this error with password_reset_complete view , but I'm
> > >>>> using my clone of original repo with some useful patches
> (additions). What
> > >>>> is version that you are using?
> >
> > >>>> 2010/10/7 Joel Klabo 
> >
> > >>>>> Thanks for checking it out, this is the way it's set up:
> > >>>>>http://dpaste.org/e6Ra/
> >
> > >>>>> it looks like it's using registration.auth_urls to direct to the
> > >>>>> django.contrib.auth.urls ? I don't understand 

Re: Django Registration password reset problem

2010-10-07 Thread Joel Klabo
Yeah. I don't understand that either. Except that auth_views.py uses
different templates I think…

Sent from my iPhone

On Oct 7, 2010, at 1:50 PM, Felipe Prenholato  wrote:

But about views that you have at auth_views.py, are same of django auth
views?
this registration/auth_views.py exists for something, not?

2010/10/7 Joel Klabo 

> Awesome, that fixed it. All I had to do was change "from registration
> import auth_views" to "from django.contrib.auth import views as auth_views"
>
> Thank you so much
>
>
> On Thu, Oct 7, 2010 at 12:56 PM, Ted  wrote:
>
>> I think your problem is in auth_urls.py
>>
>> 28 - from registration import auth_views
>>
>> in my version of registration this is:
>> from django.contrib.auth import views as auth_views
>>
>>
>> Then you can understand why you get this error:
>> NoReverseMatch: Reverse for
>> 'django.contrib.auth.views.password_reset_complete' with arguments
>> '()' and keyword arguments '{}' not found.
>>
>> Because, you aren't mapping a URL to
>> django.contrib.auth.views.password_reset_complete.  You are mapping a
>> URL to registration.auth_views.password_reset_complete.  Django
>> doesn't know that registration.auth_views.password_reset_complete is
>> where you handle django.contrib.auth.views.password_reset_complete.
>>
>> You have two ways out of this:
>>
>> 1) don't use your local copy of auth_views, switch back to the
>> imported version.
>>
>> 2) In auth_views.py update:
>> 110 - post_reset_redirect =
>> reverse('django.contrib.auth.views.password_reset_done')
>> 144 -  post_reset_redirect =
>> reverse('django.contrib.auth.views.password_reset_complete')
>> 177 - post_change_redirect =
>> reverse('django.contrib.auth.views.password_change_done')
>>
>> to
>> 110 - post_reset_redirect =
>> reverse('registration.auth_views.password_reset_done')
>> 144 -  post_reset_redirect =
>> reverse('registration.auth_views.password_reset_complete')
>> 177 - post_change_redirect =
>> reverse('registration.auth_views.password_change_done')
>>
>> It also bears mentioning that name spacing registration can cause a
>> similar set of errors.
>>
>> Let me know if that worked,
>> Ted
>>
>> On Oct 7, 10:59 am, Joel Klabo  wrote:
>> > I am just using it as is. I haven't modified any of the code from
>> > django-registration. I'm confused as to how these are connected. Thanks
>> for
>> > looking.
>> >
>> > On Thu, Oct 7, 2010 at 10:20 AM, Felipe Prenholato <
>> philipe...@gmail.com>wrote:
>> >
>> >
>> >
>> > > This auth_views.py doesn't exist in trunk (that is this version),
>> sounds
>> > > like you writing custom admin views? Or you just copied admin/views.py
>> > > locally?
>> >
>> > > You already tried to resolve via name of url?
>> > > Else, if you writing custom admin views, isn't right to reference this
>> > > custom views?
>> >
>> > > (anyway, tonight I'll check the code)
>> >
>> > > 2010/10/7 Joel Klabo 
>> >
>> > >> Also, all my code is on Github if you would like to see something
>> else:
>> > >>http://github.com/joelklabo/brooski
>> >
>> > >> I really appreciate your help, thank you.
>> >
>> > >> On Thu, Oct 7, 2010 at 9:43 AM, Joel Klabo 
>> wrote:
>> >
>> > >>> My version is: VERSION = (0, 8, 0, 'alpha', 1)
>> >
>> > >>> Yeah, I have that include in my version as well...
>> >
>> > >>> It sends and email with this link:
>> > >>>
>> http://brooski.net/accounts/password/reset/confirm/1-2r2-ce8f57c2669d...
>> >
>> > >>> <
>> http://brooski.net/accounts/password/reset/confirm/1-2r2-ce8f57c2669d..
>> .>and
>> > >>> then when I click the link I get this error:http://dpaste.org/vrLp/
>> >
>> > >>> On Thu, Oct 7, 2010 at 5:48 AM, Felipe Prenholato <
>> philipe...@gmail.com>wrote:
>> >
>> > >>>> Actually auth urls is 'appended' to urls in default backend (and
>> should
>> > >>>> be added to your own backend if you create one).
>> >
>> > >>>> Take a look at this line:http://1l.to/bf1/... so you don't

Customizing Admin Forms Question

2010-01-15 Thread Joel Davis
I've got a couple of questions about customizing the admin pages...

First, is there a way to specify the layout/template for an admin form
by hand? I've got a Model that has a bunch of optional fields,
including a bunch of TextAreas, and the form is huge and jumbled. I'd
like to make a custom template for it, use JS to hide the optional
bits by default, and layout the fields in something other than a big
stack.

Second, is there a way to add fields to an Admin form that don't get
added to the model? For example, I've got an imagefield, and when it
calls save(), it autogenerates a thumbnail, that works fine, but I
might like to have some extra controls to customize the behavior of
the thumbnail generation, but these don't need to get stored in the DB
anywhere..

Thanks!
Joel
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




  1   2   3   4   >