Re: Postcode Search

2016-08-25 Thread 'David Turner' via Django users
Thanks for this but am looking for Uk Postcodes. Will continue my research.

On 24 August 2016 at 15:10, Derek  wrote:

> The Google geocoding API can help - see:
> https://developers.google.com/maps/documentation/geocoding/intro
> Their example shows the ZIP code being returned in the JSON/XML response.
>
> Or there is: https://www.zipcodeapi.com/
>
> Of course, you need to adhere to the terms&conditions of these service
> providers.
>
>
> On Tuesday, 23 August 2016 23:19:53 UTC+2, dtdave wrote:
>>
>> I am looking to add the facility to "find my nearest" by postcode to my
>> django app.
>>
>> Does anyone have any recommendations for this facility?
>>
>> Many thanks in advance.
>>
> --
> 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/-DQWcH9zkbA/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/ca6a1b18-c6b7-4292-be7c-edafeaea156a%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/CALwQ%2B-tr%2Brz3NHLhwBA-tCXpguR5ozakyf7uo5Dedh-XYcD1rA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Postcode Search

2016-08-25 Thread Christian Ledermann
have a look at https://github.com/cleder/os-opendata-edubase

import of uk postcodes from ordonance survey:
https://github.com/cleder/os-opendata-edubase/blob/master/fabric/fabfile.py#L286

get points near to:

https://github.com/cleder/os-opendata-edubase/blob/master/django/schools/views.py#L63
or
https://github.com/cleder/os-opendata-edubase/blob/master/django/schools/views.py#L120

HTH

On 25 August 2016 at 10:25, 'David Turner' via Django users
 wrote:
> Thanks for this but am looking for Uk Postcodes. Will continue my research.
>
> On 24 August 2016 at 15:10, Derek  wrote:
>>
>> The Google geocoding API can help - see:
>> https://developers.google.com/maps/documentation/geocoding/intro
>> Their example shows the ZIP code being returned in the JSON/XML response.
>>
>> Or there is: https://www.zipcodeapi.com/
>>
>> Of course, you need to adhere to the terms&conditions of these service
>> providers.
>>
>>
>> On Tuesday, 23 August 2016 23:19:53 UTC+2, dtdave wrote:
>>>
>>> I am looking to add the facility to "find my nearest" by postcode to my
>>> django app.
>>>
>>> Does anyone have any recommendations for this facility?
>>>
>>> Many thanks in advance.
>>
>> --
>> 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/-DQWcH9zkbA/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/ca6a1b18-c6b7-4292-be7c-edafeaea156a%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/CALwQ%2B-tr%2Brz3NHLhwBA-tCXpguR5ozakyf7uo5Dedh-XYcD1rA%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 
Best Regards,

Christian Ledermann

Newark-on-Trent - UK
Mobile : +44 7474997517

https://uk.linkedin.com/in/christianledermann
https://github.com/cleder/


<*)))>{

If you save the living environment, the biodiversity that we have left,
you will also automatically save the physical environment, too. But If
you only save the physical environment, you will ultimately lose both.

1) Don’t drive species to extinction

2) Don’t destroy a habitat that species rely on.

