Re: How to create an individual instagram message into threads?

2023-08-28 Thread 'Steven Mapes' via Django users
I've not used that app but creating email of messaging chains is quite 
easy. How I normally do it is to generate a unique identifier by using a 
uuid4 plus some custom values when a new thread/conversation is created and 
then this is passed and maintained during replies.  There's probably 
something similar in that app. Emails tend to call it a Conversation ID

On Sunday, 27 August 2023 at 22:19:46 UTC+1 Ram wrote:

> Hi,
>
> We are using Instagram clone messaging in our ecommerce application where 
> users contact each other about market place item (sell/buy items). Once the 
> messaging started between two users on an item
> 1. we want to keep the further messaging regarding that item to be 
> continued like an email thread so that all the messaging about that item 
> will be in one thread.
> 2. New messaging on new market place item will be again new thread.
> 3. It would be nice each thread has a title of the market place item so 
> that same users can go back to previous history of messages on that 
> particular item whenever they want.
>
> I'm wondering whether anyone has implemented the above features using 
> instagram clone in your Django application?
>
> Best regards,
> ~Ram
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/099349c1-bfc4-42e8-8178-50141c7640d0n%40googlegroups.com.


Re: table bank_app_bank has no column named DOB

2023-08-25 Thread Steven maithya

(en) PS C:\Users\steve.musyoka\Desktop\CRM-master> python manage.py 
runserver
C:\Python311\python.exe: can't open file 
'C:\\Users\\steve.musyoka\\Desktop\\CRM-master\\manage.py': [Errno 2] No 
such file or directory
(en) PS C:\Users\steve.musyoka\Desktop\CRM-master> cd
(en) PS C:\Users\steve.musyoka\Desktop\CRM-master> ls






this is the error am getting when i run my django project any help please

On Thursday, August 24, 2023 at 10:25:23 AM UTC+3 meenu loranz wrote:

> from django.contrib import auth, messages
> from django.http import HttpResponse
> from django.shortcuts import render, redirect
>
> from bank_app.models import bank
>
> # Create your views here.
>
>
> def home(request):
> return render(request,"home.html")
>
> def login(request):
> if request.method == 'POST':
> username = request.POST['username']
> password = request.POST['password']
> user = auth.authenticate(username=username,password=password)
>
> if user is not None:
> auth.login(request,user)
> return redirect('/')
> else:
> messages.info(request,"invalid username or password")
> return redirect('login')
> return render(request,"login.html")
>
> def registration(request):
> return render(request,"registration.html")
>
> def add_form(request):
> if request.method == "POST":
> name = request.POST.get('name',)
> dob = request.POST.get('dob', )
> age = request.POST.get('age', )
> gender = request.POST.get('gender', )
> phone_no = request.POST.get('phone_no', )
> mail_id = request.POST.get('mail_id',)
> address = request.POST.get('address',)
> district = request.POST.get('district',)
> branch = request.POST.get('branch',)
> account_type = request.POST.get('account_type',)
>
> Bank = bank(name=name,dob=dob,age=age,gender=gender,phone_no=phone_no,
> mail_id=mail_id,address=address,district=district,
> branch=branch,account_type=account_type,)
>
> Bank.save()
> messages.info(request, 'Bank added successfully')
> return redirect('home')
> return render(request,'add.html')
>
> This is my views.py page. 
> On Tuesday, August 22, 2023 at 12:49:39 AM UTC+5:30 Mike Simkins wrote:
>
>> Did you regenerate and rerun the migrations ??
>>
>>
>> python manage.py makemigrations
>> python manage.py migrate
>>
>>
>>
>> On 21 Aug 2023, at 09:46, meenu loranz  wrote:
>>
>> Thank you for your response...i changed DOB to dob...but still showing me 
>> the error...
>> OperationalError at /add/ table bank_app_bank has no column named dob 
>> Request Method: 
>> POST 
>> Request URL: 
>> http://127.0.0.1:8000/add/ 
>> Django Version: 
>> 4.2 
>> Exception Type: 
>> OperationalError 
>> Exception Value: 
>> table bank_app_bank has no column named dob 
>> Exception Location: 
>> C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\django\db\backends\sqlite3\base.py,
>>  
>> line 328, in execute 
>> Raised during: 
>> bank_app.views.add_form 
>> Python Executable: 
>> C:\Users\Admin\AppData\Local\Programs\Python\Python39\python.exe 
>> Python Version: 
>> 3.9.0 
>> Python Path: 
>> ['C:\\Users\\Admin\\myprojects\\banking_system\\bank_project', 
>> 'C:\\Users\\Admin\\AppData\\Local\\Programs\\Python\\Python39\\python39.zip',
>>  
>> 'C:\\Users\\Admin\\AppData\\Local\\Programs\\Python\\Python39\\DLLs', 
>> 'C:\\Users\\Admin\\AppData\\Local\\Programs\\Python\\Python39\\lib', 
>> 'C:\\Users\\Admin\\AppData\\Local\\Programs\\Python\\Python39', 
>> 'C:\\Users\\Admin\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages']
>>  
>>
>> Server time: 
>> Mon, 21 Aug 2023 08:44:34 +
>>
>> On Saturday, August 19, 2023 at 10:49:13 PM UTC+5:30 RANGA BHARATH JINKA 
>> wrote:
>>
>>> Hi,
>>>
>>> Try changing DOB to small letters dob and run the migrations again. 
>>>
>>> All the best 
>>>
>>> Thanks and Regards
>>>
>>> J. Ranga Bharath
>>> Cell: 9110334114
>>> 
>>>
>>> On Sat, 19 Aug 2023, 9:18 pm ivan harold,  wrote:
>>>

 https://stackoverflow.com/questions/68269165/why-django-is-not-detecting-my-table-column

 Try reading this article, it may help you.

 On Saturday, August 19, 2023 at 3:05:57 AM UTC+8 meenu loranz wrote:

> from django.contrib.auth.models import User
> from django.db import models
> from django.urls import reverse
> # Create your models here.
>
> class bank(models.Model):
> name = models.CharField(max_length=255)
> DOB = models.DateField()
> age = models.IntegerField()
> gender = models.CharField(max_length=10)
> phone_no = models.CharField(max_length=10)
> mail_id = models.EmailField(max_length=25)
> address = models.CharField(max_length=255)
> district = models.CharField(max_length=100)
> branch = models.CharField(max_length=100)
> account_type = models.CharField(max_length=100)
> # materials_provided = models.CharField(max_length=100)
>
>
> def __str__(self):
> return self.name
>
> This is my model.py page. And i can see this table and all fields in 
> my database. But while running show me the 

errors am getting during running my project any help

2023-08-25 Thread Steven maithya
(en) PS C:\Users\steve.musyoka\Desktop\CRM-master> python manage.py 
runserver
C:\Python311\python.exe: can't open file 
'C:\\Users\\steve.musyoka\\Desktop\\CRM-master\\manage.py': [Errno 2] No 
such file or directory
(en) PS C:\Users\steve.musyoka\Desktop\CRM-master> cd
(en) PS C:\Users\steve.musyoka\Desktop\CRM-master> ls

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2987c90d-d8cd-4710-9b13-a276802a088cn%40googlegroups.com.


Re: Undelivered Mail Returned to Sender

2023-06-15 Thread Steven Lizhi
Maybe you can use email cc param to send more email users.

On Wed, Jun 14, 2023 at 8:19 PM Precious Imoniakemu <
preciousimoniak...@gmail.com> wrote:

> invoice_html = html2pdf('product/invoice.html', context)
>
> subject = 'Invoice for your order'
> message = 'Please find attached the invoice for your
> order. This is a no reply mail but you can contact us through
> supp...@domainname.com for any enquiry.'
> from_email = settings.EMAIL_HOST_USER
> to_email = order.email
>
> # Convert invoice_html to a File object
> invoice_file = BytesIO(invoice_html)
>
> email = EmailMessage(subject, message, from_email, [
> to_email])
> email.attach(
> 'invoice.pdf', invoice_file.getvalue(),
> 'application/pdf')
> email.send()
>
> subject_ = 'Notice for an order'
> message_ = f'Please find notice information for { order.
> full_name } new order.'
> from_email_ = settings.EMAIL_HOST_USER
> to_email_ = 'ad...@domainname.com'
>
> notice = EmailMessage(subject_, message_,
>   from_email_, [to_email_])
> notice.attach(
> 'invoice.pdf', invoice_file.getvalue(),
> 'application/pdf')
> notice.send()
>
> EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
> EMAIL_HOST = os.getenv('EMAIL_HOST') #mail.privateemail.com
> EMAIL_PORT = os.getenv('EMAIL_PORT') #465
> EMAIL_HOST_USER = os.getenv('EMAIL_HOST_USER')
> EMAIL_HOST_PASSWORD = os.getenv('EMAIL_HOST_PASSWORD')
> EMAIL_USE_TLS = False
> EMAIL_USE_SSL = True
> I tried sending mail to from my privateemail i got from namecheap to gmail
> but it gives thr content below: This is the mail system at host
> mailout-pe-b.jellyfish.systems.
>
> I'm sorry to have to inform you that your message could not
> be delivered to one or more recipients.
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d77e903b-b210-43b0-9315-49abf082c60bn%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO_rqR5qbU%3Dwu6LSi8B89DYx04i_G%2BRUjA7T5VGE6TuxY9rMhQ%40mail.gmail.com.


Re: Slow Performance of Django Web App

2023-06-12 Thread 'Steven Mapes' via Django users
To start with I'd look at upgrading the project to the latest version of 
Django and Python as Python 3.10 and 3.11 have some performance 
improvements and you'll need to be on a Django 4 version to support them.

That aside it sounds like you've got good caching architecture setup  since 
it's working well when cached but that the architecture without the caching 
is not up to the job. You need to investigate where the performance hit is 
coming in, most likely it'll be database performance. Once thing to check 
would be whether you are using things like like prefetch_related, 
select_related, and defer with any queryset or are you always returning the 
whole object. If you are returning the whole object do you need to? 

After that it depends on how you are using and exposing Django as to what 
I'd suggest you check next. Are you using DRF as API backend to the pages 
in S3 or are you serving pages via Django and then caching those?  If it's 
the latter, run it locally with caching turned off and debug toolbar 
installed and look at each pages output to see how many queries you are 
hitting per page and the performance of each.

Since you are using a lot of caching how are you maintaining the cache? Are 
you letting it expire and then self populate or are you using warm-ups to 
fetch the update information and then update the cache prior to it 
expiring? If you're doing the former but the latter fits your setup look to 
switch to that. In those instances you can update the fetch the results to 
update the cache outside of a user transaction

On Monday, 12 June 2023 at 06:23:06 UTC+1 Kunal Mittal wrote:

> Hi, we are using Django 1.8.5
> Architecture is like -  Nginx side car -> wsgi server (gunicorn) -> 
> application
> On Monday, June 12, 2023 at 1:06:18 AM UTC+5:30 Mz Gz wrote:
>
>> What server do you use ?
>>
>> On Sun, 11 Jun 2023, 10:00 pm Kunal Mittal,  wrote:
>>
>>> I've a django application serving 10k+ users daily, that application has 
>>> everything to be on the top of performance metrics but still some API's 
>>> have high latencies, application serves lots of pages with nice css and 
>>> various images, on most the pages they are being served by s3 while on some 
>>> it's via django static files. We have implemented caching on akamai for 
>>> every static file that application serves, whenever that cache disappears 
>>> latency of each and every API spikes exponentially, at that time even 
>>> loading metrics becomes a pain, server does not pick those requests. Can 
>>> anyone suggest what's going on here. 
>>>
>>> -- 
>>> 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 view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/d32868ba-a2df-41e3-8f41-3ecc3c1b3471n%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c5e4d83c-1891-4005-939e-8c0f3f074cf2n%40googlegroups.com.


Re: how to convert to Django 3 or 4

2023-06-12 Thread 'Steven Mapes' via Django users
Ah Python 2.7, you'll need to upgrade through to at least 3.8 so unless 
it's a huge project where you have time to upgrade through the Django 
Versions and different versions of Python as you go, you may just want to 
create a new project and lift the code as you go.

On Friday, 9 June 2023 at 15:29:47 UTC+1 Rogerio Carrasqueira wrote:

> I'm using python 2.7, wich your suggestion?
>
> Thanks
>
>
> Rogério Carrasqueira
>
>
>
>
>
> Em sex., 9 de jun. de 2023 às 03:37, 'Steven Mapes' via Django users <
> django...@googlegroups.com> escreveu:
>
>> If you want to go directly then start a new project and "lift and shift" 
>> code fixing and updating as you go. Depending on the size of the project 
>> and the complexity of the processes it may be the fastest way to do it.
>>
>> If you want to keep the same project then upgrade in stages. The fact 
>> you're in 1.4 will make it hard and you'll need to do a lot of manual 
>> changes to get into 1.8 so starting new may well be quicker. If you did 
>> upgrade then I'd go 1.8 to 1.11, 2.2, 3.2 and finally 4.2.
>>
>> Branch the code using version control and see how bad it is but it'll 
>> depend on the project.
>> I went from 1.11 to 3.2 in a day for one but most of the code was bespoke 
>> without may external packages to worry about. Those could also cause you 
>> issues.
>>
>> Since the code is Django 1.4 what version of python is it also using?
>>
>>
>> On Thu, Jun 8, 2023, 21:31 Rogerio Carrasqueira  
>> wrote:
>>
>>> So just to undersand, I cannot move directly from 1.4 to 4 I have to do 
>>> it in steps, right?
>>>
>>> Thanks 
>>> Rogério Carrasqueira
>>>
>>>
>>>
>>>
>>>
>>> Em qui., 8 de jun. de 2023 às 17:01, 'Steven Mapes' via Django users <
>>> django...@googlegroups.com> escreveu:
>>>
>>>> I've used it to go from Django 3 to 4 and to move a project from 1.11 
>>>> to 2.2.
>>>>
>>>> It doesn't do everything for you but it's a great start. I've 
>>>> personally moved from 1.8 through to 4.2.2 but that was during their 
>>>> development lifecycle. Moving up to 1.7 and then 1.7 to 1.8 and 1.8 to 
>>>> 1.11 
>>>> and 1.11 to 2 will be the hardest parts but it'll get easier once you're 
>>>> on 
>>>> 1.11
>>>>
>>>> On Thu, Jun 8, 2023, 19:58 Rogério Carrasqueira <
>>>> rogerio.ca...@gmail.com> wrote:
>>>>
>>>>> Hey Steven!
>>>>>
>>>>> Thanks for this information, do you have tried it before? I would like 
>>>>> to move from 1.4 to lastest, do you think that is it possible?
>>>>>
>>>>> Thanks
>>>>>
>>>>> Em quarta-feira, 7 de junho de 2023 às 11:52:35 UTC-3, Steven Mapes 
>>>>> escreveu:
>>>>>
>>>>>> I'd suggest looking into using Adam Johnson's Django-Upgrade told -
>>>>>> https://github.com/adamchainz/django-upgrade it will help you move 
>>>>>> between versions
>>>>>>
>>>>>> On Tuesday, 6 June 2023 at 15:24:36 UTC+1 Paul Haguet wrote:
>>>>>>
>>>>>>> There is a lot of function who can change. 
>>>>>>>
>>>>>>> https://docs.djangoproject.com/en/4.2/releases/4.0/
>>>>>>>
>>>>>>> All the function declared as deprecated into Django 3 has been 
>>>>>>> removed into Django 4. In the deprecated section of django 3 new 
>>>>>>> functions 
>>>>>>> names are systematically indicated. So just search the function under 
>>>>>>> their 
>>>>>>> old name and replace them with their new name. The 2 links below give 
>>>>>>> the 
>>>>>>> list.
>>>>>>>
>>>>>>>
>>>>>>> https://docs.djangoproject.com/en/4.2/releases/3.0/#deprecated-features-3-0
>>>>>>>
>>>>>>> https://docs.djangoproject.com/en/4.2/releases/3.1/#deprecated-features-3-1
>>>>>>>
>>>>>>> Le samedi 3 juin 2023 à 10:10:31 UTC+2, Shams Ulhaq a écrit :
>>>>>>>
>>>>>>>> Just need to change url import 
>>>>>>>>
>>>>>>>> from django.urls import include, re_path as url
>>>>>>&g

Re: how to convert to Django 3 or 4

2023-06-09 Thread 'Steven Mapes' via Django users
If you want to go directly then start a new project and "lift and shift"
code fixing and updating as you go. Depending on the size of the project
and the complexity of the processes it may be the fastest way to do it.

If you want to keep the same project then upgrade in stages. The fact
you're in 1.4 will make it hard and you'll need to do a lot of manual
changes to get into 1.8 so starting new may well be quicker. If you did
upgrade then I'd go 1.8 to 1.11, 2.2, 3.2 and finally 4.2.

Branch the code using version control and see how bad it is but it'll
depend on the project.
I went from 1.11 to 3.2 in a day for one but most of the code was bespoke
without may external packages to worry about. Those could also cause you
issues.

Since the code is Django 1.4 what version of python is it also using?


On Thu, Jun 8, 2023, 21:31 Rogerio Carrasqueira <
rogerio.carrasque...@gmail.com> wrote:

> So just to undersand, I cannot move directly from 1.4 to 4 I have to do it
> in steps, right?
>
> Thanks
> Rogério Carrasqueira
>
>
>
>
>
> Em qui., 8 de jun. de 2023 às 17:01, 'Steven Mapes' via Django users <
> django-users@googlegroups.com> escreveu:
>
>> I've used it to go from Django 3 to 4 and to move a project from 1.11 to
>> 2.2.
>>
>> It doesn't do everything for you but it's a great start. I've personally
>> moved from 1.8 through to 4.2.2 but that was during their development
>> lifecycle. Moving up to 1.7 and then 1.7 to 1.8 and 1.8 to 1.11 and 1.11 to
>> 2 will be the hardest parts but it'll get easier once you're on 1.11
>>
>> On Thu, Jun 8, 2023, 19:58 Rogério Carrasqueira <
>> rogerio.carrasque...@gmail.com> wrote:
>>
>>> Hey Steven!
>>>
>>> Thanks for this information, do you have tried it before? I would like
>>> to move from 1.4 to lastest, do you think that is it possible?
>>>
>>> Thanks
>>>
>>> Em quarta-feira, 7 de junho de 2023 às 11:52:35 UTC-3, Steven Mapes
>>> escreveu:
>>>
>>>> I'd suggest looking into using Adam Johnson's Django-Upgrade told -
>>>> https://github.com/adamchainz/django-upgrade it will help you move
>>>> between versions
>>>>
>>>> On Tuesday, 6 June 2023 at 15:24:36 UTC+1 Paul Haguet wrote:
>>>>
>>>>> There is a lot of function who can change.
>>>>>
>>>>> https://docs.djangoproject.com/en/4.2/releases/4.0/
>>>>>
>>>>> All the function declared as deprecated into Django 3 has been removed
>>>>> into Django 4. In the deprecated section of django 3 new functions names
>>>>> are systematically indicated. So just search the function under their old
>>>>> name and replace them with their new name. The 2 links below give the 
>>>>> list.
>>>>>
>>>>>
>>>>> https://docs.djangoproject.com/en/4.2/releases/3.0/#deprecated-features-3-0
>>>>>
>>>>> https://docs.djangoproject.com/en/4.2/releases/3.1/#deprecated-features-3-1
>>>>>
>>>>> Le samedi 3 juin 2023 à 10:10:31 UTC+2, Shams Ulhaq a écrit :
>>>>>
>>>>>> Just need to change url import
>>>>>>
>>>>>> from django.urls import include, re_path as url
>>>>>>
>>>>>>
>>>>>> On Sat, 3 Jun 2023, 12:32 David Nugent,  wrote:
>>>>>>
>>>>>>> nppe url is obsolete and removed in 4.x.
>>>>>>>
>>>>>>> You can use re_path, which is a kind of replacement but even then
>>>>>>> you will need to adjust the regex in many cases.
>>>>>>>
>>>>>>> The best approach is to understand what the url() is doing, and
>>>>>>> replicate the same using path(). Once you do, the conversions should be
>>>>>>> more or less straight-forward. Instead of regex you use labelled 
>>>>>>> patterns
>>>>>>> making for more comprehensible path lines. For complex regex expressions
>>>>>>> you may need to define custom matches - or "converters" - that enforce
>>>>>>> specific patterns allowing you to restrict input and improve matching. 
>>>>>>> This
>>>>>>> is one area that Django has improved really well over time.
>>>>>>>
>>>>>>> But, like I said, don't try to replace this file wholesale. Instead
>>>>>>> of converting it and doing error-fix-error-fix ad infinit

