online training application

2017-09-27 Thread Mike Dewhirst
I need to write an online training application - except I don't know a 
lot about online training.


Do you know more than me? Have you written something you might share?

It sort of feels a bit like Mezzanine.

The training material exists and the students are somewhat used to 
powerpoint or video instruction followed by an associated questionnaire 
per piece of instruction. The organisation needs to know how successful 
each student is after absorbing the training.


I can see a question model with an image and a couple of text fields to 
contain the training information which needs to be absorbed by the 
student plus the question(s) which the student must answer.


Then I can see an answer model with fk to question. Maybe it needs to be 
a generic/abstract answer model because some answers will be multiple 
choice, some will be numeric and who knows what other data will be involved.


Obviously there will need to be a correct_answer model which the student 
never sees.


Hope there is someone who has done it already.

Thanks for any ideas

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 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/be8e7ce3-a772-65b4-1be3-94b46cba2b7a%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


django.urls.exceptions.NoReverseMatch: Reverse for 'index' not found. 'index' is not a valid view function or pattern name.

2017-09-27 Thread harsh sharma
i m a noob in django And i dont know why i am getting this error

my views.py file:

from django.shortcuts import render,render_to_response
from django.http import HttpResponse
from all.models import ALL
from django.template import RequestContext
# Create your views here.
def home(request):
return render(request, 'index.html', {'ne': ne})


def technology(request):
return HttpResponse('hello')

def index(request):
assert isinstance(request , HttpResponse)

return render(request, 'index.html') . 

my url file

url(r'^$', all.views.index),
url(r'^technology', all.views.index),
url(r'^index$', all.views.home),
url(r'^admin/', admin.site.urls),
]

-- 
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/41876d02-56e0-48c8-8722-17fc08ed32f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Any django reusable app for outdoor & indoor location, GPS tracking?

2017-09-27 Thread Lee Hinde
Regarding developing over https….

https://ngrok.com/ 

is a great tool when you want to use https locally.


> On Sep 27, 2017, at 12:35 PM, Jani Tiainen  wrote:
> 
> Hi.
> 
> To my knowledge there isn't one since we implemented our own tracker.
> 
> If you're going to build one I do have few pointers that you should consider.
> 
> Recent browser changes requires that location data is transferred over https. 
> I think chrome was first one to require it. That makes developing it a bit 
> challenging.
> 
> Raw coordinate data isn't that good since there is constant deviation in 
> coordinates. You'll need to pick some smoothing algorithm. Don't remember top 
> if my head what we use but I can check that when I go to work.
> 
> And then you need to have a background map. And that's the tricky part...
> 
> 26.9.2017 13.14 "'Federico Capoano' via Django users" 
> > 
> kirjoitti:
> Hi everyone,
> 
> before building my own reusable app all over again, I wanted to ask here if 
> there is any reusable django app that does indoor location and or GPS 
> tracking.
> I'm not looking for something full featured, but rather a starting point to 
> which I can contribute to.
> 
> Best regards
> Federico Capoano
> 

-- 
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/0667A36B-BA19-4302-A1EA-93AEB35E4F62%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Any django reusable app for outdoor & indoor location, GPS tracking?

2017-09-27 Thread Jani Tiainen
Hi.

To my knowledge there isn't one since we implemented our own tracker.

If you're going to build one I do have few pointers that you should
consider.

Recent browser changes requires that location data is transferred over
https. I think chrome was first one to require it. That makes developing it
a bit challenging.

Raw coordinate data isn't that good since there is constant deviation in
coordinates. You'll need to pick some smoothing algorithm. Don't remember
top if my head what we use but I can check that when I go to work.

And then you need to have a background map. And that's the tricky part...

26.9.2017 13.14 "'Federico Capoano' via Django users" <
django-users@googlegroups.com> kirjoitti:

> Hi everyone,
>
> before building my own reusable app all over again, I wanted to ask here
> if there is any reusable django app that does indoor location and or GPS
> tracking.
> I'm not looking for something full featured, but rather a starting point
> to which I can contribute to.
>
> Best regards
> Federico Capoano
>
> --
> 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/5add2c0f-3a30-46ea-91b8-c02f01d2ad5e%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/CAHn91odd5dw2JWhay-Ay%3DNifhpHerQ%2BzMT_sCPxam%2B9vxj7E9g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


override default "go back" action on a web page to go back to main menu

2017-09-27 Thread fábio andrews rocha marques
Let's say i have a "register a new user" View and on this page, when the 
user forgets to inform a password or a username, i show a message to him on 
the same page saying "you forgot the password". The way i do this is by 
doing this(on my View.py in a function called cadastrarprofessor):

nomeusuario = request.POST['usuario'] #username
nomesenha = request.POST['senha'] #password
nomeemail = request.POST['email'] #email