3) Don’t change the climate in ways that will result in the above.

}<(((*>

-- 
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/CABCjzWqJoyA454Grv0GbZ57KyAe%3D08E9hdaT78sCp7JRO0hnYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Postcode Search

2016-08-25 Thread 'David Turner' via Django users
Thanks for this. Exactly what I am looking for.

On 25 August 2016 at 12:59, Christian Ledermann <
christian.lederm...@gmail.com> wrote:

> have a look at https://github.com/cleder/os-opendata-edubase
>
> import of uk postcodes from ordonance survey:
> https://github.com/cleder/os-opendata-edubase/blob/master/
> fabric/fabfile.py#L286
>
> get points near to:
>
> https://github.com/cleder/os-opendata-edubase/blob/master/
> django/schools/views.py#L63
> or
> https://github.com/cleder/os-opendata-edubase/blob/master/
> django/schools/views.py#L120
>
> HTH
>
> On 25 August 2016 at 10:25, 'David Turner' via Django users
>  wrote:
> > Thanks for this but am looking for Uk Postcodes. Will continue my
> research.
> >
> > On 24 August 2016 at 15:10, Derek  wrote:
> >>
> >> The Google geocoding API can help - see:
> >> https://developers.google.com/maps/documentation/geocoding/intro
> >> Their example shows the ZIP code being returned in the JSON/XML
> response.
> >>
> >> Or there is: https://www.zipcodeapi.com/
> >>
> >> Of course, you need to adhere to the terms&conditions of these service
> >> providers.
> >>
> >>
> >> On Tuesday, 23 August 2016 23:19:53 UTC+2, dtdave wrote:
> >>>
> >>> I am looking to add the facility to "find my nearest" by postcode to my
> >>> django app.
> >>>
> >>> Does anyone have any recommendations for this facility?
> >>>
> >>> Many thanks in advance.
> >>
> >> --
> >> 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/-DQWcH9zkbA/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/ca6a1b18-
> c6b7-4292-be7c-edafeaea156a%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/CALwQ%2B-tr%2Brz3NHLhwBA-
> tCXpguR5ozakyf7uo5Dedh-XYcD1rA%40mail.gmail.com.
> >
> > For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> Best Regards,
>
> Christian Ledermann
>
> Newark-on-Trent - UK
> Mobile : +44 7474997517
>
> https://uk.linkedin.com/in/christianledermann
> https://github.com/cleder/
>
>
> <*)))>{
>
> If you save the living environment, the biodiversity that we have left,
> you will also automatically save the physical environment, too. But If
> you only save the physical environment, you will ultimately lose both.
>
> 1) Don’t drive species to extinction
>
> 2) Don’t destroy a habitat that species rely on.
>
> 3) Don’t change the climate in ways that will result in the above.
>
> }<(((*>
>
> --
> 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/-DQWcH9zkbA/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/CABCjzWqJoyA454Grv0GbZ57KyAe%3D08E9hdaT78sCp7JRO0hnYg%
> 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/CALwQ%2B-uX1q0FW77svsBn%3DJv2dJ0tjuxOxnapAd%2B3fBaDYjFiVw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Hi. i'm new to django, i have lot of doubts about AD

2016-08-25 Thread rajeshkmr9583
Hi guys,
i'm new to django framework and now my doubt id how to create AD for 
login page

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b866-4026-4f3d-9b0f-1840ab90a57a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Isolate Django apps in different Docker containers

2016-08-25 Thread Guillaume Dupin
Hello,
 
On a Django project (which will consist of several REST web services), I 
would like to isolate my services (each service would be a Django 
application) into different Docker containers to aim to a micro-services 
architecture. It will allow to benefit of Docker isolation to update 
independantly the different apps of the project and also to scale each 
service idependantly according to the load increase by using load-balancers 
in font of each group of services-containers (plus the numerous advantages 
brought by Docker).
I understand that, by doing so, each container will run a Django server and 
that this different servers will surely have to share some data.
 
First, do you think it is possible to do so ?
I have searched examples of such architectural choice but I always found 
the use of Docker to encapsulate a Django project (one container for the 
server, one container for the DB for example) and never this idea of "one 
app per container" architecture.
Do you think it is a valid approach ? 
Has someone already tested such a solution ? 
One problem I identify is : will each Django server have to be aware of all 
the services or not ?
 
To go further, if the previous idea is valid, do you think it can be 
coupled with a separation of databases ? As Django can already manage 
different databases, I imagined that each application could use several 
databases : a common Django database (accesible from all the apps) for the 
generic data and a specific database for all the app-specific data. It 
would push further the isolation of the services and improve the modularity 
of the whole project (by allowing to easily delete or add a service without 
impacting the others)
 
Do you think it is coherent with Django concepts ?
 
Thank you for your help
 
Regards,
Guillaume

-- 
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/2745d24c-8de4-4922-8ace-72feeb8fdfa8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Hi. i'm new to django, i have lot of doubts about AD

2016-08-25 Thread M Hashmi
What is your code and what you are trying to achieve?

On Thu, Aug 25, 2016 at 5:18 AM, rajeshkmr9583 
wrote:

> Hi guys,
> i'm new to django framework and now my doubt id how to create AD for
> login page
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/b866-4026-4f3d-9b0f-1840ab90a57a%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/CANoUts5tB%2B4E9yuyzHowB%2BXFkSx6rEQJkrFgkTt6np2v58L%2BzQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Different values for csrfmiddlewaretoken and csrftoken causing 403 errors in Django admin

2016-08-25 Thread lorcanoshea
Hi, I am trying to debug some 403 errors I am getting in the Django admin. 
When I have debug set to true, everything works fine, but when I have it 
set to false, I get a 403 CSRF verification failed response.  This is a 
superuser account which has all permissions so it shouldn't be related to 
that. 

I noticed that the csrfmiddlewaretoken and csrftoken values are always 
different, so I am wondering if that is why it is failing and any 
recommendations for how to debug what is causing this to happen? 

In case it's relevant, this project was working fine Django 1.4.6 for a 
long time, and I recently upgraded it to 1.9.9 which is when I started 
seeing these errors.

Any advice or tips for debugging this would be appreciated! Thank you

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/47740554-d308-4823-bbb9-4d54627c4158%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Isolate Django apps in different Docker containers

2016-08-25 Thread Christian Ledermann
On 25 August 2016 at 14:50, Guillaume Dupin  wrote:
> Hello,
>
> On a Django project (which will consist of several REST web services), I
> would like to isolate my services (each service would be a Django
> application) into different Docker containers to aim to a micro-services
> architecture. It will allow to benefit of Docker isolation to update
> independantly the different apps of the project and also to scale each
> service idependantly according to the load increase by using load-balancers
> in font of each group of services-containers (plus the numerous advantages
> brought by Docker).
> I understand that, by doing so, each container will run a Django server and
> that this different servers will surely have to share some data.
>
> First, do you think it is possible to do so ?
> I have searched examples of such architectural choice but I always found the
> use of Docker to encapsulate a Django project (one container for the server,
> one container for the DB for example) and never this idea of "one app per
> container" architecture.
> Do you think it is a valid approach ?

yes it is, you just need to setup more than one  django app container
and possibly several postgresql containers as well

> Has someone already tested such a solution ?
> One problem I identify is : will each Django server have to be aware of all
> the services or not ?

that is your design decision, if every servioce has dependencies to every
other service it  probably is a 'not so good' architecture. services should
have minimal dependencies.

> To go further, if the previous idea is valid, do you think it can be coupled
> with a separation of databases ? As Django can already manage different
> databases, I imagined that each application could use several databases : a
> common Django database (accesible from all the apps) for the generic data
> and a specific database for all the app-specific data.

Using a db as an integration point is not a good idea.

> It would push further
> the isolation of the services and improve the modularity of the whole
> project (by allowing to easily delete or add a service without impacting the
> others)
>
> Do you think it is coherent with Django concepts ?
>
> Thank you for your help
>
> Regards,
> Guillaume
>
> --
> 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/2745d24c-8de4-4922-8ace-72feeb8fdfa8%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Best Regards,

Christian Ledermann

Newark-on-Trent - UK
Mobile : +44 7474997517

https://uk.linkedin.com/in/christianledermann
https://github.com/cleder/


<*)))>{

If you save the living environment, the biodiversity that we have left,
you will also automatically save the physical environment, too. But If
you only save the physical environment, you will ultimately lose both.

1) Don’t drive species to extinction