Re: how to convert to Django 3 or 4

2023-06-08 Thread 'Steven Mapes' via Django users
I've used it to go from Django 3 to 4 and to move a project from 1.11 to
2.2.

It doesn't do everything for you but it's a great start. I've personally
moved from 1.8 through to 4.2.2 but that was during their development
lifecycle. Moving up to 1.7 and then 1.7 to 1.8 and 1.8 to 1.11 and 1.11 to
2 will be the hardest parts but it'll get easier once you're on 1.11

On Thu, Jun 8, 2023, 19:58 Rogério Carrasqueira <
rogerio.carrasque...@gmail.com> wrote:

> Hey Steven!
>
> Thanks for this information, do you have tried it before? I would like to
> move from 1.4 to lastest, do you think that is it possible?
>
> Thanks
>
> Em quarta-feira, 7 de junho de 2023 às 11:52:35 UTC-3, Steven Mapes
> escreveu:
>
>> I'd suggest looking into using Adam Johnson's Django-Upgrade told -
>> https://github.com/adamchainz/django-upgrade it will help you move
>> between versions
>>
>> On Tuesday, 6 June 2023 at 15:24:36 UTC+1 Paul Haguet wrote:
>>
>>> There is a lot of function who can change.
>>>
>>> https://docs.djangoproject.com/en/4.2/releases/4.0/
>>>
>>> All the function declared as deprecated into Django 3 has been removed
>>> into Django 4. In the deprecated section of django 3 new functions names
>>> are systematically indicated. So just search the function under their old
>>> name and replace them with their new name. The 2 links below give the list.
>>>
>>>
>>> https://docs.djangoproject.com/en/4.2/releases/3.0/#deprecated-features-3-0
>>>
>>> https://docs.djangoproject.com/en/4.2/releases/3.1/#deprecated-features-3-1
>>>
>>> Le samedi 3 juin 2023 à 10:10:31 UTC+2, Shams Ulhaq a écrit :
>>>
>>>> Just need to change url import
>>>>
>>>> from django.urls import include, re_path as url
>>>>
>>>>
>>>> On Sat, 3 Jun 2023, 12:32 David Nugent,  wrote:
>>>>
>>>>> nppe url is obsolete and removed in 4.x.
>>>>>
>>>>> You can use re_path, which is a kind of replacement but even then you
>>>>> will need to adjust the regex in many cases.
>>>>>
>>>>> The best approach is to understand what the url() is doing, and
>>>>> replicate the same using path(). Once you do, the conversions should be
>>>>> more or less straight-forward. Instead of regex you use labelled patterns
>>>>> making for more comprehensible path lines. For complex regex expressions
>>>>> you may need to define custom matches - or "converters" - that enforce
>>>>> specific patterns allowing you to restrict input and improve matching. 
>>>>> This
>>>>> is one area that Django has improved really well over time.
>>>>>
>>>>> But, like I said, don't try to replace this file wholesale. Instead of
>>>>> converting it and doing error-fix-error-fix ad infinitun, re-implement
>>>>> things as you enable parts of the app you have successfully ported. While
>>>>> re_path may be a fallback, try to re-implement as path() expressions and
>>>>> you'll be better in the long run.
>>>>>
>>>>>
>>>>> On Sat, Jun 3, 2023 at 11:59 AM Muhammad Juwaini Abdul Rahman <
>>>>> juw...@gmail.com> wrote:
>>>>>
>>>>>> I think Django 4 still have backward compatibility with `url`
>>>>>> although `path` is preferable.
>>>>>>
>>>>>> You can try to `runserver` in your local, upgrade your django version
>>>>>> in your virtualenv to version 4 and troubleshoot the error messages (if
>>>>>> any) one by one.
>>>>>>
>>>>>> On Sat, 3 Jun 2023 at 05:20, john fabiani 
>>>>>> wrote:
>>>>>>
>>>>>>> Hi everyone,
>>>>>>>
>>>>>>> I am tasked with updating/upgrading a very old Django web site - I
>>>>>>> believe it is 1.7.  I need convert and need what is required.
>>>>>>> Thanks in advance.
>>>>>>>
>>>>>>>
>>>>>>> I need to convert the following:
>>>>>>>
>>>>>>> from django.conf.urls import patterns, include, url
>>>>>>> from django.contrib import admin
>>>>>>> from django.conf import settings
>>>>>>> from django.conf.urls.static import static
>>>>>>>
>>>>>>> u

Re: how to convert to Django 3 or 4

2023-06-07 Thread 'Steven Mapes' via Django users
I'd suggest looking into using Adam Johnson's Django-Upgrade told 
-https://github.com/adamchainz/django-upgrade it will help you move between 
versions

On Tuesday, 6 June 2023 at 15:24:36 UTC+1 Paul Haguet wrote:

> There is a lot of function who can change. 
>
> https://docs.djangoproject.com/en/4.2/releases/4.0/
>
> All the function declared as deprecated into Django 3 has been removed 
> into Django 4. In the deprecated section of django 3 new functions names 
> are systematically indicated. So just search the function under their old 
> name and replace them with their new name. The 2 links below give the list.
>
> https://docs.djangoproject.com/en/4.2/releases/3.0/#deprecated-features-3-0
> https://docs.djangoproject.com/en/4.2/releases/3.1/#deprecated-features-3-1
>
> Le samedi 3 juin 2023 à 10:10:31 UTC+2, Shams Ulhaq a écrit :
>
>> Just need to change url import 
>>
>> from django.urls import include, re_path as url
>>
>>
>> On Sat, 3 Jun 2023, 12:32 David Nugent,  wrote:
>>
>>> nppe url is obsolete and removed in 4.x.
>>>
>>> You can use re_path, which is a kind of replacement but even then you 
>>> will need to adjust the regex in many cases.
>>>
>>> The best approach is to understand what the url() is doing, and 
>>> replicate the same using path(). Once you do, the conversions should be 
>>> more or less straight-forward. Instead of regex you use labelled patterns 
>>> making for more comprehensible path lines. For complex regex expressions 
>>> you may need to define custom matches - or "converters" - that enforce 
>>> specific patterns allowing you to restrict input and improve matching. This 
>>> is one area that Django has improved really well over time.
>>>
>>> But, like I said, don't try to replace this file wholesale. Instead of 
>>> converting it and doing error-fix-error-fix ad infinitun, re-implement 
>>> things as you enable parts of the app you have successfully ported. While 
>>> re_path may be a fallback, try to re-implement as path() expressions and 
>>> you'll be better in the long run.
>>>
>>>
>>> On Sat, Jun 3, 2023 at 11:59 AM Muhammad Juwaini Abdul Rahman <
>>> juw...@gmail.com> wrote:
>>>
 I think Django 4 still have backward compatibility with `url` 
 although `path` is preferable.

 You can try to `runserver` in your local, upgrade your django version 
 in your virtualenv to version 4 and troubleshoot the error messages (if 
 any) one by one.

 On Sat, 3 Jun 2023 at 05:20, john fabiani  wrote:

> Hi everyone,
>
> I am tasked with updating/upgrading a very old Django web site - I 
> believe it is 1.7.  I need convert and need what is required.
> Thanks in advance.
>
>
> I need to convert the following:
>
> from django.conf.urls import patterns, include, url
> from django.contrib import admin
> from django.conf import settings
> from django.conf.urls.static import static
>
> urlpatterns = patterns('',
> # Examples:
> url(r'reg4/$', 'register.views.reg4', name='reg4'),
> url(r'reg3/$', 'register.views.reg3', name='reg3'),
> url(r'reg2/$', 'register.views.reg2', name='reg2'),
> #url(r'reg1/$', 'register.views.reg1', name='reg1'),
> url(r'reg1/$', 'register.views.reg1', name='reg1'),
> #url(r'^$', 'register.views.home', name='home'),
> url(r'reg/$', 'register.views.home', name='home'),
> url(r'get_courts/(\d+)$', 'register.views.get_courts', 
> name='get_courts'),
> url(r'get_courses/(\d+)$', 'register.views.get_courses', 
> name='get_courses'),
> url(r'autoschedule/', 'register.views.autoschedule', 
> name='autoschedule'),
> url(r'get_cities/(\d+)$', 'register.views.get_cities', 
> name='get_cities'),
> url(r'get_classes/(\d+)$', 'register.views.get_classes', 
> name='get_classes'),
> url(r'get_cities2/(\d+)/(\d+)/$', 'register.views.get_cities2', 
> name='get_cities2'),
> url(r'get_classes2/(\d+)/(\d+)/$', 'register.views.get_classes2', 
> name='get_classes2'),
> url(r'rejected/$', 'register.views.rejected', name='rejected'),
> url(r'finished/$', 'register.views.finished', name='finished'),
> 
> ##url(r'^$', 'profiles.views.home', name='home'),
> #url(r'^contact/$', 'register.views.home', name='contact'),
> #url(r'^about/$', 'register.views.about', name='about'),
> #url(r'^profile/$', 'register.views.user_profile', name='profile'),
> #url(r'^checkout/$', 'checkout.views.checkout', 
> name='checkout'),
> # url(r'^blog/', include('blog.urls')),
>
> url(r'^admin/', include(admin.site.urls)),
> ) + static(settings.STATIC_URL, document_root = settings.STATIC_ROOT)
>
> What is required?
>
> -- 
> You received this message because you are subscribed to the Google 
> Groups "Django users" group.
> To unsubscribe from 

Re: Django Froala Editor

2023-02-03 Thread 'Steven Mapes' via Django users
Sorry hit send too soon. An alternative is to update your settings.py entry 
for FROALA_STORAGE_BACKEND to point to a different backend as per their 
docs https://github.com/froala/django-froala-editor#other-settings

On Friday, 3 February 2023 at 14:30:12 UTC Steven Mapes wrote:

> Easiest way will be to overload their default upload view.
>
> If you look in the urls.py for the package it has two entries
>
>
> *path('image_upload/', views.image_upload, 
> name='froala_editor_image_upload'),path('file_upload/', views.file_upload, 
> name='froala_editor_file_upload'),*
>
> Take a look at those view here 
> https://github.com/froala/django-froala-editor/blob/master/froala_editor/views.py
>
> Then create your own views doing what you want but serve them from the URL 
> path that these would be on by default so that they are called instead.
>
> On Friday, 3 February 2023 at 12:00:32 UTC akino...@gmail.com wrote:
>
>> Please I need help on how to change the upload path of django froala 
>> editor. Possiby to Cloudinary 
>> Please I need 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/39b39288-711b-464a-9f13-e9d3173a62a8n%40googlegroups.com.


Re: Django Froala Editor

2023-02-03 Thread 'Steven Mapes' via Django users
Easiest way will be to overload their default upload view.

If you look in the urls.py for the package it has two entries


*path('image_upload/', views.image_upload, 
name='froala_editor_image_upload'),path('file_upload/', views.file_upload, 
name='froala_editor_file_upload'),*

Take a look at those view 
here 
https://github.com/froala/django-froala-editor/blob/master/froala_editor/views.py

Then create your own views doing what you want but serve them from the URL 
path that these would be on by default so that they are called instead.

On Friday, 3 February 2023 at 12:00:32 UTC akino...@gmail.com wrote:

> Please I need help on how to change the upload path of django froala 
> editor. Possiby to Cloudinary 
> Please I need 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f2a9d21c-1ac6-4bbd-8eb3-c4061ea148f4n%40googlegroups.com.


Re: Django microservice authentication problem.

2023-01-28 Thread 'Steven Mapes' via Django users
Are you trying to authenticate via Django Rest FrameWork API or via the 
standard Django authentication system?  It shouldn't really matter which it 
is as both can be scaled horizontally and you'll have no issue with 
authenticating so in order for us to help we'd need to understand what you 
are doing better.

For example are you trying to share the database across multiple domains? 
Are you simply placing multiple servers behind a load balancer on the same 
domain?

On Saturday, 28 January 2023 at 06:53:12 UTC mdanar...@gmail.com wrote:

> How to communicate and authenticate with multiple Django servers. Is it 
> possible?
>
> If possible you can help me, I am trying more than 15 days in this section 
> but not getting any solution.
>
> Please share with me any requirements like books, videos, blogs, or code 
> examples.
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/16326b9e-0656-45b4-b975-faf9b676a559n%40googlegroups.com.


Re: Card-Payment Integration.

2023-01-04 Thread 'Steven Mapes' via Django users
There's several that you'll find integration projects for on github, 
personally I wrote my own lib to integrate Stripe and Paypal and much 
prefer stripe over paypal. it's a cleaner integration, faster flow for the 
user, lower fees, allows refunds for payments of any age whilst the card is 
valid and, for my clients, the money is paid out. Had lots of bad 
experience with Paypal withholding money for clients for over a year 
because they don't understand their business model and stopping refunds 
after 3 months even if the business allows them for longer

On Tuesday, 3 January 2023 at 13:37:39 UTC satyajit...@gmail.com wrote:

> You can try Paypal or Braintree payment gateway. Both work perfectly.
>
>
> Regards,
> Satyajit
>
> On Tue, Jan 3, 2023 at 9:56 AM Mike Dewhirst  
> wrote:
>
>> On 3/01/2023 3:12 pm, Harshwardhan Waghela wrote:
>>
>> Other Then Stripe ?  
>>
>>
>> Speak to your favourite bank and see what they offer. That's what I did 
>> before going to Stripe. 
>>
>> Otherwise google for local gateway providers.
>>
>>
>> On Monday, 2 January 2023 at 18:05:34 UTC+5:30 Mike Dewhirst wrote:
>>
>>> I use Stripe. It works well.
>>>
>>> Mike
>>>
>>>
>>>
>>> -- 
>>> (Unsigned mail from my phone) 
>>>
>>>
>>>
>>>  Original message 
>>> From: Harshwardhan Waghela  
>>> Date: 2/1/23 22:40 (GMT+10:00) 
>>> To: Django users  
>>> Subject: Card-Payment Integration. 
>>>
>>> Can Anyone Can Suggest me of Card-Payment Integration(means Visa, 
>>> Master-Card...etc)  with Documentation.
>>> -- 
>>> 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 view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/a6d08f33-f1eb-4d1a-8247-c17236859d59n%40googlegroups.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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/a37322f4-2354-46ea-8618-6626f7dcb812n%40googlegroups.com
>>  
>> 
>> .
>>
>>
>>
>> -- 
>> Signed email is an absolute defence against phishing. This email has
>> been signed with my private key. If you import my public key you can
>> automatically decrypt my signature and be sure it came from me. Just
>> ask and I'll send it to you. Your email software can handle signing.
>>
>> -- 
>> 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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/9cb82857-9a09-4da3-1ca6-792a39271d7e%40dewhirst.com.au
>>  
>> 
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9d763ba9-37fc-4839-8ade-01906772b8f4n%40googlegroups.com.


Re: Looking for available support to start a School Management Application

2022-11-07 Thread 'Steven Mapes' via Django users
I'd be very reluctant to use existing OS projects for such a project unless 
they have proven security and a strong policy in place as you're talking 
about handling sensitive data.

You should also double check with the school what license requirements they 
have as many will not allow 3rd party packages to be included for security 
or IP reasons.



On Monday, 7 November 2022 at 14:09:30 UTC julika...@gmail.com wrote:

> You have to do it yourself
> Not cloning an existing project on GitHub
> This will help you deburg the code yourself 
>
> On Mon, Nov 7, 2022, 5:03 PM Milson Munakami  wrote:
>
>> You can give it a try, my open sourced side project: 
>> https://github.com/Milstein/Student_Management_System
>>
>> On Mon, Nov 7, 2022 at 4:48 AM Eric Francis  wrote:
>>
>>> Many thanks for all your feedback.
>>> I will share details on what has been requested and the level of what I 
>>> have done so far.
>>> Thank you
>>>
>>> Eric
>>>
>>> On Mon, 7 Nov 2022, 12:33 kateregga julius,  wrote:
>>>
 Before starting on the system.
 Do information gathering,
 Design your database schema. 
  (Visual paradigm)
 Then set your development environment 

 On Mon, Nov 7, 2022, 11:44 AM Adekola Aderonmu  
 wrote:

> I am also interested  in collaborating with you. 
>
> On Mon, 7 Nov 2022, 06:37 DJANGO DEVELOPER,  
> wrote:
>
>> Are you looking for a paid support?
>>
>> On Mon, 7 Nov 2022, 9:41 am ritik sahoo,  wrote:
>>
>>> I have 
>>>
>>> On Mon, 7 Nov, 2022, 5:34 am Makrand,  wrote:
>>>
 I have developed School management system. I am interested to 
 complete support.

 On Mon, Nov 7, 2022, 4:27 AM Ahmed omar miladi <
 ahmedom...@gmail.com> wrote:

> hello frncseric i'm ahmed omar miladi i'm full stack developer and 
> django specialist i build a platform with name is allcarta check 
> https://www.allcarta.com and i can help you to build a 
> school management system
>
> On Sun, 6 Nov 2022 at 23:05, nef  wrote:
>
>> Hi everyone,
>> I am beginer in Django, not much experience.
>> I have been task to develop an application for school management 
>> (Admission, Registration,  Attendance, Report marks, and more 
>> functions).
>> I am wondering if there is an existing open smilare app or 
>> something which can be use as baseline to start or guide me with 
>> best 
>> practices.
>> Thank you
>> Eric
>>
>> -- 
>> 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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/176ec5a0-2e00-4f53-b5c3-1bfc72f3aa94n%40googlegroups.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...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAE3Dc2PkKJUF19fSykG%2BAmYByW6MY49UW%3DHSiKEL%2BPnZ6CHrvA%40mail.gmail.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...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/django-users/CAA_ekM%2BRQKYixBpZnZzYaN9cE9ete_PpPX%2BVJEj3e%2B%2BK2jktbQ%40mail.gmail.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...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/CAJwehCvV8YkQXf5y5AM_OGTH0vmv_f_kuHyTq7K0p_HyKG3-Sg%40mail.gmail.com
>>>  
>>> 

Re: Using django 4.1 code in django 3.2