if not nomeusuario:
return render(request,'cadastro.html',{'cadastrorealizadocomsucesso': 
False, 'error_message': "informe um usuário", 
'nomeemailcadastro':nomeemail, 'nomesenhacadastro':nomesenha})
elif not nomesenha:
return render(request,'cadastro.html',{'cadastrorealizadocomsucesso': 
False, 'error_message': "informe uma senha", 'nomeemailcadastro':nomeemail, 
'nomeusuariocadastro':nomeusuario})
elif not nomeemail:
return render(request,'cadastro.html',{'cadastrorealizadocomsucesso': 
False, 'error_message': "informe um email", 'nomesenhacadastro':nomesenha, 
'nomeusuariocadastro':nomeusuario})

And my template for this page(cadastro.html) is like this:

Cadastro

{% csrf_token %}
Usuário: 
{% if nomeusuariocadastro %}

{% else %}

{% endif %}


... (DO THE SAME TO SENHA/PASSWORD AND EMAIL)





{% csrf_token %}

{% if cadastrorealizadocomsucesso is True %}cadastro realizado com 
sucesso!{% endif %}
{% if error_message %}{{ error_message }}{% endif %}

So, every time the user forgets to mention a username or email or password 
in this screen, i use render to redirect the user to the same page but this 
time displaying a error_message. Let's say he did forget to fill the 
textfield with a username... he goes back to the same page and sees the 
error message. After that, let's say everything is right and he finally 
registers a new user, he sees "cadastro realizado com sucesso"(sucessfully 
registered new user) and stays on the same page. But when he goes back a 
page, instead of going back to the page before the cadastro.html, he goes 
back to the same page cadastro.html but displaying the error message for 
the "you forgot to mention your username". I don't want him to go back to 
the same page with error message, i want to make him go back to my main 
menu. 
Is there any way to override the current page "go back" action? Is there a 
better approach to display error messages on the same page instead of using:
return render(request,'cadastro.html',{'cadastrorealizadocomsucesso': False, 
'error_message': "informe um usuário", 'nomeemailcadastro':nomeemail, 
'nomesenhacadastro':nomesenha})
?




-- 
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/c6a0809a-21e4-4af8-b674-b8ae27f724c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: utf-8' codec can't decode byte 0x93 in position 31 even though i use read().decode('utf-8') when i read a UploadedFile i get from a file selector in a View in django

2017-09-27 Thread fábio andrews rocha marques
I've managed to solve it! The problem wasn't on the csv, but on those 
"print" i used. It turns out command prompt on windows 8 can't print 
japanese letters. So, 'i've solved it by printing the output to a file 
instead of a command prompt

-- 
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/ea9693b9-bc52-4c25-a278-577c23e45321%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


1.9 - GET requests without Content-Type specified given text/plain content type

2017-09-27 Thread peter . marsh
Hi,

If I'm running my app locally with ./manage.py runserver when I make a GET 
request without specifying a Content-Type header the request object in 
django has request.META['CONTENT_TYPE'] == 'text/plain'.

I can't for the life of me work out where this is coming from, I'm 
reasonably sure the GET request I send is not defaulting to adding a 
Content-Type header with the value of text/plain (I have tried the GET 
request using python-requests and the Postman chrome extension, same 
behaviour in both cases), and it does not appear to be the value of 
DEFAULT_CONTENT_TYPE as I changed that to something other than text/plainn 
and my GET requests still had a request.META['CONTENT_TYPE'] == 
'text/plain'.

Is this the expected behaviour? Is there any way to stop it?

Cheers,

Pete 

-- 
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/44596b8f-3c3e-4056-be0b-a6cf2288fc9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Encrypt Directory in Django

2017-09-27 Thread Mannu Gupta
I am trying to save a customer generated report in pdf format. I have used 
django file field to store the pdf. 

"models.FileField(upload_to='directory/pdfdirectory')"

Since it will be user-generated pdf and will be different for each user, 

Also along with making a custom subdirectory for every user (one encrypted 
folder per user), there may be multiple files within that.

Link if there are 100 users then all that 100 subdirectories should be 
encrypted.

What might be best possible way to implement the encryption part ?

Thanks in advance !

-- 
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/278347b3-4ec9-411c-b7ae-58f4ac7ed30e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Auth Password Change template not working

2017-09-27 Thread naitik gala
Hi all,

I am trying to add my own designed html to Auth urls.

One way obviously is to create my own view and implement Auth urls for 
them. Here, I will explicitly mention the html template that i have 
created. It would be like any other view that we would create.

But, there seems to be an alternate method. We can reuse the views already 
created in Auth module. 

By reference of documentations, I made following steps:

1. created an html template 
'myproject/myapp/templates/registration/login.html'
2. updated 'myproject/myproject/urls.py' with following