2) Don’t destroy a habitat that species rely on.

3) Don’t change the climate in ways that will result in the above.

}<(((*>

-- 
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/CABCjzWotaGPGRgaT_JN2F%2Bmsw1G%2BrXM8bHbqmdTcyZQmyOR9ww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Attribute error, with a very basic banking app

2016-08-25 Thread Neil Hunt
I've beem working on a simple banking app based on the Django tutorial. 
Thanks to your help it almost works now. It was working using templates but 
after making some changes to get HttpResponseRedirect to work I changed 
what was in the urls file like it shows in the tutorial. Now, the server 
doesn't run. It says there's an attribute error. I've temporarily left the 
user name and password in at the moment. I had a look at their tutorial how 
to do a use the Django authentication system (thanks for telling me about 
that) and I'm going to change that after I understand what's going on here. 
It's amazing how much you can do with Django. Do you think with time you 
get more used to what different errors mean? The errors seem new and 
confusing to me at the moment. Any help would be very much appreciated. 
Thanks in advnace.

-- 
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/b30091ce-fcbf-461e-869e-bba72eb9dcfe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Title: Login
{% load staticfiles %}


 
 





{% csrf_token %}
Your details:

Username:

Password:







from django.shortcuts import get_object_or_404
from django.shortcuts import render
from django.http import HttpResponseRedirect, HttpResponse
from django.core.urlresolvers import reverse
#from django.template import loader
from django.views import generic

from .models import Person, Account1

# Create your views here.
def deposit(request):
	selected_rbox = request.POST.get('Account1')
	selected_rbox = request.POST.get('Account2')
	selected_amount = request.POST.get('Amount')
	person = Person
	account1 = Account1
	context = {'account1':account1,'person':person}
	template = loader.get_template('banking/deposit.html')
	return HttpResponse(template.render(context,request))

def hello(request):
	person = Person
	account1 = Account1
	context = {'account1':account1,'person':person}
	#template = loader.get_template('banking/login.html')
	#return HttpResponse(template.render(context,request))
	return render(request, 'banking/login.html')
	#return render(request, 'banking/login.html', {
	#	'person': person,
	#	'error_message': "You didn't select a choice.",
#	})
	
def login(request):
	#account1 = get_object_or_404(Account1) 
	#person = get_object_or_404(Person) 
	account1 = Account1
	person = Person 
	try:
		selected_login = request.POST.get('login')
		selected_username = request.POST.get('username')
		#selected_login = person.choice_set.get(pk=request.POST['login'])
		#selected_password = person.choice_set.get(pk=request.POST['password'])

	# What is Choice object doing in the line below?
	#except (KeyError, Choice.DoesNotExist):
	except (KeyError, Account1.DoesNotExist):
	#except (KeyError, Account1.DoesNotExist):
# Redisplay the question voting form.
		#account1 = get_object_or_404(Account1) 
		#person = get_object_or_404(Person) 
		#person = Person
		#account1 = Account1
		#return render(request, 'banking/login.html', {
	#'person': person,
	#'error_message': "You didn't select a choice.",
		#return render(request, 'banking/login.html')
		return render(request, 'banking/login.html', {
		'person': person,
		'error_message': "You didn't select a choice.",
	})

		#person = Person
		#account1 = Account1
		#context = {'account1':account1,'person':person}
		#template = loader.get_template('banking/login.html')
		#return HttpResponse(template.render(context,request)
	else:
	# Always return an HttpResponseRedirect after successfully dealing
	# with POST data. This prevents data from being posted twice if a
	# user hits the Back button.
		#person = Person
		#account1 = Account1
		#context = {'account1':account1,'person':person}
		#template = loader.get_template('banking/welcome.html')
		#return HttpResponse(template.render(context,request))
		return HttpResponseRedirect(reverse('banking:welcome'))


def transfer(request):
	person = Person
	account1 = Account1
	context = {'account1':account1,'person':person}
	template = loader.get_template('banking/transfer.html')
	return HttpResponse(template.render(context,request))

def welcome(request):
	person = Person
	account1 = Account1
	context = {'account1':account1,'person':person}
	template = loader.get_template('banking/welcome.html')
	return HttpResponse(template.render(context,request))

def withdraw(request):
	person = Person
	account1 = Account1
	context = {'account1':account1,'person':person}
	template = loader.get_template('banking/withdraw.html')
	return HttpResponse(template.render(context,request))
from django.c

Re: Attribute error, with a very basic banking app

2016-08-25 Thread ludovic coues
Could you share the full stack trace you get when trying to run the server ?
The attribute error should come with a ton of information like the
file and the line where the error occur.

2016-08-25 16:57 GMT+02:00 Neil Hunt :
> I've beem working on a simple banking app based on the Django tutorial.
> Thanks to your help it almost works now. It was working using templates but
> after making some changes to get HttpResponseRedirect to work I changed what
> was in the urls file like it shows in the tutorial. Now, the server doesn't
> run. It says there's an attribute error. I've temporarily left the user name
> and password in at the moment. I had a look at their tutorial how to do a
> use the Django authentication system (thanks for telling me about that) and
> I'm going to change that after I understand what's going on here. It's
> amazing how much you can do with Django. Do you think with time you get more
> used to what different errors mean? The errors seem new and confusing to me
> at the moment. Any help would be very much appreciated. Thanks in advnace.
>
> --
> 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/b30091ce-fcbf-461e-869e-bba72eb9dcfe%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Coues Ludovic
+336 148 743 42

-- 
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/CAEuG%2BTa-x_Dq3_JY68WP%3DPAqdR9QG5HQBuN6zX82fzP9eEK4vQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


What is this? CASCADE clausule on DROP COLUMN???

2016-08-25 Thread RompePC
I did a migration of Django, and then applied a *sqlmigrate*, giving me 
this output...

BEGIN;
--
-- Remove field my_column from my_table
--
ALTER TABLE `my_table` DROP COLUMN `my_column` CASCADE;

I don't find info about it, and I've never seen something like this in my 
MySQL experience. And the best part is that works (although it is marked as 
a syntax error). Can anyone throw me some light about it?

-- 
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/bc12f7b0-2cb6-4ac8-943d-7cd057343050%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Attribute error, with a very basic banking app

2016-08-25 Thread Neil Hunt
Thanks for your speedy reply, I've attached the stack trace

On Thursday, August 25, 2016 at 4:00:16 PM UTC+1, ludovic coues wrote:
>
> Could you share the full stack trace you get when trying to run the server 
> ? 
> The attribute error should come with a ton of information like the 
> file and the line where the error occur. 
>
> 2016-08-25 16:57 GMT+02:00 Neil Hunt >: 
> > I've beem working on a simple banking app based on the Django tutorial. 
> > Thanks to your help it almost works now. It was working using templates 
> but 
> > after making some changes to get HttpResponseRedirect to work I changed 
> what 
> > was in the urls file like it shows in the tutorial. Now, the server 
> doesn't 
> > run. It says there's an attribute error. I've temporarily left the user 
> name 
> > and password in at the moment. I had a look at their tutorial how to do 
> a 
> > use the Django authentication system (thanks for telling me about that) 
> and 
> > I'm going to change that after I understand what's going on here. It's 
> > amazing how much you can do with Django. Do you think with time you get 
> more 
> > used to what different errors mean? The errors seem new and confusing to 
> me 
> > at the moment. Any help would be very much appreciated. Thanks in 
> advnace. 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Django users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to django-users...@googlegroups.com . 
> > To post to this group, send email to django...@googlegroups.com 
> . 
> > Visit this group at https://groups.google.com/group/django-users. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/django-users/b30091ce-fcbf-461e-869e-bba72eb9dcfe%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>
>
>
> -- 
>
> Cordialement, Coues Ludovic 
> +336 148 743 42 
>

-- 
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/b9b247a9-830d-4cc0-a441-5a8013899f13%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


tracext
Description: Binary data


Re: Attribute error, with a very basic banking app

2016-08-25 Thread Andromeda Yelton
The stacktrace is helpful, thanks!

The specific message with the AttributeError is helpful here:
`AttributeError: 'module' object has no attribute 'DepositView'`

The line above it is `  File
"/home/soupdragon/DJapps/banking/mybank/banking/urls.py", line 8, in

url(r'^deposit/$', views.DepositView.as_view(), name='deposit'),`

So I checked to see if your views.py contains anything named
DepositView...and it does not. That's why the AttributeError is showing up.

The `DepositView.as_view()` syntax is suitable for class-based views, which
means I expect to see something in your views.py to the effect of:

class DepositView(View):
  def post(self, request, *args, **kwargs):
// the logic in your deposit() function actually belongs here

Have a look at the class-based views documentation to see what the
different classes are, and what options they provide you.

Alternately, your urls.py could reference views.deposit (which does exist)
instead of views.DepositView (which does not).

Hope this helps!

On Thu, Aug 25, 2016 at 11:14 AM, Neil Hunt  wrote:

> Thanks for your speedy reply, I've attached the stack trace
>
> On Thursday, August 25, 2016 at 4:00:16 PM UTC+1, ludovic coues wrote:
>>
>> Could you share the full stack trace you get when trying to run the
>> server ?
>> The attribute error should come with a ton of information like the
>> file and the line where the error occur.
>>
>> 2016-08-25 16:57 GMT+02:00 Neil Hunt :
>> > I've beem working on a simple banking app based on the Django tutorial.
>> > Thanks to your help it almost works now. It was working using templates
>> but
>> > after making some changes to get HttpResponseRedirect to work I changed
>> what
>> > was in the urls file like it shows in the tutorial. Now, the server
>> doesn't
>> > run. It says there's an attribute error. I've temporarily left the user
>> name
>> > and password in at the moment. I had a look at their tutorial how to do
>> a
>> > use the Django authentication system (thanks for telling me about that)
>> and
>> > I'm going to change that after I understand what's going on here. It's
>> > amazing how much you can do with Django. Do you think with time you get
>> more
>> > used to what different errors mean? The errors seem new and confusing
>> to me
>> > at the moment. Any help would be very much appreciated. Thanks in
>> advnace.
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups
>> > "Django users" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> an
>> > email to django-users...@googlegroups.com.
>> > To post to this group, send email to django...@googlegroups.com.
>> > Visit this group at https://groups.google.com/group/django-users.
>> > To view this discussion on the web visit
>> > https://groups.google.com/d/msgid/django-users/b30091ce-fcbf
>> -461e-869e-bba72eb9dcfe%40googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>>
>> Cordialement, Coues Ludovic
>> +336 148 743 42
>>
> --
> 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/b9b247a9-830d-4cc0-a441-5a8013899f13%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Andromeda Yelton
Vice President/President-Elect, Library & Information Technology
Association: http://www.lita.org
http://andromedayelton.com
@ThatAndromeda 

-- 
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/CAFE1XCbjKrqcXNmF2wUZottJLJr37SabJdq5ihZpWGiUiCLNDg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: What is this? CASCADE clausule on DROP COLUMN???

2016-08-25 Thread Erik Cederstrand

> Den 25. aug. 2016 kl. 17.09 skrev RompePC :
> 
> I did a migration of Django, and then applied a sqlmigrate, giving me this 
> output...
> 
> BEGIN;
> --
> -- Remove field my_column from my_table
> --
> ALTER TABLE `my_table` DROP COLUMN `my_column` CASCADE;
> 
> I don't find info about it, and I've never seen something like this in my 
> MySQL experience. And the best part is that works (although it is marked as a 
> syntax error). Can anyone throw me some light about it?

Are you using MySQL as your backend? I believe that syntax is only for 
postgresql. CASCADE defines what to do if anything outside the table references 
the column. CASCADE will drop these references.

Erik

-- 
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/809BE9C3-9AAD-43B5-818F-D1E6AA3E1ADB%40cederstrand.dk.
For more options, visit https://groups.google.com/d/optout.


Re: What is this? CASCADE clausule on DROP COLUMN???

2016-08-25 Thread RompePC
Hi,

I searched for it, and looks like Django uses a general schema constants 
for common commands (like *ALTER*). It is stored inside a class, which is 
the parent class of the rest of the RDBMS schemas. And it isn't replaced, 
so it justs assumes the value of the parent.

More info https://github.com/django/django/tree/master/django/db/backends . 
Search in *base/schema.py* and *mysql/schema.py*

Would be nice if some could do a pull request modifying the command for 
MySQL, only to not get the error syntax (it is just a negative trim).

El jueves, 25 de agosto de 2016, 18:19:54 (UTC+2), Erik Cederstrand 
escribió:
>
>
> > Den 25. aug. 2016 kl. 17.09 skrev RompePC  >: 
> > 
> > I did a migration of Django, and then applied a sqlmigrate, giving me 
> this output... 
> > 
> > BEGIN; 
> > -- 
> > -- Remove field my_column from my_table 
> > -- 
> > ALTER TABLE `my_table` DROP COLUMN `my_column` CASCADE; 
> > 
> > I don't find info about it, and I've never seen something like this in 
> my MySQL experience. And the best part is that works (although it is marked 
> as a syntax error). Can anyone throw me some light about it? 
>
> Are you using MySQL as your backend? I believe that syntax is only for 
> postgresql. CASCADE defines what to do if anything outside the table 
> references the column. CASCADE will drop these references. 
>
> Erik

-- 
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/1321-fe59-4e65-8b9e-630e5d581c09%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Attribute error, with a very basic banking app

2016-08-25 Thread Neil Hunt
Thank you so much Andromeda. I didn't know you could use class based views.
I'll have a look at the documents. I don't know why I was trying to use
them when I didn't need to.

On Thu, Aug 25, 2016 at 4:23 PM, Andromeda Yelton <
andromeda.yel...@gmail.com> wrote:

> The stacktrace is helpful, thanks!
>
> The specific message with the AttributeError is helpful here:
> `AttributeError: 'module' object has no attribute 'DepositView'`
>
> The line above it is `  File "/home/soupdragon/DJapps/
> banking/mybank/banking/urls.py", line 8, in 
> url(r'^deposit/$', views.DepositView.as_view(), name='deposit'),`
>
> So I checked to see if your views.py contains anything named
> DepositView...and it does not. That's why the AttributeError is showing up.
>
> The `DepositView.as_view()` syntax is suitable for class-based views,
> which means I expect to see something in your views.py to the effect of:
>
> class DepositView(View):
>   def post(self, request, *args, **kwargs):
> // the logic in your deposit() function actually belongs here
>
> Have a look at the class-based views documentation to see what the
> different classes are, and what options they provide you.
>
> Alternately, your urls.py could reference views.deposit (which does exist)
> instead of views.DepositView (which does not).
>
> Hope this helps!
>
> On Thu, Aug 25, 2016 at 11:14 AM, Neil Hunt  wrote:
>
>> Thanks for your speedy reply, I've attached the stack trace
>>
>> On Thursday, August 25, 2016 at 4:00:16 PM UTC+1, ludovic coues wrote:
>>>
>>> Could you share the full stack trace you get when trying to run the
>>> server ?
>>> The attribute error should come with a ton of information like the
>>> file and the line where the error occur.
>>>
>>> 2016-08-25 16:57 GMT+02:00 Neil Hunt :
>>> > I've beem working on a simple banking app based on the Django
>>> tutorial.
>>> > Thanks to your help it almost works now. It was working using
>>> templates but
>>> > after making some changes to get HttpResponseRedirect to work I
>>> changed what
>>> > was in the urls file like it shows in the tutorial. Now, the server
>>> doesn't
>>> > run. It says there's an attribute error. I've temporarily left the
>>> user name
>>> > and password in at the moment. I had a look at their tutorial how to
>>> do a
>>> > use the Django authentication system (thanks for telling me about
>>> that) and
>>> > I'm going to change that after I understand what's going on here. It's
>>> > amazing how much you can do with Django. Do you think with time you
>>> get more
>>> > used to what different errors mean? The errors seem new and confusing
>>> to me
>>> > at the moment. Any help would be very much appreciated. Thanks in
>>> advnace.
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> Groups
>>> > "Django users" group.
>>> > To unsubscribe from this group and stop receiving emails from it, send
>>> an
>>> > email to django-users...@googlegroups.com.
>>> > To post to this group, send email to django...@googlegroups.com.
>>> > Visit this group at https://groups.google.com/group/django-users.
>>> > To view this discussion on the web visit
>>> > https://groups.google.com/d/msgid/django-users/b30091ce-fcbf
>>> -461e-869e-bba72eb9dcfe%40googlegroups.com.
>>> > For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>>
>>> --
>>>
>>> Cordialement, Coues Ludovic
>>> +336 148 743 42
>>>
>> --
>> 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/ms
>> gid/django-users/b9b247a9-830d-4cc0-a441-5a8013899f13%40googlegroups.com
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Andromeda Yelton
> Vice President/President-Elect, Library & Information Technology
> Association: http://www.lita.org
> http://andromedayelton.com
> @ThatAndromeda 
>
> --
> 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/vXAou_bCuhE/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/CAFE1XCbjKrqcXNmF2wUZottJLJr37
> SabJd

how to configure django to use TLS/SSL for db auth in configuration.py

2016-08-25 Thread johny casanova
helo,

in my organization we have to use TLS/SSL for everything. I have set up my 
postgresql db to use the certs and ciphers I need. Now I need to configure 
my configuration.py to authentication using certs and TLS/SSL and not a 
user/pass combo. How do I go about that?


this is what I got

DATABASE = {
'NAME': 'netbox',   # Database name
'USER': 'netbox',   # PostgreSQL username
'PASSWORD': 'J5brHrAXFLQSif0K', # PostgreSQL password
'HOST': 'localhost',# Database server
'PORT': '', # Database port (leave blank for default)


-- 
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/05a2fd20-47d5-4a86-a4c7-5ef6e17d6b1a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.