2022-11-03 Thread 'Steven Mapes' via Django users
It'll depend on whether your code is 3.2 compatible or not so you'd need to 
test it and check dependencies first

On Thursday, 3 November 2022 at 09:28:40 UTC Kasper Laudrup wrote:

> On 03/11/2022 10.18, Lakshyaraj Dash wrote:
> > Is there any problem if I deploy my django app written with django 4.1 
> > in django 3.2 on render ?
>
> Yes.
>
> Kind regards,
> Kasper Laudrup
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cb156148-ba0d-4460-bb54-cacc4cba9660n%40googlegroups.com.


Re: Looking for a Django firm

2022-09-15 Thread 'Steven Mapes' via Django users
I would be interesting in learning more Mike as would a one of my other 
business partners, both run companies UK based. https://mapestech.co.uk 
and https://www.springbourne-tech.com/

On Tuesday, 13 September 2022 at 01:02:09 UTC+1 Mike Dewhirst wrote:

> Hi all - I'm looking for a Django outfit with an interest in chemistry 
> or customers in the chemical industry in Australia.
>
> Possible opportunity.
>
> Best to respond off list and there will be an NDA.
>
> Cheers
>
> Mike
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/39c21d50-4dd8-4ce0-adfb-6f2b7f816c02n%40googlegroups.com.


Re: What Programming Language should i learn

2022-08-30 Thread 'Steven D. Wolk' via Django users
Very good advice..

On Tue, Aug 30, 2022, 10:59 AM Shailesh Yadav 
wrote:

> LOL, You mean you learned Django without first learning Python?.
>
> It depends but My suggestion would be to learn Python and later learn C++
> (So then you will get much clarity on what is the difference between these
> two languages). Then after that, you can learn Data structure and
> Algorithms.
>
>
> Thanks & Regards
> Shailesh Yadav
> +91-9920886044
>
>   [image: Linkedin] 
>
>
>
> On Tue, Aug 30, 2022 at 8:12 PM Ryan Nowakowski 
> wrote:
>
>> On Tue, Aug 30, 2022 at 03:35:26PM +0100, fawemimo olawale wrote:
>> > Which of these  programming language should i learn
>> >
>> > Please I need counselling on this two language though i have prior
>> > knowledge on Python Web Framework (Django) as a beginner's but i want
>> > Backend Language
>> >
>> > JAVA or ASP.Net
>>
>> Python!  But of course this list is biased :)
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/20220830144155.GD1858%40fattuba.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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMQ-AEUg0gV0CXmeGCogZ2s1hkGsBJoC5t9kwYNvCBqRKmczcg%40mail.gmail.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJ4fu7yRvF42EiQYDc%3DRcmJ6GsKwmo%2BcuPgxfxN1pVc3hKa1ng%40mail.gmail.com.


Re: What Programming Language should i learn

2022-08-30 Thread 'Steven D. Wolk' via Django users
I dislike asp.net but it's popular and in demand. I prefer JSP and Java.

On Tue, Aug 30, 2022, 10:35 AM fawemimo olawale 
wrote:

> Which of these  programming language should i learn
>
> Please I need counselling on this two language though i have prior
> knowledge on Python Web Framework (Django) as a beginner's but i want
> Backend Language
>
> JAVA or ASP.Net
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CALJWbzqwimbawRhv%2BNk%2BDvJhaw6hYx84pMyTELURGZ-WGROOpw%40mail.gmail.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJ4fu7zA7uvRBDenx0wb6x95a4_vkjvjyfh5C23wy7sT7TmzJg%40mail.gmail.com.


Re: Thanks

2022-07-28 Thread 'Steven D. Wolk' via Django users
Thank you for your email.

On Thu, Jul 28, 2022, 8:48 AM Mark Odoyo  wrote:

> Thanks
>
>
> On Fri, Jul 22, 2022, 7:49 PM Gerardo Palazuelos Guerrero <
> gerardo.palazue...@gmail.com> wrote:
>
>> I'm watching this series, it might help you understand.
>>
>> Python & Django 3.2 Tutorial Series
>>
>> https://www.youtube.com/watch?v=SlHBNXW1rTk=PLEsfXFp6DpzRMby_cSoWTFw8zaMdTEXgL
>>
>> --
>> Gerardo Palazuelos Guerrero
>>
>>
>>
>> On Fri, Jul 22, 2022 at 10:35 AM nick washington 
>> wrote:
>>
>>> How do you want my help
>>>
>>> On Fri, Jul 22, 2022, 18:08 Edward Deus Misogoro 
>>> wrote:
>>>
 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 view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/af039f64-f2f6-4994-a33c-f519882dbb13n%40googlegroups.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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAETXisckFSb%3DtS-BvfcFvwmT1%3Dtzz8OPAR22u2WOWrWa-YPuXQ%40mail.gmail.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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAJ8iCyMzLJinS7Udwd-%3D4n5yfejUaJ64exOmzQ1vODpeVWRDhQ%40mail.gmail.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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAFm0m6S9Kq%2B3EYi1CTXTr%3D84se%3Df-JE3w73Kj4R0Ns1Qa3rhNg%40mail.gmail.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJ4fu7xkEABTHaB3ON2ZxNMn6N5mLSgKPXCGx7T%3DydnAzWwi_w%40mail.gmail.com.


Re: upgrading from 1.11 and ran into builtin permission clash

2022-07-04 Thread 'Steven Mapes' via Django users
What I'd advise is to upgrade to point just before it breaks, then update 
the permission to use a different name, then upgraded to 2.2 avoiding the 
name clash. Once upgraded then edit the permission to grant the permission 
to the users who need that permission based on your now renamed custom 
permission. Then remove your custom permission.

I'd do it this way so that you don't loose data on which users had that 
permission in the first place.  Or rename the permission at the start then 
upgrade.

For those saying "why not upgrade to 4" there are many good reasons why you 
may not/ can not, use Django 4 at the moment such as reliance on 
unsupported 3rd party libs or, more commonly, regressions and lack of LTS.  
It's quite common for companies/projects that need stability to only 
upgrade from LTS version to LTS version as they can't risk the regressions 
that often happen in between

On Sunday, 3 July 2022 at 14:16:36 UTC+1 jefrisimo...@gmail.com wrote:

> Deal
>
>
> Pada tanggal Min, 3 Jul 2022 03.48, Sheila Miguez  
> menulis:
>
>> I could try that.
>>
>> So far I've made a toy project to reproduce the problem and made a 
>> migration in 1.11 to remove the permission. When I started it up in 2.2 it 
>> suddenly said I had unapplied migrations in admin and auth.
>>
>> I don't know if renaming would have the same effect. I'll try it.
>>
>> On Friday, July 1, 2022 at 11:35:02 AM UTC-5 Jason wrote:
>>
>>> Joel Goldstick, would definitely not recommend doing an all in one 
>>> update.  That'd be like going from windows XP to 10 in one go.  For 
>>> personal projects, you could do it, but would side-eye any professional who 
>>> suggested doing this with a company or workplace project.
>>>
>>> https://docs.djangoproject.com/en/4.0/releases/2.1/#model-view-permission 
>>> is 
>>> liekly the permission being hit.  OP, would it be possible for you to 
>>> rename the original permission name in a migration in 1.11, and then move 
>>> forward with the migration?
>>>
>>>
>>> On Friday, July 1, 2022 at 9:35:31 AM UTC-4 mma...@gmail.com wrote:
>>>
 > What do I do about this? Clearly I should remove the permission I 
 created. How do I deal with the migration? Should I remove the permission 
 while I run the app as Django 1.11 before moving on to a 2.2 environment? 

 You could rename the current view_inventorychangelog record with a data 
 migration to avoid the constraint, upgrade to 2.2, and then move any 
 references to the old DB record to the new using a data migration.

 > Sorry, I can't answer your question. But, I am wondering why you are 
 > upgrading to a very out of date version of Django that is no longer 
 > supported. I think 3.2 is the oldest supported version. Why not 
 > upgrade to 4? 

 The options for uplifting severely out of date projects are to either 
 step-by-step migrate through older versions, or rewrite in the target 
 version.

 Cheers,
 Michael Manfre

 -- 
>> 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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/cdfce75a-6bb1-4d1b-81a5-a03785cdddb4n%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ef92d745-6cb1-41c2-9285-f4c0722759a3n%40googlegroups.com.


Re: Looking for experienced Django backend engineer

2022-07-04 Thread 'Steven Mapes' via Django users
I'm always looking for new clients, over 2 decades development experience, 
server admin experience, DBA etc See https://www.mapestech.co.uk/ for more

On Monday, 4 July 2022 at 04:11:26 UTC+1 anderso...@gmail.com wrote:

> Just forward to my teammate. 
> Good luck 
>
> On Sun, Jul 3, 2022 at 2:04 PM Mohammad Foysal  wrote:
>
>>
>> I have been working with python for the last two years. so I feel that I 
>> have some transferable skills to the position you are looking for. As a web 
>> application developer I have professional experience in various concepts of 
>> design and development.
>>
>> Please find enclosed my CV if you have any questions about my skills and 
>> experiences.
>>
>> Thank you for your time and consideration and I look forward to hearing 
>> from you soon.
>>
>>
>>
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Django users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/django-users/veFA7lPluGg/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> django-users...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/529F41A5-EF89-437E-9DEF-5A1F6909811C%40gmail.com
>>  
>> 
>> .
>
>
>>
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Django users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/django-users/veFA7lPluGg/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> django-users...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/529F41A5-EF89-437E-9DEF-5A1F6909811C%40gmail.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e9b1b040-0a5e-4167-a947-25169bd26661n%40googlegroups.com.


Re: django html error

2022-04-05 Thread 'Steven Mapes' via Django users
If you check the output of runserver can you see a HTTP200 response? If so 
then the best starting place is to look into your projects base 
.urls.py and match up the URL you are requesting to the view 
being used. Once you have that what is happening next will depend on 
whether you are using functional views of class-based views.  If you are 
using an IDE with debugging such as PyCharm then I'd suggest adding a 
breakpoint walking through the code to make sure it is using  the view you 
expect

On Monday, 4 April 2022 at 01:40:08 UTC+1 rakeshsh...@gmail.com wrote:

> Will you send me some project codes pics so that i can help you.
>
> On Sat, 2 Apr, 2022, 8:34 pm 5021-Chandra Prakash.S,  
> wrote:
>
>> i am new to django, there is no error in my project but my html page is 
>> not loading ,its just appearing white blank screen when i run the server.I 
>> had checked settings.py file and edited the templates setting but then too 
>> my html file isn't loading.
>>
>> -- 
>> 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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/e2efbfba-b612-48d8-9012-e277cb21d7e9n%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/23574240-b320-4e55-a668-a2f2f95ca4abn%40googlegroups.com.


Re: Django 1.5 app had subclasses without tables without proxy and now 1.6 won't sync with proxy

2022-04-05 Thread 'Steven Mapes' via Django users
Migrations came in in 1.7 the docs for 1.8 show the following


*Prior to version 1.7, Django only supported adding new models to the 
database; it was not possible to alter or remove existing models via 
the syncdb command (the predecessor to migrate 
).**Third-party
 
tools, most notably South , provided support 
for these additional types of change, but it was considered important 
enough that support was brought into core Django.*
I'd like to wish you good luck in making the move. I remember going from 
1.8 to 1.11 was often a pain and 1.11 to 2 a little less. Personally 
depending on the size of the project I'd be tempted to dump the data 
against whichever data it is and start a whole new project from scratch 
then import the data in at the end and then use django dumps-data but I 
feel your pain
On Monday, 4 April 2022 at 16:24:10 UTC+1 Antonis Christofides wrote:

> This looks strange, although I'm not familiar with exactly this particular 
> use case. I'm assuming you are referring to multi-table inheritance. Are 
> you certain Django 1.5 wasn't creating these tables? Was it using 
> migrations or South maybe? (Obviously I don't remember when Django started 
> supporting migrations.) When you say it tries to query these tables, when 
> does it attempt to do so? Could you post an example of a subclasss, 
> preferably with its base class?
>
>
> On 04/04/2022 09.09, John Abraham wrote:
>
> Hello. We're migrating someone else's app that was at Django 1.5.12 and 
> we're trying to bring it more up-to-date, step-by-step, starting with 
> Django 1.6.11. 
>
> There's an odd thing. There were a bunch of subclasses of a Model class, 
> that didn't have any database fields. Django wasn't creating nor using 
> tables for them at 1.5.12. But, Django 1.6.11 keeps trying to query these 
> non-existent tables for these subclasses, expecting them to have a single 
> field which would just be the pointer to their superclass.
>
> It seems the proper way to tell Django not to use tables for a class is to 
> set:
>
> class Meta:
> proxy = True
>
> But if we put this in, then when we run syncdb it strangly tries to query 
> the base classes before any tables are created at all in the database.  
>
> Any old-timers run into anything like this? Did Django 1.5 not need the 
> proxy = True in the meta to avoid creating tables for subclasses of Models 
> that didn't add any fields?
>
> They are using InheritanceManager from django_model_utils. 
>
> Thanks for any help! Banging our heads against the wall on this one for 
> quite a while now...
>
> -- 
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/45eec62d-a27c-4b5e-b8ff-6fc2981efa17n%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2fe87247-13ba-41d5-a38e-6915de6822b3n%40googlegroups.com.


New contributor

2022-02-27 Thread steven samy
Hey, I am a beginner on this project, can you suggest to me some beginner 
friendly issues to contribute to  

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/55d38757-748e-4f2b-a493-cd373fbf5149n%40googlegroups.com.


Re: Needs help

2022-02-23 Thread Steven Mapes
If you mean how can you take an image of something and turn it into a 
working design for a LEGO build then you need to look into tools that can 
convert 2D or better, 3D captures into lego designs if such sites/code 
exists. It certainly won't be in Django, but then you can build a Django 
site to use it.

For example https://legoimage.com/ and http://me.brickapic.com/ both take 
2D images and try to convert them into lego representations. You could 
write a script to use these websites via Selenium or possible just the 
request library, then wrap a Django front end to upload the original image 
and then submit that to the site fetching the results but why not just use 
them directly

On Tuesday, 22 February 2022 at 22:21:29 UTC heman...@gmail.com wrote:

> Did you mean to turn(print) images to physical objects especially using 3D 
> printers?
>
> On Tue, Feb 22, 2022, 12:55 Antonis Christofides <
> ant...@antonischristofides.com> wrote:
>
>> Hello Loic,
>>
>> Please how to turn a picture into a LEGO version? 
>> A project that does this will be welcome.
>>
>> Not sure what you mean by that and what it has to do with Django. You 
>> aren't going to get any useful answers in this list unless you change the 
>> way you ask questions.
>>
>> You should really take some time to read 
>> http://www.catb.org/~esr/faqs/smart-questions.html.
>>
>> Regards,
>>
>> Antonis
>>
>> Antonis Christofides+30-6979924665 <+30%20697%20992%204665> (mobile)
>>
>>
>> On 22/02/2022 11.30, loic ngounou wrote:
>>
>> Please how to turn a picture into a LEGO version? 
>> A project that does this will be welcome.
>> -- 
>> 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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/26ef7fae-d58c-45f7-b132-c863aa2ebb03n%40googlegroups.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...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/990f2eab-b8d3-5ecc-1f5f-635d44e06c05%40antonischristofides.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3b846993-955e-4190-a984-d2216c4731fdn%40googlegroups.com.


Re: Slow page load performance with a large number of formsets (over 25)

2022-02-08 Thread Steven Smith

What is hard reload?
On Monday, February 7, 2022 at 12:43:08 PM UTC-6 abdouli...@gmail.com wrote:

> Try hard reload it's little bit faster
>
> On Mon, Feb 7, 2022, 18:12 Steven Smith  wrote:
>
>> Did this issue ever get resolved?  I'm experiencing the same thing.  Once 
>> it hits 100 forms or so it gets pretty slow.
>>
>> On Monday, September 22, 2014 at 10:48:52 AM UTC-5 Collin Anderson wrote:
>>
>>> Yes, if you want speed, using javascript and ajax is probably your best 
>>> bet. It will probably also reduce merge-conflicts.
>>>
>> -- 
>> 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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/48609393-cb83-4eea-845b-d353e41af1e7n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/48609393-cb83-4eea-845b-d353e41af1e7n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/65b3ee86-64bb-4f64-894a-76fd62079097n%40googlegroups.com.


Re: Slow page load performance with a large number of formsets (over 25)

2022-02-07 Thread Steven Smith
Did this issue ever get resolved?  I'm experiencing the same thing.  Once 
it hits 100 forms or so it gets pretty slow.

On Monday, September 22, 2014 at 10:48:52 AM UTC-5 Collin Anderson wrote:

> Yes, if you want speed, using javascript and ajax is probably your best 
> bet. It will probably also reduce merge-conflicts.
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/48609393-cb83-4eea-845b-d353e41af1e7n%40googlegroups.com.


Re: Formsets

2022-02-06 Thread Steven Mapes
For me using select_related, prefetch_related and defer generally soft the 
issues. If that's still too slow then, if possible, you could look at using 
caching the queryset(s) you need the values. Have you run debug toolbar on 
the page to check what queries are running?

On Saturday, 5 February 2022 at 20:27:10 UTC stevesm...@hotmail.com wrote:

> Hello all!   
>
> I find formsets wildly useful...but very difficult to architect.  I have 
> them working...But I am running into a commonly documented problem...They 
> are slow as you build up the number of fields and queries.  Are there any 
> general tips that can be used or share on how to improve this issue?  I 
> have tried all of the commonly prescribed 
> solutions...select_related...prefetch_related...etc...But nothing seems to 
> help.  
>
> I realize that Queries take timebut I'm just trying to see if there is 
> a way to streamline them a bit.  It seems to me that formsets use a lot of 
> queries depending on the amount of data and that's the trade off. 
>
> Again thanks for any thoughts or comments.
>
> Steve
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6513c105-8151-4c7a-8fd2-e692d5c5dcb5n%40googlegroups.com.


Formsets

2022-02-05 Thread Steven Smith
Hello all!   

I find formsets wildly useful...but very difficult to architect.  I have 
them working...But I am running into a commonly documented problem...They 
are slow as you build up the number of fields and queries.  Are there any 
general tips that can be used or share on how to improve this issue?  I 
have tried all of the commonly prescribed 
solutions...select_related...prefetch_related...etc...But nothing seems to 
help.  

I realize that Queries take timebut I'm just trying to see if there is 
a way to streamline them a bit.  It seems to me that formsets use a lot of 
queries depending on the amount of data and that's the trade off. 

Again thanks for any thoughts or comments.

Steve

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/178a8ba4-e00c-44ac-ad29-b1b39bdea54fn%40googlegroups.com.


Re: Sanitize field from xss attacks in django models

2021-11-06 Thread Steven Mapes
Are you using the safe filter in your templates as otherwise that "attack" 
won't do anything but you are right that other XSS attack vectors can be 
used as per the example in the docs 
- 
https://docs.djangoproject.com/en/3.2/topics/security/#cross-site-scripting-xss-protection

If you are using safe then you could put a clean method on the form you are 
using to store the data in the first place to perform the 
validation/cleaning and if you wanted to go a step further and have places 
that update outside of forms then overload the save method of the class, 
put the custom validation in, then call super afterwards.

You could also look at django-bleach - 
https://pypi.org/project/django-bleach/