urlpatterns = [
url(r'^admin/', admin.site.urls),
url('', include('django.contrib.auth.urls')),
url(r'^', include('myapp.urls')),
]

This successfully worked for /login/ i.e. it showed my custom template.

It however now fails if I created for /password_change/ as i created 2 
files for that 
'myporject/myapp/templates/registration/password_change_form.html' and 
'myporject/myapp/templates/registration/password_change_done.html'

Is this a bug or I am missing something? Please help.

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


Re: SMTPAuthenticationError sending email via smtp.gmail

2017-09-27 Thread rahul kumar

>
> It is because Google blocks sign-in attempts from apps which do not use 
> modern security standards (mentioned on their support page). You can 
> however, turn on/off this safety feature by going to the link below:
>
> Go to this link and select Turn On
>
 

> https://www.google.com/settings/security/lesssecureapps
>

more on...smtp mail  

-- 
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/80b0a33b-8e7a-4178-a8ad-83c342b97a48%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Having a hard time installing Graphite on Windows 7

2017-09-27 Thread rym . faleh . spectrum
Hello nate, i'm having a hard installing graphite on windows too, i was 
wondering if you manage to make it work ? if you do, please could you 
provide me with the exact steps for the installation.
thank you 

Le samedi 12 juillet 2014 19:24:49 UTC+2, nate dingo a écrit :
>
> I am following the instruction on this document.
>
>
> http://www.s2-industries.com/wordpress/2013/01/running-graphite-webapp-on-windows
>
>
>
>- Install Python 2.7 (as mentioned in the other blog post)
>- Install PyPi (as mentioned in the other blog post)
>- Install PythonGTK+ (for Cairo graphics) from here 
>
> 
>- Install Django using a package from here 
>. In my case, I used Django 
>1.4.2. Drop me a message if Graphite WebApp also works with newer versions 
>of Django. 
>- Install twisted using: 
>
>pip install Twisted
>
>- Install zope.interface using: 
>
>pip install zope.interface
>
>
> Then where do I go? I have also installed GitHub and Pycairo, and 
> "pygtk-all-in-one-2.24.0.win32-py2.7(2).msi"
>
> Whisper scripts are in my python27/scripts but carbon and web-apps produce 
> error messages when I try to load them using:
>
> git clone https://github.com/graphite-project/graphite-web.git
> git clone https://github.com/graphite-project/carbon.git
> git clone https://github.com/graphite-project/whisper.git
>
>
> Am I even in the ball park?
>
> Thanks
> Nate
>

-- 
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/2508ca5e-1e74-43f0-96b4-e165bd4a1531%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Practitioners' Knowledge and Experience about Different Architectural Viewpoints

2017-09-27 Thread Mert Ozkaya
 

We are currently conducting a survey for understanding practitioners' 
knowledge and experience about different architectural viewpoints that 
represent the different aspects of software systems on which a set of 
relevant design decisions can be defined. These viewpoints are logical, 
physical, deployment, behaviour, and concurrency viewpoints.

 

The survey takes approximately 5 to 15 minutes to complete (Almost all 
questions are radio buttons/checkboxes). Your participation is highly 
appreciated and will be invaluable for us.

The survey link: https://goo.gl/forms/LjyORftpSI6wdCbd2

-- 
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/f1df80f4-675c-43d4-9553-a8d84fb515a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: {% csrf_token %}

2017-09-27 Thread Chris Wedgwood
Hi Alex

Try this:

return render_to_string('home.html', request=request)

cheers
Chris



On Tuesday, 26 September 2017 18:29:15 UTC+1, Alex Kleider wrote:
>
> I'm using test driven development (going through Harry J.W. Percival's 
> book) and have found that the following code fails because the template tag 
> ( {% csrf_token %} ) is rendered by the home_page view function but not by 
> the django.template.loader.render_to_string function (and so the 
> assertEqual test fails.)
>
> ...templates/home.html:
> ...
> 
>  id="id_new_entity" 
> place_holder="Pick a name for your new entity." /> 
> {% csrf_token %}
>  
> ...
>
> Testing code:
>
> def test_home_page_returns_correct_html(self):
> request = HttpRequest()
> response = home_page(request)
> returned_html = response.content.decode()
> expected_html = render_to_string('home.html')
> self.assertEqual(returned_html , expected_html)
>
> returned_html and expected_html are the same except that returned_html 
> contains the following line (and the other doesn't:)
>  value='Ev0j62rUtwdpOwjS5FN7B1VT38hE75W0JVZUJQy8IpcvzTH0MCexoRSpQvofoDoW' />
> Infact, expected_html doesn't even contain the
> {% csrf_token %}
> line.
>
> Can anyone suggest a work around?
> Thanks in advance.
>
>

-- 
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/4ff3ff89-f6ac-4e82-8d54-964be94e383c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.