On Saturday, 6 November 2021 at 12:44:05 UTC omark...@gmail.com wrote:

> hi all
> i want to sanitize 'content' field from XSS attacks in django models
> so i installed 'bleach' and used but script like "an 
> evil() example" store as is (without sanitize script)
> Note: i need bleach via function in models
> Any idea ?
> Thanks
> [image: bleach-Models.png]
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ba551e69-e4be-4f96-9aee-01c58c54c09en%40googlegroups.com.


Re: The Django app does not recognize a file that is in the folder for me

2021-10-22 Thread Steven Mapes
It'll most likely be because you are executing a file with a relative path 
and the Django is probably running in another folder so your best bet is to 
import BASE_DIR from settings.py then append the path to the app from your 
project root so /app.py

On Thursday, 21 October 2021 at 17:26:36 UTC+1 moriy...@gmail.com wrote:

> [image: image.png]
> Hi everyone
> I have an app.py file and the views.py file does not recognize it even 
> though they are in the same folder.
> In which file should I update that django will also recognize the app.py 
> file
> Thank you all
>
>
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ed80fb87-5014-49c5-9c2c-78640665ddeen%40googlegroups.com.


Re: Single page Application

2021-10-07 Thread Steven Mapes
You can use Django as a back-end for an SPA by using something like Django 
Rest Framework  to put APIs in 
front of your models but it's not something that Django itself was planned 
to be. If you search online you'll find various other ways of making Django 
play nice with Angular or React along with various github projects within 
that space as well.

So in short, no it has not been in Django's plan but yes is it very much 
possible

On Thursday, 7 October 2021 at 13:23:18 UTC+1 acc.k...@gmail.com wrote:

> Hi 
>
> Did Django Have plan to issue Django version with Single page application 
> technic ??? 
>
> 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7e0fac40-db13-4cb1-9147-16bbcc8852b2n%40googlegroups.com.


Re: Django Permission

2021-10-06 Thread Steven Mapes
If you have the code in a file as you have then what's happening is that 
you trying to create the same Permission everytime Django runs.  What you 
want to do is to create the permission against the BlogPost model itself 
within the class Meta. Then run a makemigrations and migrate to create the 
permission once. After that you'll be able to use it.

See 
https://docs.djangoproject.com/en/3.2/topics/auth/customizing/#custom-permissions

On Wednesday, 6 October 2021 at 04:38:14 UTC+1 aadil1...@gmail.com wrote:

> I am creating custom permission in my Django myapp's module with the 
> follwing code;
>
> from myapp.models import BlogPost
> from django.contrib.auth.models import Permission from 
> django.contrib.contenttypes.models import ContentType 
>
> content_type = ContentType.objects.get_for_model(BlogPost) 
>
> permission = Permission.objects.create(
> codename='can_publish', 
>   name='Can Publish Posts', 
>   content_type=content_type, )
>
> when i use this permission in my views, i get the following error,
>
> File 
> "/home/aadil/.local/share/virtualenvs/crawling_next-ao7NwWLu/lib/python3.8/site-packages/django/db/backends/sqlite3/base.py",
>  
> line 423, in execute
>
> return Database.Cursor.execute(self, query, params)
>
> django.db.utils.IntegrityError: UNIQUE constraint failed: 
> auth_permission.content_type_id, auth_permission.codename
>
> I am new to djagno 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1e303e72-1d0c-43b3-a23f-60bd0aa797c9n%40googlegroups.com.


Re: Multiple websites but one authentication system

2021-08-26 Thread Steven Mapes
You could use oauth between the projects. Look 
into https://django-oauth-toolkit.readthedocs.io/en/latest/ which would 
enable you to set up domain one as your authentication backend which the 
others could use

On Thursday, 26 August 2021 at 09:46:11 UTC+1 Isaac wrote:

> Am trying to understand what you said sir but am still confuse, how will 
> the domain2.com recognize that this person is a user ? Also how will the 
> database schema  look like ? Will the two database be connected in a way ? 
>
> On Thursday, 26 August 2021 at 09:29:47 UTC+1 eugenet...@gmail.com wrote:
>
>> My suggestion is that you can create a single entry where after login the 
>> system redirects users to the home page containing all these domains as 
>> icons and then the user selects the one he wants.
>>
>> On Thu, 26 Aug 2021 at 10:18, Isaac  wrote:
>>
>>> Am working on a company website and there will be having more websites 
>>> as time goes on, they don't want to be creating authentication system in 
>>> each of their website. To avoid stress in creating multi account on these 
>>> platform, there is a need to have one website that will do everything 
>>> relating to authentication and authorization, just Google is.
>>>  For example we will have domain1.com which will handle everything 
>>> relating to  authentication and authorization(Signup,Signin,Password reset, 
>>> Password change, Logout) while other domains like domain2.com, 
>>> domain3.com, domain5.com etc will be falling back to domain1.com for 
>>> authenticating users. Plz any suggesting on how i can do this will be 
>>> highly appreciated. 
>>>
>>> -- 
>>> 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 view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/efe93e26-23cb-4557-a763-1c2790bf541bn%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>
>>
>> -- 
>> *TUYIZERE Eugene*
>>
>>
>>
>> *Msc Degree in Mathematical Science*
>>
>> *African Institute for Mathematical Sciences (AIMS Cameroon)Crystal 
>> Garden-Lime, Cameroon*
>>
>> Bsc in Computer Science
>>
>> *UR-Nyagatare Campus*
>>
>> Email: eugene@aims-cameroon.org
>>eugenet...@gmail.com
>>
>> Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/29ad46bc-86ce-45bc-a83a-441fe2208e6an%40googlegroups.com.


Async Help Needed

2021-08-12 Thread Steven Mapes
Does anyone have some links to good guides on getting asnyc to work with 
Django? I have a use case where I really need to have a view give an async 
response but I can't get even the most basic of examples working.

I've tried the examples from https://testdriven.io/blog/django-async-views/ 
with a simple view of:

async def test_view(request):
return HttpResponse("Hello, async Django!")

I've installed uvicorn and am running it with  uvicorn 
my_project.asgi:application --reload

My sync views work as expected but the async one just returns an error of "*The 
view sample.views.test_view didn't return an HttpResponse object. It 
returned an unawaited coroutine instead. You may need to add an 'await' 
into your view.*"


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/64f90a01-76fe-4e01-ab3a-a6a0910038c9n%40googlegroups.com.


Re: Django Search Between 2 Dates

2021-02-03 Thread Steven Mapes
Are you looking at client-side filtering within datatables or server side 
filtering? Thiago's suggestion related to using filters when you fetch the 
queryset 
(https://docs.djangoproject.com/en/3.1/topics/db/queries/#retrieving-specific-objects-with-filters)

On Wednesday, 3 February 2021 at 13:24:40 UTC eugenet...@gmail.com wrote:

> Dear Thiago,
>
> Can I have some documentations or sample codes please?
>
> On Wed, 3 Feb 2021 at 15:16, Thiago Luiz Parolin  
> wrote:
>
>> Hi...
>> Normally i use field__lte and field__gte 
>>
>> Em qua, 3 de fev de 2021 08:11, Eugene TUYIZERE  
>> escreveu:
>>
>>> Dear Team,
>>>
>>> I need help. I have a list of Items in a table. And I want to filter 
>>> some data between dates (start and end date). Please help me to do a search 
>>> between the two date. I am using Data table but I can use the other way if 
>>> possible for this purpose.
>>>
>>> Regards, 
>>>
>>> -- 
>>> *TUYIZERE Eugene*
>>>
>>>
>>>
>>> *Msc Degree in Mathematical Science*
>>>
>>> *African Institute for Mathematical Sciences (AIMS Cameroon)Crystal 
>>> Garden-Lime, Cameroon*
>>>
>>> Bsc in Computer Science
>>>
>>> *UR-Nyagatare Campus*
>>>
>>> Email: eugene@aims-cameroon.org
>>>eugenet...@gmail.com
>>>
>>> Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38
>>>
>>> -- 
>>> 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 view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/CABxpZHuPozCVEUFjWFYxipwTyGrY9Syyw-Et%2B_NAqXn6GevNow%40mail.gmail.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...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CANbmKytQ%3D1hiSQyj5%2Bkj-Dvy2Tk%2B0YUukORMui0cP7BPwXNZdg%40mail.gmail.com
>>  
>> 
>> .
>>
>
>
> -- 
> *TUYIZERE Eugene*
>
>
>
> *Msc Degree in Mathematical Science*
>
> *African Institute for Mathematical Sciences (AIMS Cameroon)Crystal 
> Garden-Lime, Cameroon*
>
> Bsc in Computer Science
>
> *UR-Nyagatare Campus*
>
> Email: eugene@aims-cameroon.org
>eugenet...@gmail.com
>
> Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/98702a6a-6341-4495-b879-977e7447c6f8n%40googlegroups.com.


Re: hello guys, how can I upload multiple images using single button? help me please

2021-01-07 Thread Steven Mapes
Within Django Admin or somewhere else?
Are you using FileFields and trying to save to the models or are you just 
trying to POST multiple files?

On Thursday, 7 January 2021 at 12:25:10 UTC allaberdi...@gmail.com wrote:

>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ba3a4c6a-0788-457f-8e7d-576d612a7f61n%40googlegroups.com.


Re: Please help. ImportError with django 3.1

2021-01-05 Thread Steven Mapes
Do you have a function in the hello/views.py? That's the first place to 
start as the error suggests you do not.
 

On Monday, 4 January 2021 at 14:39:32 UTC joshr...@gmail.com wrote:

> hello is ur app name if so
> from hello import views 
> try this 
> if not be clear what is hello,index
>
> On Mon, Jan 4, 2021 at 4:24 PM Gasar Iyali  wrote:
>
>> Hi
>> Please I need your help.
>> I have just installed django and when I try to run django I get this 
>> error message and nothing comes up in my browser.
>> This is the error message that I get in the command prompt
>>
>> !*<<<(env) C:\Users\Documents\Learn 
>> Python\django\my_django_work\my_django_work\urls.py", line 19, in 
>> from hello.views import index
>> ImportError: cannot import name 'index' from 'hello.views'>>>!!
>>
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/cec9f80a-7d69-4702-8b4c-37817fc6caean%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/60b7ffc6-88d0-4057-b61c-6885ebdefb23n%40googlegroups.com.


Re: attempt to write a readonly database

2020-12-30 Thread Steven Mapes
It's a permissions error on the file.  For those running Linux change to 
the directory and type  *ls -l *.sqllite* so we can see who the owner and 
group are on the file. If you are running nginx it should be the same user 
as nginx is configured to run as (www-data) by default.  If the owner (or 
group) are www-data then look at the permissions, does that user/group have 
read and write on the file.

If you are on windows it's the same issue either the owner or the file 
permissions are wrong

On Wednesday, 30 December 2020 at 16:14:10 UTC jayo...@gmail.com wrote:

> I got the same error when I deployed my Django web app over Nginx server 
> and tried to access Django admin. If anyone knows the solution please 
> revert back.
> regards,
> govind
>
>
>
> On Wed, 30 Dec 2020 at 20:45, RANGA BHARATH JINKA  
> wrote:
>
>> hi,
>>
>> Try running as the root user using sudo permissions.
>>
>> All the best
>>
>> On Wed, Dec 30, 2020 at 8:18 PM Steven Mapes  
>> wrote:
>>
>>> This normally means that the user you are running your project as does 
>>> not have access to the SQLLite database file. I can see that you are 
>>> running on windows so fine the database in the file system and check and 
>>> change the owner as well as ensuring that the owner/group has read/write 
>>> access to the file.
>>>
>>> On Thursday, 24 December 2020 at 07:23:24 UTC parul@gmail.com wrote:
>>>
>>>> Can anyone help with this?
>>>>
>>>>
>>>> OperationalError at /users/
>>>> Request Method: POST
>>>> Request URL: http://localhost:8000/users/
>>>> Django Version: 3.0.3
>>>> Exception Type: OperationalError
>>>> Exception Value: 
>>>>
>>>> attempt to write a readonly database
>>>>
>>>> Exception Location: 
>>>> C:\Users\parul\anaconda\envs\MyDjangoEnv\lib\site-packages\django\db\backends\sqlite3\base.py
>>>>  
>>>> in execute, line 396
>>>> Python Executable: C:\Users\parul\anaconda\envs\MyDjangoEnv\python.exe
>>>> Python Version: 3.8.5
>>>> Python Path: 
>>>>
>>>> ['C:\\Users\\parul\\Desktop\\Djangoforms\\ProTwo',
>>>>  'C:\\Users\\parul\\anaconda\\envs\\MyDjangoEnv\\python38.zip',
>>>>  'C:\\Users\\parul\\anaconda\\envs\\MyDjangoEnv\\DLLs',
>>>>  'C:\\Users\\parul\\anaconda\\envs\\MyDjangoEnv\\lib',
>>>>  'C:\\Users\\parul\\anaconda\\envs\\MyDjangoEnv',
>>>>  'C:\\Users\\parul\\anaconda\\envs\\MyDjangoEnv\\lib\\site-packages']
>>>>
>>>> Server time: Wed, 23 Dec 2020 16:14:46 +
>>>>
>>>>
>>>>
>>>> ->>> Also, i checked the properties in db.sqlite3, all the 
>>>> permissions are checked...write permission also
>>>> can anyone 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...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/e5d80366-037b-4ebc-a4ac-9bc1e32bf5ben%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/django-users/e5d80366-037b-4ebc-a4ac-9bc1e32bf5ben%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>>
>>
>> -- 
>> Thanks and Regards
>>
>> J. Ranga Bharath
>> cell: 9110334114
>>
>> -- 
>> 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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAK5m3151VcaY1uoYhapa5e8cRdNwtzm8OND3Gf9k7qxtwOP_6Q%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/django-users/CAK5m3151VcaY1uoYhapa5e8cRdNwtzm8OND3Gf9k7qxtwOP_6Q%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a1467545-f551-4760-ac2c-d28671dc30b9n%40googlegroups.com.


Re: attempt to write a readonly database

2020-12-30 Thread Steven Mapes
This normally means that the user you are running your project as does not 
have access to the SQLLite database file. I can see that you are running on 
windows so fine the database in the file system and check and change the 
owner as well as ensuring that the owner/group has read/write access to the 
file.

On Thursday, 24 December 2020 at 07:23:24 UTC parul@gmail.com wrote:

> Can anyone help with this?
>
>
> OperationalError at /users/
> Request Method: POST
> Request URL: http://localhost:8000/users/
> Django Version: 3.0.3
> Exception Type: OperationalError
> Exception Value: 
>
> attempt to write a readonly database
>
> Exception Location: 
> C:\Users\parul\anaconda\envs\MyDjangoEnv\lib\site-packages\django\db\backends\sqlite3\base.py
>  
> in execute, line 396
> Python Executable: C:\Users\parul\anaconda\envs\MyDjangoEnv\python.exe
> Python Version: 3.8.5
> Python Path: 
>
> ['C:\\Users\\parul\\Desktop\\Djangoforms\\ProTwo',
>  'C:\\Users\\parul\\anaconda\\envs\\MyDjangoEnv\\python38.zip',
>  'C:\\Users\\parul\\anaconda\\envs\\MyDjangoEnv\\DLLs',
>  'C:\\Users\\parul\\anaconda\\envs\\MyDjangoEnv\\lib',
>  'C:\\Users\\parul\\anaconda\\envs\\MyDjangoEnv',
>  'C:\\Users\\parul\\anaconda\\envs\\MyDjangoEnv\\lib\\site-packages']
>
> Server time: Wed, 23 Dec 2020 16:14:46 +
>
>
>
> ->>> Also, i checked the properties in db.sqlite3, all the 
> permissions are checked...write permission also
> can anyone 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e5d80366-037b-4ebc-a4ac-9bc1e32bf5ben%40googlegroups.com.


Re: Multiple registration and login in django

2020-02-03 Thread Steven Mapes
First of all I urge you to ask yourself this question before you begin *"Why 
do I want to write my own authentication system?". *Generally speaking 
there is little reason not to use either the built in django authentication 
system or an existing 3rd party library if you wish to use OAuth for 
example.

That said sometimes you do, and I indeed have had to once myself but I 
still used the django users table I just had to use different way of 
performing authentication and then used the login() function to 
programmatically log the user in afterwards.

Putting that aside from what you have described I do not see why you could 
not and indeed should not use the built in authentication system. You can 
extend the users table by creating a new model with a models.OneToOneField 
and then setup a post_save signal on the User model to automatically an 
instance of that new model (assuming it had no required attributes other 
than the foreign key.  

If you wish to have custom registration forms then just create them as you 
would any other form and use Django's authentication system to authenticate 
them and then log them in - 
https://docs.djangoproject.com/en/3.0/topics/auth/default/#authenticating-users

Here's a very loose example of a user profile model that extends the user 
table to store the date of birth

class UserProfile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE, 
related_name="profile")

dob = models.DateField(blank=True, null=True, verbose_name="Date Of Birth")

 
With this being an example of a signal that is used to ensure that a record 
is created when the user instance is saved

@receiver(post_save, sender=User)
def create_user_profile(sender, instance, created, **kwargs):
if created:
UserProfile.objects.create(user=instance)




On Monday, 3 February 2020 04:44:49 UTC, nrupesh08 wrote:
>
> Hi, 
> How to create multiple registration in django. and login also. without 
> default django registeration and login form.
> my own and saparet registration table and login table . to authencation my 
> own tables (registration and login).
>
> ex: registration table (id, name, email, mobile, date of birth, gender, 
> password, profile pic) and leaterly, upload files an individual persons 
> through registration id.
>
> plese tell me how do it? or reference code or links send me 
>

 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b3a6b1b7-cb75-43eb-9fe7-7734a937a22f%40googlegroups.com.


Re: New to Django

2018-12-16 Thread Steven N
I think you have not installed django,  `pip install django` you can
confirm if django is installed in your current environment by doing `pip
list` if it is, you will see it in the list. This
 might come in handy

On Sun, Dec 16, 2018, 1:47 PM Okware Aldo  I can remotely help, provide access me with remote access or push code
> github
>
> On Sat, 15 Dec 2018, 20:54 
>> Hello - I'm trying to get Django up and running and I'm having some
>> likely trivial trouble. I'm following the "Writing your first Django app"
>> tutorial, but I'm getting stuck trying to create the project using 
>> 'django-admin
>> startproject mysite'. The output says command not found. I've tried
>> troubleshooting but haven't had any luck so far. Any assistance is much
>> appreciated.
>>
>> --
>> 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/b2057d6f-270c-4916-bf6d-da1cbf4e7c87%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/CAMEZma9fAWn%3DzToF-DF%2B4KyRZjEH_KYAc2_rThE8jcVt2gPQNw%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/CACem%2B%2BXdzWOOnJq5QyZjGuFmhNxLPJYPo_K1%2Bod%2BmJ%3DcTUBkig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Hiring | Simons Foundation | Full Stack Software Engineer | Onsite/Full time | New York City, NY

2017-05-09 Thread 'Steven Ford' via Django users
 Simons Foundation is looking for a passionate Full Stack Software 
Engineer! 

Simons Foundation exists to support basic - or discovery-driven - 
scientific research. We do this through direct grants in four areas: 
Mathematics and Physical Sciences, Life Sciences, Autism Research (SFARI), 
and Education & Outreach. This is only a quick blurb of what we do! If you 
want to find out more, please visit www.simonsfoundation.org. I'm certain 
you'll be interested! 

This role specifically is for my team. We're a small (9) team of passionate 
engineers. You'll be joining a yet young project creating Software critical 
to Simons Foundation's mission. 

What we're looking for: Passion (aka desire/enthusiasm, not any sort of JS 
library), Design Patterns, Python, Django, React, Single Page App 
experience, webpack, APIs. 

If you're interested, please either reach out to me @ 
sf...@simonsfoundation.org, or apply directly 
.
 

-- 
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/b6662475-0883-4202-9943-8151745d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: scarico() got an unexpected keyword argument 'string'

2016-04-22 Thread Steven Crockett
Your are capturing a URL parameter and naming it "string".

First, I'm going to recommend you call your parameter something other than 
"string" (although that is a valid name).
I will use "my_string" instead, so your url will look like:

url(r'^scarico/(?P.+)/$', views.scarico, name='scarico')

This will be passed to your view function as a keyword argument named 
"my_string" 
*However*, in the definition of your view function, as is:

def scarico(request, data):
print(data)

You are expecting two positional arguments, and no keyword arguments.
To properly capture your keyword argument named "my_string" your definition 
should be written as: 

def scarico(request, my_string=''):
print(my_string)



On Friday, April 22, 2016 at 8:58:54 AM UTC-4, luca72 wrote:
>
> Hello my view is as follow
> def scarico(request, data):
> print(data)
> .
> the url is :
> url(r'^scarico/(?P.+)/$', views.scarico, name='scarico'),
>
> the form is
>
> 
>   
> Norma
> Azione  
> {% for data in lista_norme %}
>   
> {% data %}
>  Scarica  
> {% endfor %}
>
> 
>
> 
>
> Where is the error?
> Thanks
> Luca
>

-- 
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/ce8a7aa6-ab8c-41b0-88b5-c2dc30f2b5bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Authentication for mobile devices

2016-04-22 Thread Steven Crockett
If you are writing a native app, and using Django as a backend web service, 
there is no built-in library within django, as far as I know.
I have used https://github.com/jpulgarin/django-tokenapi with some success. 
It is rather secure as long as you are using https in production.

On Friday, April 22, 2016 at 9:09:13 AM UTC-4, Deep Shah wrote:
>
> I am new to Django. I want to know how will authentication work on mobile 
> apps. How do I keep the user logged in on my mobile apps and not make them 
> login every time? Is there any in-built method to save a token or something?
>

-- 
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/7a9d990a-77cc-43d1-9de8-4b9ad994470c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: A Problem about UnicodeEncodeError

2016-04-22 Thread Steven Crockett
Hi. Could you post more of the exception traceback?

Here is a workaround others have found for a problem similar to yours:
https://code.djangoproject.com/ticket/23704

It seems to be something to do with your PATH setting within Windows 
possibly containing some non-standard character.


On Friday, April 22, 2016 at 9:09:23 AM UTC-4, nku...@gmail.com wrote:
>
> Hello,
> I'm a beginner of Python.
> Recently,I want to learn something about django.But I meet a problem:
> I created a django project following the tutorial successfully , but 
> when I ran the command "python manage.py runserver",
>
> the cmd show the error information:
> UnicodeEncodeError: 'mbcs' codec can't encode characters in 
> position 0--1: invalid character
>
> I have search for a long time but didn't get the solution.
> Could anyone please tell me how to fix it?
> Thanks.
>
> P.S.The veision of my python is 3.5.1,and the version of django is 
> 1.9.5.My OS is windows8.1
>

-- 
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/fb449a5b-75c5-4d57-b0a8-3d3f6e0a82dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Filter object by calculating duration from start and end time

2016-01-19 Thread Steven Nash
That's fine as am using Postgres on centos 7

Cheers
Steve 

Sent from my iPhone

> On 19 Jan 2016, at 21:19, Simon Charette <charett...@gmail.com> wrote:
> 
> Hi Steve,
> 
> It looks like it might only work on PostgreSQL unti this bug is fixed.
> 
> Simon
> 
> Le mardi 19 janvier 2016 14:59:57 UTC-5, Steven Nash a écrit :
>> 
>> Hi Simon,
>> 
>> Thanks, I'll give that ago.
>> 
>> Cheers,
>> 
>> Steve
>> 
>>> On Tuesday, 19 January 2016 18:52:06 UTC, Simon Charette wrote:
>>> Hi Steve,
>>> 
>>> You can use annotate for this.
>>> 
>>> from datetime import timedelta
>>> 
>>> from django.db.models import DurationField, ExpressionWrapper, F
>>> 
>>> Entry.objects.annotate(
>>> duration=ExpressionWrapper(
>>> F('end') - F('start'), output_field=DurationField()
>>> )
>>> ).filter(duration__gte=timedelta(minutes=time_in_minutes)
>>> 
>>> 
>>> Cheers,
>>> Simon
>>> 
>>> Le mardi 19 janvier 2016 13:01:36 UTC-5, Steven Nash a écrit :
>>>> 
>>>> Hi,
>>>> 
>>>> Given an object such as:
>>>> 
>>>> class Entry(models.Model):
>>>>   start = models.TimeField()
>>>>   end = models.TimeField()
>>>> 
>>>> I'd like to be able to say something like:
>>>> 
>>>> Entry.objects.filter(F('end')-F('start')__gt=time_in_minutes)
>>>> 
>>>> Is there a way of doing this without implementing a separate duration 
>>>> field and having a setter for start and end update it?
>>>> 
>>>> Cheers,
>>>> Steve
> 
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "Django users" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/django-users/xIP7hhp0WqQ/unsubscribe.
> To unsubscribe from this group and all its topics, 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/3bd1db8e-0b53-4b3b-b781-51e4cc8a687c%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/1E3B4129-5341-4968-990C-3C2E8E8225A6%40bitsolver.co.uk.
For more options, visit https://groups.google.com/d/optout.


Re: Filter object by calculating duration from start and end time

2016-01-19 Thread Steven Nash
Hi Simon,

Thanks, I'll give that ago.

Cheers,

Steve

On Tuesday, 19 January 2016 18:52:06 UTC, Simon Charette wrote:
>
> Hi Steve,
>
> You can use annotate for this 
> <https://docs.djangoproject.com/en/1.9/ref/models/expressions/#using-f-with-annotations>
> .
>
> from datetime import timedelta
>
> from django.db.models import DurationField, ExpressionWrapper, F
>
> Entry.objects.annotate(
> duration=ExpressionWrapper(
> F('end') - F('start'), output_field=DurationField()
> )
> ).filter(duration__gte=timedelta(minutes=time_in_minutes)
>
>
> Cheers,
> Simon
>
> Le mardi 19 janvier 2016 13:01:36 UTC-5, Steven Nash a écrit :
>>
>> Hi,
>>
>> Given an object such as:
>>
>> class Entry(models.Model):
>>   start = models.TimeField()
>>   end = models.TimeField()
>>
>> I'd like to be able to say something like:
>>
>> Entry.objects.filter(F('end')-F('start')__gt=time_in_minutes)
>>
>> Is there a way of doing this without implementing a separate duration 
>> field and having a setter for start and end update it?
>>
>> Cheers,
>> Steve
>>
>

-- 
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/6cb56c2b-8a18-4e92-9092-5980b8b7a6b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Filter object by calculating duration from start and end time

2016-01-19 Thread Steven Nash
Hi,

Given an object such as:

class Entry(models.Model):
  start = models.TimeField()
  end = models.TimeField()

I'd like to be able to say something like:

Entry.objects.filter(F('end')-F('start')__gt=time_in_minutes)

Is there a way of doing this without implementing a separate duration field 
and having a setter for start and end update it?

Cheers,
Steve

-- 
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/1e6462bf-fb70-4fb8-8642-492c546fd1b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Kivy and Djangp

2015-05-13 Thread steven kyalo
Hello everyone,

Am doing a mobile app using Kivy. The app should be getting some data from 
a server, for which i have used Django to develop the server side 
requirements. 

My problem is where do i put my Kivy scripts so that i can access the 
Django application web services. Which scripts of Django do i have to 
access? - the urls or the views? Kindly help me understand 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9d3c53ed-3dad-4a57-9e7d-8fe7a6673205%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django project for multiple clients

2015-03-26 Thread Steven Nash
This looks like it could be a good solution.

Steve

On Thursday, 26 March 2015 17:02:32 UTC, Simon Charette wrote:
>
> This concept is called multi-tenancy.
>
> I suggest you have a look at the django-tenant-schema 
> <https://github.com/bernardopires/django-tenant-schemas> application 
> which isolate each tenant in it's own PostgreSQL schema.
>
> You could also build you own solution using a middleware and a database 
> router.
>
> Simon
>
> Le jeudi 26 mars 2015 12:23:38 UTC-4, Steven Nash a écrit :
>>
>> We are design a DJango based application to be used my multiple clients.  
>> Each client will have there own database but share the same code base.
>>
>> In the past, when I've done something like this, I have configure a 
>> separate virtual host for each client.
>>
>> This time we are thinking about using URL routing to select the clients 
>> database, and creating a small Django Webapp to allow an admin team to 
>> setup new clients etc.
>>
>> I'd be interested to hear how others have tackled this, I have Googled 
>> quite a bit on this topic.
>>
>> Steve
>>
>

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e5a35695-999c-4515-acda-82106b51709e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django project for multiple clients

2015-03-26 Thread Steven Nash
We are design a DJango based application to be used my multiple clients.  
Each client will have there own database but share the same code base.

In the past, when I've done something like this, I have configure a 
separate virtual host for each client.

This time we are thinking about using URL routing to select the clients 
database, and creating a small Django Webapp to allow an admin team to 
setup new clients etc.

I'd be interested to hear how others have tackled this, I have Googled 
quite a bit on this topic.

Steve

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e40f6383-fef5-424c-aec1-1ffbe57556f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Job] CTO and Django developer required

2014-11-03 Thread Steven Davidson
Hello all, 

We are looking for two experienced Django developers, one of whom will also 
be the company CTO. The jobs (in London, UK) offer many interesting 
opportunities including the analysis of large datasets, natural language 
processing and developing scalable web solutions. 

More details at: 
https://yourinterest.com/jobs/

and you can contact us at conn...@yourinterest.com

Thanks for reading and best wishes,
Steven. 

Steven Davidson
CTO (interim)
YourInterest 

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0f34c873-cde4-456c-883d-d4965b18717a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to generally handle exceptions in function based and class based views?

2014-11-03 Thread Steven Cummings
It sounded like you wanted to show something to the user, but don't keep
the info from yourself as well (with respect to monitoring the site). So
use the django messages framework to tell them something when wrong (not
the exception details), or if you can't even render the attempted workflow
then render a custom error page with the same message. Meanwhile, make sure
to log the event with python logging so you can see what *really* went
wrong.

On Mon Nov 03 2014 at 8:04:02 AM Daniel Grace  wrote:

> OK, say if I have a function based view then how do I handle the exception?
>
> try:
> context = RequestContext(request)
> context_dict = {}
> ...
> return render_to_response('my_file.html', context_dict, context)
> except Exception as e:
> # what to do here?
>
> What about class based views (in form_valid etc)?
>
>  --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/a061d856-a2dd-4292-9080-693e59737e61%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAODHHFAVu-eJdCdzb9d9scK0RDfbAA7_j0jeV%2B8zR-pQ4AeP_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Static Files not Loading

2014-07-30 Thread Steven Williams
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

I just asked around on IRC and no one was able to help me. Also the
entries on StackOverflow are not that helpful in my situation either.

Right now I am unable to access my static content in my project. Going
to 127.0.0.1:8000/static/rango.jpg yields a 404 error message. This is
a development environment where I am just learning the framework using
Tango with Django. My system is running Fedora 20 with Django 1.6
installed.

This is my settings.py paste https://dpaste.de/pU40

Any help would be greatly appreciated.

- -- 
Steven Williams
My PGP Key
http://pgp.mit.edu/pks/lookup?op=get=0xCACA6C74669A54FA
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJT2QqDAAoJEMrKbHRmmlT63vUP/RQ7jyVgXLc0EYoJKE84Tfg4
84IqEaXHgT709J2ChZYpQjRLpsm/7IYbJt/JDXQzW4+E67AMOwqjHyPzlLWUaaD2
auqbCLmebeUXB8Et8r0k8eATU9cW+edmRrcoVi2ZmO/dXR+NqEZigGq4nPfFjUac
lFYpfYlxKmFT8vht/er3ftR5ADC4MLohG42W48NIyHe//tTijDFj5ZBV6Zb94Y3p
46me03yXimSQVpdq7ZPMGe5zVo+TL/QoEpZlipGglo1+3WPzK37ZkW7YRv1l6tb/
thBx2lRAWHoOpQdtOjklYZaXJtf/yKVF+E831N8BTuPKbQu3gHVms7nxB3fKu/hs
VJ1CH3aSslw1ndZLX2Ll4CVCjnk33QrAu+ruu+lexOsLDG/SLupLpakcAMhqW3BZ
yxWSl+s/RypL21VsNv6wQC2JT/DKZrCWxtL6/yOE6/OnvOtzh3f8YwtwiQGmAsT7
tjd5pU/Qh4mgv4P6aL5STpVws5RMgVVSV/p25RYYtDnLf47MrNZNv+0c4DUrrKSj
xlYeIwm0M8mGQR8nBg8NPCOhcRrrh79zjKMrB7cm6r9M+UBxZINyeG9NelsD7Zb/
jaXtvbOqoHYVzbci81skpQPxtgf6c6wjrgwckVcWaXRFnXZWisFJH6sjjDAS5jW2
GW8Y3CmUlEiJR5RUG7gp
=fRvw
-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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/53D90A83.7040801%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Best-practice for "join mailing list" form on every page

2013-08-20 Thread Steven Smith
I've got a simple form with one field that appears in the footer of my 
site, asking users to enter their email address to subscribe to our mailing 
list.

Rather than duplicate the form-processing logic in every single view, what 
should I do?
- POST to one location, but use a context processor to add the form in GET 
contexts?
- Add a decorator to every view that does the form logic
- Some other third option?

What do people typically do in this type of situation?


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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Design for storing likes/dislikes?

2013-07-19 Thread Steven Smith
I've used NullBooleanField for this before, as well.  A lot quicker to 
query on than a ManyToMany, also.



On Tuesday, July 16, 2013 9:24:54 PM UTC-4, donarb wrote:
>
> On Tuesday, July 16, 2013 5:29:47 PM UTC-7, Victor Hooi wrote:
>>
>> Hi,
>>
>> We have a list of users, who are going to like/dislike various widgets.
>>
>> My question is regarding how to store the like/dislikes.
>>
>> Essentially, there can be three states between a user and a widget - 
>> like, dislike, and unrated, so it's not just a straight Boolean.
>>
>> I'm thinking of just doing a M2M between user and widgets models, and 
>> then storing an extra field on that M2M.
>>
>> I can either store a Boolean, for whether the item is liked/unliked - and 
>> then an unrated item simply won't be exist in the table.
>>
>> Or I can store a integer (with a choice tupled defined), with say 
>> 0=unrated, 1=like, 2 = unlike, and all possible combinations are listed.
>>
>> We'll be doing queries to compare users, and see if their likes/dislikes 
>> intersect.
>>
>> Are there any pros/cons of the two approaches for this given query, or is 
>> there perhaps a more efficient way of storing this data?
>>
>> Cheers,
>> Victor
>>
>
>
>
> Django has a NullBooleanField that allows 3 states, Unknown (null), True, 
> False.
>
>  
>

-- 
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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Form Wizard: Redirecting back to a step from inside the done() method

2013-07-18 Thread Steven Smith
I have a form wizard that walks a user through some system configuration 
steps. In the done() method, the cleaned_data is used to call out to a 
configuration system to do various set/unset operations.

Most of the time, the validation that I have built into my form classes is 
sufficient. However, occasionally, the configuration system I am 
interfacing with will return validation errors of its own, and when this 
happens, I need to be able to return the user to a previous step in the 
form. Right now, all I've figured out how to do is redirect them back to 
the start of the form (using HttpResponseRedirect) but this of course loses 
their data.

Is there a way to redirect, from the done() method, back to an existing 
step of the form, in such a way that the data is not removed?

-- 
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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Setting Django to not quote table names

2013-03-05 Thread Steven Githens
Hi Shawn!

Thanks for the clue.  I commented out the following in oracle/base.py 
DatabaseOperations.quote_name and can get some tables showing up in the 
admin view now. ( More issues of course, but I believe them to be separate. 
)

# if not name.startswith('"') and not name.endswith('"'):
# name = '"%s"' % util.truncate_name(name.upper(),
#self.max_name_length())

I'm guessing this may not be the final best way to work around it, but I 
can keep prototyping and hacking my app now.  Hopefully someone ORM 
experienced will chip in.

Until then, thanks much!  :)

Steve

On Tuesday, March 5, 2013 4:32:44 PM UTC-5, Shawn Milochik wrote:
>
> I'm taking a look at this as someone pretty unfamiliar with the ORM. 
> Hopefully someone more knowledgeable will jump in. 
>
> However, in the meantime (if you're feeling adventurous), you could 
> look in django/db/backends/oracle/base.py and have a look at function 
> quote_name. A naive look at it makes me think you could just put 
> "return name" at the top and short-circuit it. Ideally we could find 
> an easy way to override it in a custom manager that you can use in 
> your models, but first let me know if a manual change to that file 
> causes the behavior you want. 
>
> No warranty! ^_^ 
>

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Setting Django to not quote table names

2013-03-05 Thread Steven Githens
Hello Django Users,

I have an app that uses Oracle and cx_Oracle for the db, and I've made the 
models from an existing schema with inspectdb.

The database schema also contains a number of sub-schemas, so they must be 
accessed with schema dot table name.  Looking at the SQL used for model 
access, I believe Django's automatic quoting of table names in the SQL is 
causing issues with table name lookup.

I can verify using cursor.execute in the shell, that if I leave off the 
quotes, the queries work fine.  Is there an easy way to disable table name 
quoting? (or other facility that gets around this? )

Cheers,
Steve

[snip]
  File 
"/home/sgithens/Envs/komen-django2/local/lib/python2.7/site-packages/django/db/backends/oracle/base.py",
 
line 717, in execute
six.reraise(utils.DatabaseError, utils.DatabaseError(*tuple(e.args)), 
sys.exc_info()[2])
  File 
"/home/sgithens/Envs/komen-django2/local/lib/python2.7/site-packages/django/db/backends/oracle/base.py",
 
line 710, in execute
return self.cursor.execute(query, self._param_generator(params))
DatabaseError: ORA-00942: table or view does not exist

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Using X-editable with Django?

2012-12-08 Thread Steven L
 I am trying to get 
X-Editable inline 
editing of a model in Django. I am simply trying to change attributes of a 
model instance (in this case, the name of a Dataset object). Whenever I try 
to make the inline edit, I get an error that says that there is no CSRF 
protection. How can I add this this?

Also, I am not sure how to write the view so that it correctly captures the 
information from the ajax request:

POST /datasets/9/update_name/{
pk:3//primary key (record id)
value: 'The Updated Name' //new value}

Then save the new name to the Dataset object.

urls.py

# ex: /datasets/3/update_name
url(r'^(?P\d+)/update_name/$', update_name ,
name='update_name'),

detail.html


  {{ dataset.name }}
// using jQueryfunction getCookie(name) {
  var cookieValue = null;
  if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
  var cookie = jQuery.trim(cookies[i]);
  // Does this cookie string begin with the name we want?
  if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
break;
  }
}
  }
  return cookieValue;
}
var csrftoken = getCookie('csrftoken');

function csrfSafeMethod(method) {
  // these HTTP methods do not require CSRF protection
  return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));}
$.ajaxSetup({ 
 beforeSend: function(xhr, settings) {
   function getCookie(name) {
 var cookieValue = null;
 if (document.cookie && document.cookie != '') {
   var cookies = document.cookie.split(';');
   for (var i = 0; i < cookies.length; i++) {
 var cookie = jQuery.trim(cookies[i]);
   // Does this cookie string begin with the name we want?
   if (cookie.substring(0, name.length + 1) == (name + '=')) {
 cookieValue = 
decodeURIComponent(cookie.substring(name.length + 1));
 break;
   }
 }
   }
   return cookieValue;
 }
 if (!(/^http:.*/.test(settings.url) || 
/^https:.*/.test(settings.url))) {
   // Only send the token to relative URLs i.e. locally.
   xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
 }
   } 
 });
$('#datasetName').editable({
  type: 'text',
  pk: {{ dataset.pk }},
  url: '{% url 'datasets:update_name' dataset.pk %}',
  title: 'Edit dataset name',});

views.py

def update_name(request, dataset_id):   
# ... Update Dataset object ...
json = simplejson.dumps(request.POST)
return HttpResponse(json, mimetype='application/json') 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/S0b-lgcqgxwJ.
To post to this group, send email to django-users@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: Test driven development in Django framework

2012-09-08 Thread Steven Cummings
I think when people say "unit" tests to mean fully isolated tests, what
they really mean is *whitebox* tests. You define the size of the unit under
test and context runs from full isolation (whitebox test) to full
integration/user-experience (blackbox test)
--
Steven


On Fri, Sep 7, 2012 at 7:39 AM, Harry P <harry.perci...@gmail.com> wrote:

> Hey, glad to hear someone's been found it useful!
>
> re: whether my unit tests are unit tests or not... some people have a very
> restrictive definition of what a unit test is - they want it to be 100%
> isolated from other tests, always mock out the filesystem and the database,
> etc.  That's fine, but we tend to find it's a bit OTT, and a slightly more
> relaxed approach is more productive.   Ultimately, I'm writing two types of
> test - some high-level tests that test the behaviour of the app from the
> user's point of view - so call them system tests, or functional tests, or
> acceptance tests, or whatever you will, but their purpose is to check the
> system actually works.  The other type of test is low-level, they test the
> behaviour of individual functions, classes etc, and their purpose is to
> help you think about your code before you write it, to think through edge
> cases and to help write correct code.
>
> So, to me, the important thing is that you have those two types of test,
> and that they help you achieve those two different objectives.  Finer
> details of terminology or practices to do with mocking, stubbing etc are up
> to personal preferences really.
>
> cheers,
> hp
>
>
>
>
> On Friday, September 7, 2012 10:25:32 AM UTC+1, jyria wrote:
>>
>> Thank you for reply,
>>
>> I have been using your tutorial to learn TDD in django. One of the best I
>> have found so far. You also talk about "unit tests" and thats what is
>> confusing. As I understand, your tutorial examples are not unit tests in
>> the strict meaning of the term.
>>
>> You have a great tutorial and I have learned a lot of them. Maybe too
>> much focus on admin and polls app for me. I would have liked to see
>> something different and new. What about running you selenium functional
>> tests in a acceptance testing framework?
>>
>> I would love to see your tutorials for intermediate/advanced level.
>>
>> On Thursday, September 6, 2012 1:57:08 PM UTC+3, Harry P wrote:
>>>
>>> Hi there,
>>>
>>> I work for a bunch of XP fanatics, so we do quite religious TDD in our
>>> Python/Django development.   We start with functional/acceptance tests,
>>> which we write using Selenium, driving a real web browser, and following a
>>> test script that is essential a user story.  We then write unit tests that
>>> we can run using a python manage.py test.
>>>
>>> I've written a "TDD for beginners" tutorial, that covers both of these
>>> types of test:
>>>
>>> http://www.tdd-django-**tutorial.com/<http://www.tdd-django-tutorial.com/>
>>>
>>> I'd love any comments, feedback, suggestions?
>>>
>>> rgds,
>>> Harry
>>>
>>> On Thursday, September 6, 2012 1:47:08 AM UTC+1, Mike Dewhirst wrote:
>>>>
>>>> On 6/09/2012 3:04am, Javier Guerra Giraldez wrote:
>>>> > On Wed, Sep 5, 2012 at 7:46 AM, jyria <jyr...@gmail.com> wrote:
>>>> >> What is your experience? Is it worth it, and is it possible?
>>>> >>
>>>> >> I tried it and found it quite difficult to follow guideline of unit
>>>> testing
>>>> >> -- testing a unit of code, a class for example. Maybe Im just
>>>> ignorant, but
>>>> >> I didnt see, how can I create registration app only with unit tests.
>>>> The
>>>> >> only way I could drive implementation with tests was using more like
>>>> an
>>>> >> integration testing approach: calling requests with data and
>>>> asserting that
>>>> >> new user was registered and that form was valid/invalid etc, but
>>>> this goes
>>>> >> against TDD as I understand it. So should I not worry about pure
>>>> "unit
>>>> >> testing" approach and use django client http request to validate
>>>> >> RegistrationForm. Or I should write unit tests for RegistrationForm
>>>> class?
>>>> >
>>>> > TDD is not unit-testing
>>>>
>>>> Here is a lovely diagram I found recently - probably by following a
>>>> link
>>>> someone posted h

Re: is django too big for my use case?

2012-09-08 Thread Steven Elliott
I do not think your use case is too big for Django; you are only limited to
your imagination and your knowledge of Python really. Check out Django
Piston  for RESTful
APIs

On Sat, Sep 8, 2012 at 4:05 PM, LuckySMack  wrote:

> I am currently starting work on a a project that is rest based. In order
> to use django as a rest based system I have to use another library on top
> of it. I've seen that there are a couple out there. But this system will be
> an advanced rest a pi that will allow me to talk to my database, and allow
> other instances of the app to talk to each other. And as cool as django
> seems to get up and running quickly, I'm not sure if its a right fit. It
> seems a bit complex. My app will likely only have one or 2 models as the
> core. And I won't be using djangos orm as I will be needing a db like
> neo4j, titan, or orientdb.
>
> Now that is the core, that will be shared by about a half dozen apps. They
> will all build on top of that. And I feel like django might be too bloated
> or big or complex. The base a pi could probably done by an experienced
> python dev in flask or bottle in a few days time. It doesn't have any ui.
> In comparison I'm also thinking about implementing it in pyramid too. But
> I'm curious as if you guys think it will work in django.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/Iiuk6V4TSHQJ.
> To post to this group, send email to django-users@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-users@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: Can't Syncdb

2012-09-08 Thread Steven Elliott
What's the error message you get specifically
On Sep 8, 2012 7:31 AM, "Kollin"  wrote:

> I create a project. I create app by name "app" in the project. The app
> that :
> app
> __init__.py
> models
> __init__.py
> a.py
> b.py
> but I can't syncdb the app. I use django 1.4.
> What error?
> THX
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/o6fxby4Smw8J.
> To post to this group, send email to django-users@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-users@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: Step up to the plate

2012-09-06 Thread Steven Elliott
Hi alex

I'm down as well email me at srichardelliot...@gmail.com
On Sep 6, 2012 6:28 PM, "andrea mucci"  wrote:

> Hi Alex
>
> if you need some help contact me to and.mu...@gmail.com
>
> have a nice day
> El 07/09/2012, a las 00:18, Alex Glaros  escribió:
>
> *Dear Django Group,
>
> Can you spare a few lines of code?
>
> Our nonprofit has a great idea to help the unemployed and spur innovation
> at the same time.
>
> All we need is a simple app to let users register.
>
> Can I get a community effort from this great Django community to write the
> registration app?
>
> I’ll can do the data modeling, just a few tables, you only need to write
> the CRUD for it.  Easy Peasy
>
> It would be great to get a few volunteers to help innovation and the
> unemployed.
>
> App will be open source.  Detailed info below.
>
> Thanks!
>
> Alex
>
>
> --
>
> EMPLOYMENT AND INNOVATION PROGRAM
>
> The nonprofit Center for Government Interoperability (CFGIO) is seeking
> programming assistance for an employment and innovation program.*
>
> *BACKGROUND
>
> 1. There are thousands of startup ideas that cannot be implemented due to
> software developer costs
> 2. There are millions of unemployed, many of whom could learn programming
> from free sources
>
> BASIC CONCEPT - Employment Program managed by CFGIO
>
> 1. Unemployed novice programmers learn from free sources and start writing
> beginner apps in one year, and write moderately well after 2 years. College
> students majoring in computer science/MIS would be ready immediately.
> 2. Unemployed novice programmers offer services to startups with simple
> app or web-design requirements.
> 3. CFGIO sets up centralized database to match learning programmers with
> startups, and creates processes to help them work effectively together.
> 4. Startups offer equity or delayed transaction-based payments to learning
> programmers.
> 5. For startups, the purpose is to give them an affordable prototype that
> allows investors to evaluate and fund production version of their idea. For
> students, it gives them real-world learning experience and qualifies them
> to apply for entry-level programming positions, or to start their own
> startup.
>
> BENEFITS
>
> 1. Backlog of programmer positions that need filling is addressed
> 2. Unemployed become employable with high-paying future-proof skills. They
> also learn project management and SDLC.
> 3. Startup ideas are enabled
> 4. Nationwide innovation is expanded
>
> IMPLEMENTATION – Request assistance from crowdsourced volunteers to:
>
> 1. Design curriculum – basically identify Youtube and other free training
> materials (which now days are great) for each programming language
> 2. Mentor students
> 3. Create environment where students learn from each other
> 4. Design certification process
> 5. Design processes to enhance programmer/startup collaboration
>
> RESOURCES
>
> 1. Programming environments are cheap or free:
> https://developers.google.com/appengine/docs/billing and
> https://openshift.redhat.com/app/
> 2. Programming forums already provide assistance to newbies
>
> Any ideas or comments would be greatly appreciated,
>
> Alex Glaros
> Center for Government Interoperability
> www.gov-ideas.com
> Contact: http://gov-ideas.com/contact.htm*
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/TSMxZ0ZKlnoJ.
> To post to this group, send email to django-users@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-users@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-users@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.



messages.sucess question

2012-09-04 Thread Steven Elliott
Hello,

Is there an easy way to not display a success message as an unordered list? 
I have been looking high and low and for some reason cannot find an answer 
to this. Thank you!

Best,
Steven Elliott

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/mu57q5xsCSAJ.
To post to this group, send email to django-users@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: Optimistic Locking in Django?

2012-06-30 Thread Steven Cummings
If you read over the linked discussion it's quite possible, just an issue
of how disruptive it would be to the ORM APIs.

On Saturday, June 30, 2012, Dennis Lee Bieber wrote:

> On Sat, 30 Jun 2012 15:24:59 -0700 (PDT), ydjango 
> <neerash...@gmail.com<javascript:;>
> >
> declaimed the following in gmane.comp.python.django.user:
>
> >
> > I did google search on "optimistic locking". Most discussion are very
> old.
> >
> > Has Django added any features to support it or what are folks generally
> > doing?
>
>Since the locking relies upon the database engine itself, Django
> probably can't do anything for it -- it would require the front-end to
> know about features of the engine, and that could be a significant
> impact if one changes the engine later (not to mention the overhead of
> looking up some feature list for each engine so it can execute different
> code based on what type of locking is available).
> --
>Wulfraed Dennis Lee Bieber AF6VN
>wlfr...@ix.netcom.com <javascript:;>
> HTTP://wlfraed.home.netcom.com/
>
> --
> 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<javascript:;>
> .
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com <javascript:;>.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
--
Steven

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



Re: Optimistic Locking in Django?

2012-06-30 Thread Steven Cummings
I started looking into it a while back:
https://code.djangoproject.com/ticket/16549

The work broke down into ensuring that the updated/deleted/matched counts
were returned from the internal ORM objects. Then there was a fair amount
of discussion of what the public API of the ORM could provide on top of
that. It's kind of died out a bit, I'd like to get back to it and rekindle
the discussion when I can find some time.
--
Steven


On Sat, Jun 30, 2012 at 5:24 PM, ydjango <neerash...@gmail.com> wrote:

>
> I did google search on "optimistic locking". Most discussion are very old.
>
> Has Django added any features to support it or what are folks generally
> doing?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/oaykVwXK58wJ.
> To post to this group, send email to django-users@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-users@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: How to adjust grid in Django Admin Forms

2012-03-26 Thread Steven
I tried changing width from 8em to 16em in /usr/local/lib/python2.7/
dist-packages/django/contrib/admin/static/admin/css/forms.css in the
two places where it appeared:

.aligned label{
  display: bloack;
  padding: 3px 10px 0 0;
  float: left;
  width: 8em;
}

and

.inline-group .aligned-label{
  width: 8em;
}

but to no avail. Is there someplace else I should be looking??
On Mar 26, 10:21 am, akaariai <akaar...@gmail.com> wrote:
> On Mar 26, 4:53 pm, Steven <traveller3...@gmail.com> wrote:
>
>
>
>
>
>
>
>
>
> > I've just created a model in Django and want to use the admin form to
> > enter information for it. The problem I'm having is that my field
> > names are so long that they overlap the edit boxes where their values
> > are to be entered.
>
> > If one follows the tutorial in the Django website, it's as if the
> > label "Question:" overlapped the edit box where one was supposed to
> > enter a question.
>
> > The file "fieldset.html" in the /admin/includes sub-directory seems to
> > have the relevant code:
>
> > 
> >     {% if fieldset.name %}{{ fieldset.name }} - Foo Test{%
> > endif %}
> >     {% for line in fieldset %}
> >         
> >               {% for field in line %}
> >                 
> >                    {{ field.label_tag }}{{ field.field }}
> >                 
> >             {% endfor %}
> >         
> >     {% endfor %}
> > 
>
> > What I can't figure out is how to allocate more space to
> > {{ field.label_tag }}, so that it is not covered up by
> > {{ field.label_tag }}.
>
> > Any help would be appreciated.
>
> Using firebug I spotted this css for the label tag (Django 1.2
> installation, might be different in more recent versions):
> .aligned label {
>     display: block;
>     float: left;
>     padding: 3px 10px 0 0;
>     width: 8em;
>
> }
>
> So, you would probably want to override that (the width, especially)
> in a custom css file. The documentation should contain the details of
> how to do that.https://docs.djangoproject.com/en/dev/ref/contrib/admin/
>
>  - Anssi

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



How to adjust grid in Django Admin Forms

2012-03-26 Thread Steven
I've just created a model in Django and want to use the admin form to
enter information for it. The problem I'm having is that my field
names are so long that they overlap the edit boxes where their values
are to be entered.

If one follows the tutorial in the Django website, it's as if the
label "Question:" overlapped the edit box where one was supposed to
enter a question.

The file "fieldset.html" in the /admin/includes sub-directory seems to
have the relevant code:


{% if fieldset.name %}{{ fieldset.name }} - Foo Test{%
endif %}
{% for line in fieldset %}

  {% for field in line %}

   {{ field.label_tag }}{{ field.field }}

{% endfor %}

{% endfor %}


What I can't figure out is how to allocate more space to
{{ field.label_tag }}, so that it is not covered up by
{{ field.label_tag }}.

Any help would be appreciated.

Thanks

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



Re: Weird problem generating forms on the fly

2012-03-09 Thread Steven Smith
I like it. Thanks, Tom!



On Mar 9, 11:19 am, Tom Evans <tevans...@googlemail.com> wrote:
> On Fri, Mar 9, 2012 at 4:05 PM, Steven Smith <ste...@stevenlsmith.com> wrote:
> > I think I figured it out. My TYPE_MAPPING thing was causing the form
> > fields to be initialized *once*. So, I made the contents of
> > TYPE_MAPPING into strings, and I'm using eval().
>
> > Unless there's a better way, I'm leaving it like this in
> > production :-)
>
> Just as an idea, you could specify TYPE_MAPPING as a factory, which
> would avoid eval():
>
> TYPE_MAPPING_FACTORY = {
>    'Date': lambda: forms.DateTimeField(required=True,
>        widget=forms.DateTimeInput({'class': 'datetime'})),
>    'String': lambda: forms.CharField(max_length=100, required=True),
>    'Long': lambda: forms.IntegerField(required=False),
>    'Integer': lambda: forms.IntegerField(required=False),
>    'Boolean': lambda: forms.BooleanField(required=False),
>
> }
>
> field = TYPE_MAPPING_FACTORY['String']()
>
> Cheers
>
> Tom

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



Re: Weird problem generating forms on the fly

2012-03-09 Thread Steven Smith
I think I figured it out. My TYPE_MAPPING thing was causing the form
fields to be initialized *once*. So, I made the contents of
TYPE_MAPPING into strings, and I'm using eval().

Unless there's a better way, I'm leaving it like this in
production :-)



On Mar 9, 10:01 am, Steven Smith <ste...@stevenlsmith.com> wrote:
> I have data that looks like this:
> formfields = [{'label': u'IP address of hacker', 'type': u'String',
> 'name': u'locationIp'}, {'label': u'Created end date', 'type':
> u'Date', 'name': u'createdEndDate'}, {'label': u'Created start date',
> 'type': u'Date', 'name': u'createdStartDate'}]
>
> I want to generate a forms.Form object from it, so I wrote the
> following code (ReportForm is just an empty declaration of a form
> class):
>
> -
>
> TYPE_MAPPING = {
>     'Date': forms.DateTimeField(required=True,
> widget=forms.DateTimeInput({'class': 'datetime'})),
>     'String': forms.CharField(max_length=100, required=True),
>     'Long': forms.IntegerField(required=False),
>     'Integer': forms.IntegerField(required=False),
>     'Boolean': forms.BooleanField(required=False),
>
> }
>
> def get_form_for_report(formfields, postdata=None):
>     if postdata:
>         form = ReportForm(postdata)
>     else:
>         form = ReportForm()
>     attrs = formfields.reverse()
>     for f in attrs:
>         form.fields.insert(1, f['name'], TYPE_MAPPING.get(f['type']))
>         form.fields[f['name']].label = f['label']
>     return form
>
> -
>
> However, when this code executes, the form generated works perfectly,
> but the label is not always set properly. In this particular example,
> I get two fields (with correct field names) that have the label
> "Created Start Date".
>
> Where I am going wrong here?

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



Weird problem generating forms on the fly

2012-03-09 Thread Steven Smith
I have data that looks like this:
formfields = [{'label': u'IP address of hacker', 'type': u'String',
'name': u'locationIp'}, {'label': u'Created end date', 'type':
u'Date', 'name': u'createdEndDate'}, {'label': u'Created start date',
'type': u'Date', 'name': u'createdStartDate'}]

I want to generate a forms.Form object from it, so I wrote the
following code (ReportForm is just an empty declaration of a form
class):

-

TYPE_MAPPING = {
'Date': forms.DateTimeField(required=True,
widget=forms.DateTimeInput({'class': 'datetime'})),
'String': forms.CharField(max_length=100, required=True),
'Long': forms.IntegerField(required=False),
'Integer': forms.IntegerField(required=False),
'Boolean': forms.BooleanField(required=False),
}


def get_form_for_report(formfields, postdata=None):
if postdata:
form = ReportForm(postdata)
else:
form = ReportForm()
attrs = formfields.reverse()
for f in attrs:
form.fields.insert(1, f['name'], TYPE_MAPPING.get(f['type']))
form.fields[f['name']].label = f['label']
return form


-


However, when this code executes, the form generated works perfectly,
but the label is not always set properly. In this particular example,
I get two fields (with correct field names) that have the label
"Created Start Date".

Where I am going wrong here?

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



Re: [pinax-users] Learning Django+Pinax - Recommend books and/or tutorials?

2012-01-27 Thread Steven Elliott Jr
> 
> What would you recommend?
> 
To get started with Python:
http://pragprog.com/book/gwpy/practical-programming
http://www.amazon.com/gp/product/1590599829/ref=pd_lpo_k2_dp_sr_3/182-5610174-4840816?pf_rd_m=ATVPDKIKX0DER_rd_s=lpo-top-stripe-1_rd_r=1YTG71HMBVWK64HZ2TP2_rd_t=201_rd_p=486539851_rd_i=0764596543

To get started with Django:
http://www.amazon.com/Django-Website-Development-Ayman-Hourieh/dp/1847196780/ref=sr_1_2?s=books=UTF8=1327587925=1-2
http://www.amazon.com/Practical-Django-Projects-Experts-Development/dp/1430219386/ref=sr_1_2?s=books=UTF8=1327587948=1-2

There is no reason why you could not learn both things at the same time. 
Contrary to previous statements, Django and Python are not hard to get started 
with but are hard to master (as is anything). I like both of the Django books 
because they actually focus on building something meaningful and not just 
giving you an overview of the framework. The Django book is also a great 
reference book but I have never read it through cover-to-cover. I use it more 
as a reference when I am stuck on something and need some clarity. Also, I 
would really recommend going through the documentation for both Python and 
Django extensively, both are excellent.

Cheers,
Steven

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



Re: I need help with Python Tools for Visual Studio 2010 and Django

2012-01-27 Thread Steven Elliott Jr

On Jan 25, 2012, at 9:14 PM, JJ Zolper wrote:

> > The keywords were 'in production'. The development server (i.e. python
> > manage.py runserver) works fine under Windows. But when you want to
> > make the website accessible to your audience (the internet, company
> > etc.), you should host that on Linux. 
> 
> I still don't quite understand. Can you explain more? I would think this 
> means that my Django files should be on a Linux portion of my web server? I 
> am with Bluehost.com

It means when you actually go to deploy your app on an actual web server in 
production you're going to be deploying on Linux. I've never seen a Python host 
on Windows, but then again I've never looked because, to be honest most Django 
devs use some Unix variant for development.

> I have installed ActiveState and will give it a try. I have my VS up and 
> running with Python Tools for VS so that should be okay.
> 
> Hey Sam you've been a great help. Would you by chance mind giving me your 
> e-mail address? That way in the future I could work with you? I won't bother 
> you too much don't worry! lol. Just since I am trying your advice it could be 
> a great help to me.
> 
> What Virtual Machine did you pick? What Linux version are you running?

Most people use Ubuntu running in VirtualBox
> 
> If you prefer e-mailing/want to give me your address my next inquery would 
> just go to your e-mail.
> 
> Thanks so much!
> 
> JJ Zolper
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/django-users/-/nMqg8xOLXRcJ.
> To post to this group, send email to django-users@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-users@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 for a large social networking or photo sharing site?

2011-11-22 Thread Steven Elliott Jr
Yes

> Hello,
> 
> [This is the first time I am using Google Groups and/or mailing lists,
> so please bear with me if I do something wrong initially.]
> 
> Is Django web framework apt for a large social networking or photo
> sharing site? (Think one that has to easily and seamlessly scale to
> the size of Facebook or Flickr. Yes, I know I want too much, but
> that's for an estimate.)
> 
> thanks.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@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-users@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 FormWizard - How do you dynamically create a formset based on previous step

2011-11-17 Thread Steven Klass
Hi All,

(Sorry for the cross post to Stackoverflow as well - I'm really
pulling my hair out on this one!)
Posted on 
http://stackoverflow.com/questions/8172398/django-formwizard-how-do-you-dynamically-create-a-formset-based-on-previous-st

I've seen [this][1] post and it's not working (in part because it's
dated).  I've also studied the source tree to no avail (the tests
helped) but I can't find my answer. What I'm looking to do is get a
seed set of data in form0 ('start') which will dynamically build a
formset for step2.  Step 2 is simply a verification step.

  1. 'start' - User enters subdivision (subA), zipcode (12345) and a
csv of lots (51,52,53)
  2. 'step2' - A dynamic form (modelformset) is created with 3 forms
representing 51,52,53
  3. User hits go and the models are built

i.e.

data = [ { 'subdivision': , 'zipcode': '12345',
'lot_number': '51'}
 { 'subdivision': , 'zipcode': '12345',
'lot_number': '52'}
 { 'subdivision': , 'zipcode': '12345',
'lot_number': '53'} ]

__What I've tried__

When implementing the solution [here][1] I only get `data=None`.  This
is dated and looking through the source I thought the "right" way to
do this was to simply override the `get_form_instance` method and feed
it`get_cleaned_data_for_step`,  but that appears to revalidate and do
_a lot_ more stuff than what I think it needs to (and it didn't work).

So.. What I'm looking for is two things.

 1. What is the right way to get the previous forms data.
 2. How do I take that data and use it to create a n-number of
formsets.

FWIW I am using Django 1.4-alpha formset wizard.

Here is what I have.

# urls.py
url(r'homes/bulk/$', TestWizard.as_view([('start',
BulkHomeForm0),
 ('step2',
HomeFormSet)])),

# Models.py
class Subdivision(models.Model):
name = models.CharField(max_length=64)

class Home(models.Model):
lot_number = models.CharField(max_length=16)
subdivision = models.ForeignKey(Subdivision)
zipcode = models.IntegerField(validators=[validate_zipcode],
null=True)

# Forms
class BulkHomeForm0(forms.Form):
subdivision =
forms.ModelChoiceField(queryset=Subdivision.objects.all(),
required=True)
zipcode = USZipCodeField(required=True)
lots = forms.CharField(max_length=5000,
widget=forms.Textarea()

def clean(self):
subdivision = self.cleaned_data.get('subdivision', False)
zipcode = self.cleaned_data.get('zipcode', False)
final_data = []
for item in self.cleaned_data.get('lots', "").split(",")
final_data.append({'subdivision':subdivision,
   'zipcode':zipcode,
   'lot_number':item})
self.cleaned_data['homes'] = final_data

class BulkHomeForm1(forms.ModelForm):
class Meta:
model = Home

HomeFormSet = modelformset_factory(Home, form=BulkHomeForm1,
extra=2)

# Views.py
class TestWizard(WizardView):
storage_name =
'django.contrib.formtools.wizard.storage.session.SessionStorage'

def get_form(self, step=None, data=None, files=None):

if step is None:
step = self.steps.current
if step == 'step2':
print "Entering Step 2 Form"
form = super(TestWizard, self).get_form(step=step,
data=data, files=files)
if self.steps.current == 'step2':
print "Form is now contructed"

return form

def get_context_data(self, form, **kwargs):
context = super(TestWizard, self).get_context_data(form,
**kwargs)
if self.steps.current == 'start':
print "Gathering context data for start"
context.update({'another_var': True})
if self.steps.current == 'step2':
print "Gathering context data for step 2"
context.update({'another_var2': True})
return context

def get_form_instance(self, step):
if step == 'step2':
print "Getting instance data for step2"
# return self.get_cleaned_data_for_step('start')
['homes']
return self.instance_dict.get(step, None)

def get_form_initial(self, step):
if step == 'step2':
print "Getting initial data for step2"
# return self.get_cleaned_data_for_step('start')
['homes']
else: self.initial_dict.get(step, {})


def done(self, form_list, **kwargs):
return render_to_response('done.html', {
'form_data': [form.cleaned_data for form in
form_list],
})



  [1]: 
http://stackoverflow.com/questions/3940138/how-to-pass-previous-form-data-to-the-constructor-of-a-dynamicform-in-formwizard

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" 

Re: Sample Custom Decorator

2011-10-11 Thread Steven Cummings
The wrapper that you typically see is the new function that is returned.
This usually invokes the original, given function in addition to some extra
("decorating") logic around that call. Based on that question it sounds like
you might want to check out some introductory material on decorators [1][2].

Django view decorators simply need to be able to decorate a view function or
class, which means they need to support decorating something that takes a
request and optional args and returns a response. That means your wrapper
function can specify this much of the signature, and that's how you get
ahold of the request to work with. So, based on your pseudocode:

def intercept_foos(view_func):
def wrapper(request, *args, **kwargs):
if request.user.foo():
return redirect('/foo')
return view_func(request, *args, **kwargs)
return wrapper

Then just apply it as you did in your urls.py example.

Hope this helps.

[1]
http://stackoverflow.com/questions/739654/understanding-python-decorators -
A good starting point
[2] http://micheles.googlecode.com/hg/decorator/documentation.html - A handy
module and discussion of preserving function signatures
--
Steven


On Tue, Oct 11, 2011 at 4:59 PM, Kurtis Mullins <kurtis.mull...@gmail.com>wrote:

> Thanks Fred! I tried to look through your code and understand what's going
> on -- but I'm still at a loss. I'm guessing I need to look at the Django
> source to see what should be returned when you hit a URL and what is passed.
> The wrapper is confusing me and I've seen that in Django code as well. I'm
> going to go out on a limb and say it's probably not as easy as I hoped,
> haha.
>
>
> On Tue, Oct 11, 2011 at 4:42 PM, Sells, Fred <fred.se...@adventistcare.org
> > wrote:
>
>> I'm no expert but this is what I built to log all user actions -- warts
>> and all
>>
>> def decorate(func):
>>##print 'Decorating %s...' % func.__name__
>>def wrapped( *args, **kwargs):
>>request = args[0]
>>if len(args)>1: command=str(args[1])
>>else: command = ''
>>ipaddr = request.META['REMOTE_ADDR']
>>user = request.session.get('user', None)
>>if user: userid = user.userid
>>else: userid = '?'
>>qs =  extract_querystring_from_request(request)
>>parameters = Parameters(**qs)
>>resid = parameters.pop('resid', '')
>>assessmentid = parameters.pop('id', 0)
>>facility = parameters.pop('facility','')
>>modified = func.__name__ in ("setvalues", "setraw", "create",
>> 'editcaas')
>> ###print func.__name__, 'z', modified, qs
>>modified = modified or (func.__name__=='command' and
>> command!='print')
>>fieldnames = parameters.values().keys()
>>for signature in SIGNATURE_FIELDS:
>>if signature in fieldnames: command='signit'
>>if (not facility) and resid:
>>facility = resid[:2]
>>option = str(parameters)[:110]
>>action = '%s:%s' % (func.__name__, command)
>> ###print  "\n\n\n\ncalled wrapped function with ", (action,
>> option, str(parameters))
>>record = models.HipaaLog.objects.create(Version=K.VERSION,
>> userid=userid,
>>Action=action,
>> Options=option,
>>#StartTime =
>> datetime.datetime.now(),
>>
>> AssessmentId=assessmentid, ResidentId=resid,
>>Modified = modified,
>>IpAddress = ipaddr,
>> Facility=facility)
>>#print record.Modified, record.Action, 'record'
>>results = func( *args, **kwargs)
>>#record.StopTime = datetime.datetime.now()
>>#record.save()
>>return results
>>print 'done'
>>return wrapped
>>
>> 
>> @decorate
>> def command(request, *args, **kwargs):
>>...
>>
>> -Original Message-
>> From: django-users@googlegroups.com
>> [mailto:django-users@googlegroups.com] On Behalf Of Kurtis
>> Sent: Tuesday, October 11, 2011 12:03 PM
>> To: Django users
>> Subject: Sample Custom Decorator
>>
>> Hey Guys,
>>
>> Would anyone be willing to show me an example of a very simple and
>> dumb decorator for views? I've been trying to read the existing
>> decorators and play with a couple of snippets but I'm having a lot of
&g

Combining Querysets from different, but similar models

2011-10-05 Thread Steven Smith
I'm working on a site that has a requirement for a "recent activity"
feed on the homepage. Usually, I'd just do a MyFoo.objects.order_by('-
created') and all would be well. But "activity" is actually from
several models. They all have some fields in common, like the
timestamp, since they all have the same abstract base class, but
they're definitely different things.

What's the cheapest way to do my queries and mix the results into one
feed? Ideally, the name of the model, or some other differentiating
attribute would be exposed so that I can use it in my template loop as
a style hook. Models in question are below...


class TrackableModel(models.Model):
created = models.DateTimeField(auto_now_add=True)
modified = models.DateTimeField(auto_now=True)
created_by = models.ForeignKey(User, blank=True, null=True)
history = models.TextField(blank=True)
notes = models.TextField(blank=True)
is_active = models.BooleanField(blank=True, default=True)

class Meta:
abstract = True


class Review(TrackableModel):
book = models.ForeignKey('Textbook')
course = models.ForeignKey('TaughtCourse', blank=True, null=True)
should_buy = models.BooleanField(blank=True)
rating_prep = models.DecimalField(blank=True, null=True,
max_digits=2, decimal_places=1)
rating_hw = models.DecimalField(blank=True, null=True,
max_digits=2, decimal_places=1)
rating_inclass = models.DecimalField(blank=True, null=True,
max_digits=2, decimal_places=1)
can_share = models.BooleanField(blank=True, default=True)
comments = models.TextField(blank=True)


class MarketplacePosting(TrackableModel):
book = models.ForeignKey('Textbook', blank=True, null=True)
school = models.ForeignKey('School', blank=True, null=True)
location = models.CharField(max_length=255, blank=True,
verbose_name="Sale location")
condition = models.CharField(max_length=15, blank=True,
choices=CONDITION_CHOICES)
contains_highlighting = models.BooleanField(blank=True)
price = models.DecimalField(blank=True, null=True, max_digits=6,
decimal_places=2)
comments = models.TextField(blank=True)
is_sold = models.BooleanField(blank=True)

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



Re: installing django

2011-09-13 Thread Steven Elliott Jr
What exactly is the problem? Can you provide more detail? Platform, error 
messages, python version? What have you tried already?


On Sep 13, 2011, at 1:21 PM, re64  wrote:

> I am having trouble installing django.  I cant seem to do it any
> suggestions
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@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-users@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 Development environment

2011-08-27 Thread Steven Elliott Jr

On Aug 27, 2011, at 11:17 AM, Simon Connah <simon.connah...@gmail.com> wrote:

> 
> On 27 Aug 2011, at 04:44, Steven Elliott Jr wrote:
> 
>>> On Fri, 2011-08-26 at 15:07 +0100, Simon Connah wrote:
>>>> Mercurial or Git (depends on whether the project is open source or not)
>> 
>> Kenneth,
>> 
>> I think he means whether or not the repository will be public or private. 
>> Github (git) does not offer private repos unless you pay whereas bitbucket 
>> (mercurial) gives you 5 private ones for free as well as the option for 
>> creating public ones. I personally am a big BitBucket fan as I find it much 
>> much easier to manage and also a bit faster. 
>> 
>> Best,
>> Steve
> 
> Correct. Although Bitbucket offers unlimited private repos. It just limits 
> you to 5 users...
 
Right, sorry that's what I was going for but I brain spasm'd on the iPhone. 
Bitbucket has gotten a lot better since Atlassian took it over. 

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



Re: Django Development environment

2011-08-27 Thread Steven Elliott Jr
> On Fri, 2011-08-26 at 15:07 +0100, Simon Connah wrote:
>> Mercurial or Git (depends on whether the project is open source or not)

Kenneth,

I think he means whether or not the repository will be public or private. 
Github (git) does not offer private repos unless you pay whereas bitbucket 
(mercurial) gives you 5 private ones for free as well as the option for 
creating public ones. I personally am a big BitBucket fan as I find it much 
much easier to manage and also a bit faster. 

Best,
Steve

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



Re: Django Development environment

2011-08-25 Thread Steven Elliott Jr

> Am 23.08.2011 00:07, schrieb Stephen Jackson:
>> I am new to the world of Django. I would like to hear from other django
>> developers describe their dev environment (tools, os, editors, etc.).

Mac OS X Lion
PyCharm and TextMate with Python competion and Django bundles
Mysql & MongoDB
South
Pygments
Also using Sphinx for help 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-users@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: Most stable Linux distribution for Django - Python development

2011-08-02 Thread Steven Smith
We're using Gentoo 64-bit on all of our production webservers at work,
and I run 4 additional Gentoo-based Django servers outside of work.

It took a long time to configure, and is not for the faint of heart.

But, my stripped-down versions of Apache and Postgres run really fast
with a small memory footprint. Gentoo provided the framework that made
these customizations easy (a lot easier to optimize things with USE
flags than low-level compile options...). Since I don't have a lot of
the bloat that is plaguing Linux these days, I can do system updates
infrequently and quickly. The full day it took me to get the server
set up has more than paid for itself by making long-term maintenance a
snap.




On Aug 1, 4:27 am, Anoop Thomas Mathew  wrote:
> Hi All,
> Firstly, I am not here for a distro war.
>
> I was using ubuntu 9.10, and then switched to fedora 14 and then to fedora
> 15.
> IMHO, It seems that they all were quite unstable. (Many times it hung up on
> my Dell and HP machines - may be driver issues, still I don't want that
> too.)
> I would really like some recommendation for a linux distro which is much
> stable, but still can support all relevant packages.
>
> Top recommendations I found around was Debian and OpenSuse.
> Please revert with your suggestions.
>
> Thanks,
> Anoop Thomas Mathew
>
> atm
> ___
> Life is short, Live it hard.

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



Accessing "request" from within an authentication backend

2011-07-26 Thread Steven Smith
Is there a way to access the HttpResponse, or issue a redirect from
within a custom authentication backend? I have Django hooked up to our
Active Directory server, and it works perfectly except when the user's
password expires or they have "User must change password at next
login" set on their account. In these circumstances, I'd like to be
able to spit out a message (using contrib.messages) stating that they
are required to change their password, and then (ideally) issue an
HttpResponseRedirect over to our "change password" website, which is,
coincidentally, on the same Django system, so the message would carry
over and stuff... but I need to be able to set it in the first place.

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



Re: Question about Displaying a Table

2011-06-27 Thread Steven Elliott Jr
Django has about the best documentation out there foe getting started. Walk 
through the tutorial and see how it goes. 

Sent from my iPhone

On Jun 27, 2011, at 2:25 PM, "Cal Leeming [Simplicity Media 
Ltd]" wrote:

> Forgive me but, the tone of this email sounds like you are asking us to do 
> this research for you :X
> 
> On Mon, Jun 27, 2011 at 7:18 PM, Kyle Latham  wrote:
> Hello,
> 
> I am pretty new to Django and Python.
> 
> I'm wanting to create a Django app that displays different tables in
> my MySQL database, and the user can search through the tables for info
> they want.
> 
> I haven't written any code yet, I'm doing research on the approach I
> have to take.  Is the only way I am able to display a table from the
> MySQL database in Django by creating a template and importing the data
> to the template? Is there a another/better approach towards displaying
> a MySQL table in the Django app?
> 
> Thank you,
> 
> Kyle
> 
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@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-users@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-users@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: Returning a 503 response instead of a 500 response

2011-06-23 Thread Steven L Smith
Neat. I've been doing Django since the 0.9.6 days and have never written a 
middleware. I guess there's a first time for everything.

Thanks!


Steven L Smith, Web Developer
Department of Information Technology Services
Nazareth College of Rochester
585-389-2085 | ssmit...@naz.edu | KC2YTC
http://www.naz.edu/pub/~ssmith46


- Original Message -
From: "Tom Evans" <tevans...@googlemail.com>
To: django-users@googlegroups.com
Sent: Thursday, June 23, 2011 9:28:15 AM GMT -05:00 US/Canada Eastern
Subject: Re: Returning a 503 response instead of a 500 response

On Thu, Jun 23, 2011 at 2:19 PM, Steven L Smith <ssmit...@zimbra.naz.edu> wrote:
> Some of our apps have to talk to databases outside of our control, and their 
> operators don't have the same uptime standards that we do...
>
> What can I do to make Django return a "503 Service Unavailable" instead of a 
> "500 Internal Server Error", when it encounters a DatabaseError or 
> ProgrammingError while trying to access the database? Bonus points if I could 
> make the 503 page say "there was a temporary database communication problem."
>
> I have some ideas of what I *could* modify, but I'd rather incorporate this 
> into a product or setting instead of having to patch the actual django 
> database backend code itself.
>

Exception handling is performed by middleware. When a django view
encounters an un-handled exception, each installed middleware class is
asked if it wants to handle this exception. If none do, Django sends
out it's pre-canned response as it sees fit.

So, simply write your own exception handling middleware that handles
DatabaseError or ProgrammingError, and passes on other errors. See the
docs for more details:

https://docs.djangoproject.com/en/1.3/topics/http/middleware/#process-exception

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@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-users@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.



Returning a 503 response instead of a 500 response

2011-06-23 Thread Steven L Smith
Some of our apps have to talk to databases outside of our control, and their 
operators don't have the same uptime standards that we do...

What can I do to make Django return a "503 Service Unavailable" instead of a 
"500 Internal Server Error", when it encounters a DatabaseError or 
ProgrammingError while trying to access the database? Bonus points if I could 
make the 503 page say "there was a temporary database communication problem."

I have some ideas of what I *could* modify, but I'd rather incorporate this 
into a product or setting instead of having to patch the actual django database 
backend code itself.

========
Steven L Smith, Web Developer
Department of Information Technology Services
Nazareth College of Rochester
585-389-2085 | ssmit...@naz.edu | KC2YTC
http://www.naz.edu/pub/~ssmith46


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



Intermittent OperationalError on multiple Django servers

2011-06-16 Thread Steven Smith
On two separate Django servers, I'm seeing variations on this error:


 File "/usr/lib64/python2.6/site-packages/django/db/models/sql/
compiler.py", line 731, in execute_sql
   cursor = self.connection.cursor()

 File "/usr/lib64/python2.6/site-packages/django/db/backends/
__init__.py", line 75, in cursor
   cursor = self._cursor()

 File "/usr/lib64/python2.6/site-packages/django/db/backends/
postgresql_psycopg2/base.py", line 136, in _cursor
   self.connection = Database.connect(**conn_params)

OperationalError: could not connect to server: Connection refused
   Is the server running on host "localhost" and accepting
   TCP/IP connections on port 5432?



99% of the time, the user agent is one of the search engines' bots, so
I don't think very many users are seeing it, but it's definitely
affecting my SEO, since, the search engine can't crawl the site. And
it makes me cringe every time I see the error emails...


Anybody have a nudge in the right direction as to where I might start
looking? This is Django 1.2.5 with Postgres 9.0.3, running on a 64-bit
linux system with Apache 2.2.16 and mod_wsgi 3.3.

Thanks!

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



Re: GET vs POST for read-only views

2011-06-14 Thread Steven L Smith
Hi Shawn-

There is a consensus in the web development community at large -- the HTTP Spec 
itself touches on it, and the W3C has released a few supporting statements as 
well.

http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
This is the HTTP 1.1 spec, section 9, which defines the difference between the 
various verbs, including GET and POST, in terms of idempotence.

And this helps clarify:
http://www.w3.org/2001/tag/doc/whenToUseGet-20040321

For your use case, I would definitely use GET. The user may wish to bookmark 
the report, for example, or send it to a colleague. Searches and such should 
always use GET, unless there's a truly compelling reason not to.

POST should only be used for things that change stuff on the server... a 
contact form, a form that creates something in a database, etc...


Cheers!
-Steve


Steven L Smith, Web Developer
Department of Information Technology Services
Nazareth College of Rochester
585-389-2085 | ssmit...@naz.edu | KC2YTC
http://www.naz.edu/pub/~ssmith46


- Original Message -
From: "Shawn Milochik" <sh...@milochik.com>
To: django-users@googlegroups.com
Sent: Monday, June 13, 2011 12:45:39 PM GMT -05:00 US/Canada Eastern
Subject: GET vs POST for read-only views

Is there a consensus in the community that GET should be used for
requests that don't write to the database? As a specific example, let's
say there's a report form that allows a user to select a start and end
date, and maybe some other search fields. What would you use for this,
and why?

I use POST for almost everything, but I admit it's mainly to avoid
super-ugly URLs full of querystring content.

Thanks,
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-users@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-users@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: Is there an HTML editor that's Django-aware

2011-05-26 Thread Steven Robbins
I agree with Shawn. Any powerful text editor you use will take time to get
used to and customize for your purpose (in this case editing HTML and
handling of django templates). Stick with one editor for a few weeks and
decide what additional functionality you might need. Then do some searching
based on those requirements to see if there's a better option.

On 26 May 2011 21:11, Shawn Milochik  wrote:

> On 05/26/2011 04:05 PM, AJ wrote:
>
>> I'd like to know why people really like Vim if it is "a piece of shit" ?
>>
>> Just want to know because I try to learn it everytime and I hear great
>> things about it.
>>
>>
> Ignore that comment. It's ignorant flame-bait. Don't drag that conversation
> on.
>
> Try anything you want, keep using whatever you like. If a large active user
> community is something you value in your text editor, you'll find it in many
> places, including with vim.
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@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-users@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: Modifying existing site

2011-05-26 Thread Steven Robbins
Hi Sach,

I'd start by doing the following:

- Install django on your laptop/desktop for testing

You'll need python installed and if the following command doesn't work
follow the steps in this document https://www.djangoproject.com/download/

  easy_install django

- Spend an hour going through the django tutorials at
https://docs.djangoproject.com/en/1.3/
- Look at the contents of the zip file to get an idea of what files are
there
- Find out what database was being used. If it's sqlite you might have the
db file already. Otherwise you might need to setup mysql or postgres.

Hope this helps.

Steve

On 26 May 2011 14:26, Sach  wrote:

> Hello,
>
> I am completely new to this Django world. I haven't tried it ever
> before.
>
> Now the problem is as below;
>
> One of my clients was hosting his site somewhere else that I don't
> know and they built the site using Django. The host company doesn't
> allow to make any changes on their server, instead they provided the
> zip file for all the files in the site to me; so that now I can  host
> my client's site.
>
> As I don't know anything about Django, can someone please shed a light
> where I should start from?
>
> Thanks in advance.
>
> Cheers.
> Sach
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@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-users@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: Is there an HTML editor that's Django-aware

2011-05-26 Thread Steven Robbins
AJ,

I found these videos to be quite useful when I was learning to use vim.

http://vimeo.com/user1690209/videos

Steve

On 26 May 2011 04:32, AJ  wrote:

> Thanks a lot Simon. This is probably OT:
>
> That was helpful but I thought I could dive in again with Vim and failed
> (at least for now).
>
> You see, I am now used to some of the things in textmate:
>
> * quick file switching. Textmate has Cmd+T and type the file name for quick
> switching
> * a project. I found the project plugin but still could not figure out the
> usage.
>
> I am playing with NERDTree right now. I think there should be a plugin for
> quick file switching. I do need to know some more shortcuts for NERDTree to
> quickly open files and bookmark them.
>
> I just installed the project-plugin too
> http://www.vim.org/scripts/script.php?script_id=69
> but again, still have to deal with the learning curve.
>
> Having complained enough, I still think that if I do not give up this time,
> I will be better off with this editor as my primary.
>
> Best,
> AJ
>
>
> On Tue, May 24, 2011 at 4:02 PM, Simon Connah 
> wrote:
>
>>
>> On 24 May 2011, at 18:49, AJ wrote:
>>
>> > Simon,
>> >
>> > Can you please give details of plugins that you use for Python/Django in
>> MacVim?
>> >
>> > Thanks,
>> > AJ
>>
>> Sure.
>>
>> I use this plugin collection:
>>
>> https://github.com/carlhuda/janus
>>
>> as well as this extra plugin:
>>
>> http://www.vim.org/scripts/script.php?script_id=2441
>>
>> I'm positive there are more out there and I have tried various code
>> folding plugins but they just slowed me down. If anyone else has any more
>> tips I'd like to know what the consensus is with vim users for Python /
>> Django development. My .vimrc file is as follows if you want that as well
>> (it has some stuff for Haskell in it as well which you can remove):
>>
>> set nocompatible
>> set columns=80
>> if has("colorcolumn")
>>set colorcolumn=80
>> else
>>au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>80v.\+', -1)
>> endif
>> set guifont=Monaco:h14
>> set guioptions=aAce
>> set shiftwidth=4
>> set tabstop=4
>> set softtabstop=4
>> set expandtab
>> set undolevels=1000
>> set history=1000
>> set hlsearch
>> set showmatch
>> set title
>> set visualbell
>> set noerrorbells
>> set wildignore=*.o,*.swp,*.pyc,*.pyo,*.hg,*.git,*.bak,*.class
>> filetype on
>> filetype plugin indent on
>> " enable omni completion for python
>> au FileType python set omnifunc=pythoncomplete#Complete
>> " pyflakes is an intellisense checker for python
>> let g:pyflakes_use_quickfix = 0
>> syntax on
>> au Bufenter *.hs compiler ghc
>> set confirm
>> set number
>> set nowrap
>> set nobackup
>> set nowritebackup
>> set noswapfile
>> set pastetoggle=
>> let g:haddock_browser = "open"
>> let g:haddock_browser_callformat = "%s %s"
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@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-users@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-users@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: How to setup the django progject to apache2

2011-05-02 Thread Steven Han
under the /etc/apache2/sites-available ,there are two files "default" and
"default-ssl".
when I modify it as the httpd.conf, and the file "000-default" under the
/etc/apache2/sites-enables is updated automatically, and same as "default"
under the sites-available.

then empty the httpd.conf file。

the resault is also "403 Forbidden, no permission to access  "



2011/5/2 George Ajam <george.ej...@gmail.com>

> Did you tried to put your configuration in a file similar to default
> inside /etc/apache2/sites-available
> then try to make an enable to the site using a2ensite follwed by the
> name of your file, and I guess you should leave httpd.conf blank.
> Regards,
> George
>
> On May 1, 1:41 pm, Steven Han <zike...@gmail.com> wrote:
> > Hi,
> >
> > I want to develop Django on the Apache2 server. And I have follow the
> some
> > instruction about how to setup django app on the apache2 server.
> > but allows failed.
> >
> > My system is Ubuntu 10.10. what my step as below:
> >
> > (1)  sudo apt-get install apache2
> > (2) sudo apt-get install libapache2-mod-wsgi
> >
> > when I opened 127.0.0.1 . "It works!" displayed. And I can find wsgi.conf
> > and wsgi.load file under the path /etc/apache2/mods-enabled
> > So Apache2 and Mod_wsgi are installed.
> >
> > My project "djcms" is under the path /home/zikey/Workspace/Django/djcms.
> And
> > the "settings.py" file is under djcms folder.
> > I modifed the file httpd.conf as below:(original file is empty)
> >
> ###­###
> > 
> > ServerAdmin webmaster@localhost
> >
> > WSGIScriptAlias / /home/zikey/Workspace/Django/djcms/django.wsgi
> >  
> >  AllowOverride None
> > Order deny,allow
> > allow from all
> >  
> >
> > 
> >
> >
> ###­
> >
> > And put the django.wsgi file under /home/zikey/Workspace/Django/djcms.
> > The content of django.wsgi is like this:
> >
> ###­
> >
> > import os
> > import sys
> >
> > current_dir = os.path.dirname(__file__)
> >
> > if current_dir not in sys.path:
> > sys.path.append(current_dir)
> >
> > os.environ['DJANGO_SETTINGS_MODULE'] = "settings'
> >
> > import django.core.handlers.wsgi
> > application = django.core.handlers.wsgi.WSGIHandler()
> >
> >
> ###­
> >
> > But every time I run the URLhttp://127.0.0.1:9000
> > it always displays:
> >  "Oops! Google Chrome could not connect to 127.0.0.1:9000 "
> >
> > :(
> > Do you know what I missed ?
> >
> > Br,
> > Steven
>

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



Re: How to setup the django progject to apache2

2011-05-01 Thread Steven Han
I got the error like this:

Forbidden

You don't have permission to access / on this server.
--
Apache/2.2.16 (Ubuntu) Server at 127.0.0.1 Port 9000



when I modify the httpd.conf:

Listen 9000

ServerAdmin webmaster@localhost

WSGIScriptAlias / /home/zikey/Workspace/Django/djcms/django.wsgi
 DocumentRoot /home/zikey/Workspace/Django/djcms
 
AllowOverride None
 Order deny,allow
allow from all




2011/5/1 Gianluca Sforna <gia...@gmail.com>

> On Sun, May 1, 2011 at 12:41 PM, Steven Han <zike...@gmail.com> wrote:
> > But every time I run the URL http://127.0.0.1:9000
> > it always displays:
> >
> > "Oops! Google Chrome could not connect to 127.0.0.1:9000 "
> >
> > :(
> > Do you know what I missed ?
>
> This is more an apache question than a django question, however I
> think you're missing to let the server actually listen on port 9000.
>
> Try adding a line like:
> Listen 9000
> outside your virtualhost directive.
>
> See http://httpd.apache.org/docs/2.2/bind.html#virtualhost for details
>
>
> --
> Gianluca Sforna
>
> http://morefedora.blogspot.com
> http://identi.ca/giallu - http://twitter.com/giallu
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@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-users@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: How to setup the django progject to apache2

2011-05-01 Thread Steven Han
no , I don't

And I can use pythom manage.py runserver to run the project.
But I just want to use the apache server.

After installing the apache. I didn't modify any files except the httpd.conf
file.


2011/5/1 Robbington 

> Bit confused matey,
>
> Do you have a domain name to serve those pages to?
>
> If you are just trying to run it from localhost, 127.0.0.1: why not
> just use the Django development server?
>
> Rob
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@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-users@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: How to setup the django progject to apache2

2011-05-01 Thread Steven Han
Btw, the url.py is like this:


from django.conf.urls.defaults import patterns, include, url
from django.views.generic import DetailView,ListView
from polls.models import Poll


# Uncomment the next two lines to enable the admin:

#zikey
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),

 
url(r'^polls/$',ListView.as_view(queryset=Poll.objects.order_by('-pub_date')[:5],
  context_object_name='latest_poll_list',


   template_name='polls/index.html')),
)

#



2011/5/1 Steven Han <zike...@gmail.com>

> Hi,
>
> I want to develop Django on the Apache2 server. And I have follow the some
> instruction about how to setup django app on the apache2 server.
> but allows failed.
>
> My system is Ubuntu 10.10. what my step as below:
>
> (1)  sudo apt-get install apache2
> (2) sudo apt-get install libapache2-mod-wsgi
>
> when I opened 127.0.0.1 . "It works!" displayed. And I can find wsgi.conf
> and wsgi.load file under the path /etc/apache2/mods-enabled
> So Apache2 and Mod_wsgi are installed.
>
> My project "djcms" is under the path /home/zikey/Workspace/Django/djcms.
> And the "settings.py" file is under djcms folder.
> I modifed the file httpd.conf as below:(original file is empty)
>
> ##
> 
> ServerAdmin webmaster@localhost
>
> WSGIScriptAlias / /home/zikey/Workspace/Django/djcms/django.wsgi
>  
>  AllowOverride None
> Order deny,allow
> allow from all
>  
>
> 
>
>
> ###
>
> And put the django.wsgi file under /home/zikey/Workspace/Django/djcms.
> The content of django.wsgi is like this:
>
> ###
>
> import os
> import sys
>
> current_dir = os.path.dirname(__file__)
>
> if current_dir not in sys.path:
> sys.path.append(current_dir)
>
> os.environ['DJANGO_SETTINGS_MODULE'] = "settings'
>
> import django.core.handlers.wsgi
> application = django.core.handlers.wsgi.WSGIHandler()
>
>
> #######
>
> But every time I run the URL http://127.0.0.1:9000
> it always displays:
>  "Oops! Google Chrome could not connect to 127.0.0.1:9000 "
>
>
> :(
> Do you know what I missed ?
>
> Br,
> Steven
>
>

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



How to setup the django progject to apache2

2011-05-01 Thread Steven Han
Hi,

I want to develop Django on the Apache2 server. And I have follow the some
instruction about how to setup django app on the apache2 server.
but allows failed.

My system is Ubuntu 10.10. what my step as below:

(1)  sudo apt-get install apache2
(2) sudo apt-get install libapache2-mod-wsgi

when I opened 127.0.0.1 . "It works!" displayed. And I can find wsgi.conf
and wsgi.load file under the path /etc/apache2/mods-enabled
So Apache2 and Mod_wsgi are installed.

My project "djcms" is under the path /home/zikey/Workspace/Django/djcms. And
the "settings.py" file is under djcms folder.
I modifed the file httpd.conf as below:(original file is empty)
##

ServerAdmin webmaster@localhost

WSGIScriptAlias / /home/zikey/Workspace/Django/djcms/django.wsgi
 
 AllowOverride None
Order deny,allow
allow from all
 



###

And put the django.wsgi file under /home/zikey/Workspace/Django/djcms.
The content of django.wsgi is like this:
###

import os
import sys

current_dir = os.path.dirname(__file__)

if current_dir not in sys.path:
sys.path.append(current_dir)

os.environ['DJANGO_SETTINGS_MODULE'] = "settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

###

But every time I run the URL http://127.0.0.1:9000
it always displays:
 "Oops! Google Chrome could not connect to 127.0.0.1:9000 "


:(
Do you know what I missed ?

Br,
Steven

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



Re: code 128 or code 39 barcode generation

2011-04-18 Thread Steven L Smith
There's a great wrapper you can use to generate these in PIL using a
postscript library.
http://pypi.python.org/pypi/elaphe/

I did something similar with pyqrnative to generate QR Codes for a
conference, basically just create a URL that wraps the output of the
library in an HTTPResponse.



On Apr 18, 1:58 pm, Bobby Roberts  wrote:
> anyone know if there is a django module to generate code 128 or 39
> barcodes for printing out on a webpage?

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



Re: Need help with this basic query (annotate vs aggregate)

2011-03-03 Thread Steven Sacks
Also, I need to get back Playlist records (hence the
select_releated()).

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



  1   2   3   >