template drop down menu

2017-06-05 Thread sum abiut
Hi,
need some directions, i need to query the my database and display the
result of the query in the table. to do that i want to use a drop down menu
and get the users to select options from the drop menu on the template.

for example if a user select a word from the drop down menu i want to
filter and query the database base on the option that is selected and then
display the result.

I am confuse on the template side. on the template side how to i know if a
user select a particular option from the drop down before so that i can
perform query base on option that was selected from the template and
display query result base on the respective word that was select.

Cheers,

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


Re: Installing Django in Window 10

2017-06-05 Thread Nandan Priyadarshi
Hi .. 
Django is Installed.
I want to create API with Django with Cassandra DB.. 
I just want respected steps. 
Thanks. 
On Tuesday, 6 June 2017 11:37:24 UTC+8, Hemhem wrote:
>
> Are you sure you don't already have Django installed?
>
> Try to import Django from your Python prompt and see what happens.
>
> If it doesn't throw any error, you have it. If it does, you can do
>
> pip install Django
>
> That should install it.
>
> On Jun 5, 2017 9:11 PM, "Nandan Priyadarshi"  > wrote:
>
>> Hi , 
>>
>> I am using* Windows 10, 64-bit system. Using Anaconda for Python with 
>> 3.6 version. *
>>
>> C:\Users\nandan>python
>>> Python 3.6.0 |Anaconda 4.3.0 (64-bit)| (default, Dec 23 2016, 11:57:41) 
>>> [MSC v.1900 64 bit (AMD64)] on win32
>>> Type "help", "copyright", "credits" or "license" for more information.
>>> >>>
>>
>>  
>> Please guide me *how to install Django*. In future, *I want to use 
>> Django with Apache Cassandra to create RestFul API*. 
>> Looking forward to spending a great time with this community. 
>>
>> Thanks and Regards, 
>> Nandan
>>
>> -- 
>> 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/5587c373-b522-4a22-8e80-e6613e28d422%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/dbd998c0-0252-4313-8121-ca75e92fd5e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Installing Django in Window 10

2017-06-05 Thread Oladipupo Elegbede
Are you sure you don't already have Django installed?

Try to import Django from your Python prompt and see what happens.

If it doesn't throw any error, you have it. If it does, you can do

pip install Django

That should install it.

On Jun 5, 2017 9:11 PM, "Nandan Priyadarshi" 
wrote:

> Hi ,
>
> I am using* Windows 10, 64-bit system. Using Anaconda for Python with 3.6
> version. *
>
> C:\Users\nandan>python
>> Python 3.6.0 |Anaconda 4.3.0 (64-bit)| (default, Dec 23 2016, 11:57:41)
>> [MSC v.1900 64 bit (AMD64)] on win32
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>>
>
>
> Please guide me *how to install Django*. In future, *I want to use Django
> with Apache Cassandra to create RestFul API*.
> Looking forward to spending a great time with this community.
>
> Thanks and Regards,
> Nandan
>
> --
> 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/5587c373-b522-4a22-8e80-e6613e28d422%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/CAHjgLX7AV2063on31Kt-i%2BHOtPML0keV-M2S-99ETaSH-fo56Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Same tutorial different day

2017-06-05 Thread James Schneider
On Jun 5, 2017 7:27 PM, "Lachlan Musicman"  wrote:

I think your mysite/urls.py needs an

import polls


Ah, yes. This is the other common issue with the tutorial. Many of the code
blocks omit the necessary import statements to keep the examples easier to
read. The expectation is that the reader has at least a basic understanding
of Python and how it references other libraries. Admittedly, they are easy
to forget.

-James

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2Be%2BciW46V3%3D5-CUFqR3kKRA0tz7AYVPE0AsHymB_vqbXQ83mA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Same tutorial different day

2017-06-05 Thread James Schneider
On Jun 5, 2017 6:50 PM,  wrote:

I was attempting the tutorial titled "Writing your first Django app".  The
tutorial appears to be very simple, but it does not seem to work.  I have
frustrated myself by attempting to do it from scratch after failing last
week.  If I could get this app to work I could fix the tutorial for you.
It looks like a lot of people have similar gripes about the directions not
working.

I get errors like ModuleNotFoundError: No module named 'polls'


In most cases, this error is a result of missing the INSTALLED_APPS setting
change here:

https://docs.djangoproject.com/en/1.11/intro/tutorial02/#activating-models

Note that Django has an active community and that any errors in the
tutorial would likely be flagged and fixed quickly.

I would like to see a 'common mistakes and errors' section added to the
tutorial for troubleshooting help.


# Create your views here.


def index(request):

return HttpResponse("Hello, Mothers F


Please be cognizant of the code you are copying to a public list in the
future.

-James

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


Re: Same tutorial different day

2017-06-05 Thread Lachlan Musicman
I think your mysite/urls.py needs an

import polls



--
"Mission Statement: To provide hope and inspiration for collective action,
to build collective power, to achieve collective transformation, rooted in
grief and rage but pointed towards vision and dreams."

 - Patrisse Cullors, *Black Lives Matter founder*

On 6 June 2017 at 04:24,  wrote:

> I was attempting the tutorial titled "Writing your first Django app".  The
> tutorial appears to be very simple, but it does not seem to work.  I have
> frustrated myself by attempting to do it from scratch after failing last
> week.  If I could get this app to work I could fix the tutorial for you.
> It looks like a lot of people have similar gripes about the directions not
> working.
>
> I get errors like ModuleNotFoundError: No module named 'polls'
>
> my directory structure looks like this :
>
> /home/me/parent/mysite/
>db.sqlite3
>manage.py
>mysite/
>
> /home/me/parent/mysite/mysite/
>__init__.py
>polls/
>settings.py
>urls.py
>wsgi.py
>
> the content of urls.py is :
>
> from django.conf.urls import include, url
>
> from django.contrib import admin
>
>
> urlpatterns = [
>
> url(r'^polls/', include('polls.urls')),
>
> url(r'^admin/', admin.site.urls),
>
> ]
>
>
> /home/me/parent/mysite/mysite/polls/
>__init__.py
>admin.py
>apps.py
>migrations
>models.py
>tests.py
>urls.py
>views.py
>
> the content of urls.py is :
>
> from django.conf.urls  import url
>
>
> from . import views
>
>
> urlpatterns = [
>
> url(r'^$', views.index, name='index'),
>
> ]
>
>
>
>
> the content of views.py is :
>
>
> from django.shortcuts import render
>
> from django.http import HttpResponse
>
>
>
> # Create your views here.
>
>
> def index(request):
>
> return HttpResponse("Hello, Mothers Fuckers!  You're at the polls
> index!")
>
>
>
> So can somebody please tell me why I get ModuleNotFoundError: No module
> named 'polls'.
>
>
>
> --
> 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/09c07d79-bcbf-4451-9d73-9d7189e66dfc%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/CAGBeqiOt3pQ1ONAYwH%2BLqaDBLPRZ_EHLnhOU1eorRU-i58SwoQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Installing Django in Window 10

2017-06-05 Thread Nandan Priyadarshi
Hi , 

I am using* Windows 10, 64-bit system. Using Anaconda for Python with 3.6 
version. *

C:\Users\nandan>python
> Python 3.6.0 |Anaconda 4.3.0 (64-bit)| (default, Dec 23 2016, 11:57:41) 
> [MSC v.1900 64 bit (AMD64)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>>

 
Please guide me *how to install Django*. In future, *I want to use Django 
with Apache Cassandra to create RestFul API*. 
Looking forward to spending a great time with this community. 

Thanks and Regards, 
Nandan

-- 
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/5587c373-b522-4a22-8e80-e6613e28d422%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Same tutorial different day

2017-06-05 Thread kitico
I was attempting the tutorial titled "Writing your first Django app".  The 
tutorial appears to be very simple, but it does not seem to work.  I have 
frustrated myself by attempting to do it from scratch after failing last 
week.  If I could get this app to work I could fix the tutorial for you. 
 It looks like a lot of people have similar gripes about the directions not 
working.

I get errors like ModuleNotFoundError: No module named 'polls'

my directory structure looks like this : 

/home/me/parent/mysite/
   db.sqlite3
   manage.py
   mysite/

/home/me/parent/mysite/mysite/
   __init__.py
   polls/
   settings.py
   urls.py
   wsgi.py

the content of urls.py is : 

from django.conf.urls import include, url

from django.contrib import admin


urlpatterns = [

url(r'^polls/', include('polls.urls')),

url(r'^admin/', admin.site.urls),

]


/home/me/parent/mysite/mysite/polls/
   __init__.py
   admin.py
   apps.py
   migrations
   models.py
   tests.py
   urls.py
   views.py
  
the content of urls.py is : 

from django.conf.urls  import url


from . import views


urlpatterns = [

url(r'^$', views.index, name='index'),

]




the content of views.py is : 


from django.shortcuts import render

from django.http import HttpResponse



# Create your views here.


def index(request):

return HttpResponse("Hello, Mothers Fuckers!  You're at the polls 
index!")



So can somebody please tell me why I get ModuleNotFoundError: No module 
named 'polls'.



-- 
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/09c07d79-bcbf-4451-9d73-9d7189e66dfc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Authentication backend - serialization

2017-06-05 Thread Melvyn Sopacua
On Monday 05 June 2017 04:14:01 Alison P wrote:

> If I use the default session serializer, I get the following error:
> TypeError at /login/
> 
>  is not JSON serializable

I'm using this is a general solution. Feel free to strike what you don't need.
The basics is that a JSONEncoder knows primitives and how to recurse 
containers. The rest is 
passed to a method "default", which generates the above error message. 
Subclasses should 
override it to implement their own knowledge about objects to serialize.

*class JSONModelEncoder(*DjangoJSONEncoder*):*exclude_callback *= None
*recurse_foreign_keys *= True

def get_excluded_fields(*self, instance*):if *self.exclude_callback 
*is not None:
return *self.exclude_callback*(*instance*)else:return *[]

*def recurse_foreign(*self, instance, field*) *-> */dict/**:*retval 
*= {}if 
/isinstance/(*field, models.OneToOneField*):*/# OneToOneField is a 
subclass of 
ForeignKey, thus must be placed# before ForeignKey.# If 
parent_link is true, then 
we need to pull in the fields# as if they were part of the current 
model./*if not 
*field.parent_link*:*parent_obj *= /getattr/(*instance, 
field.name*)if 
*parent_obj *is not None:*value *= *self.model_to_dict*(
*parent_obj,
exclude*=*self.get_excluded_fields*(*parent_obj*))  
  
*retval.update*(*value*)elif /isinstance/(*field, models.ForeignKey*):  
  */# Resolve 
the model pointed to./foreign *= /getattr/(*instance, field.name*)  
  if *foreign *is 
not None:*value *= *self.model_to_dict*(*foreign*)  
  *retval[field.name] *= 
*value*else:*retval[field.name] *= Noneelif 
/isinstance/(*field, 
models.ManyToManyField*):*/# Create a list of model dicts.  
  /modlist *= *[]
related *= /getattr/(*instance, field.name*)for *rel *in *related*: 
   
*modlist.append*(*self.model_to_dict*(*rel*))

*retval[field.name] *= *modlist*else:raise 
/TypeError/('recurse_foreign 
called on {}'*.format*(/type/(*field*)))

return *retval

*def link_foreign(*self, instance, field*) *-> */dict/**:if 
/isinstance/(*field, 
models.ManyToManyField*):return *self.recurse_foreign*(*instance, 
field*)elif 
/isinstance/(*field, models.OneToOneField*):if not 
*field.parent_link*:return 
*self.recurse_foreign*(*instance, field*)elif /isinstance/(*field, 
models.ForeignKey*):
*foreign *= /getattr/(*instance, field.name*)*/# raise 
ValueError(repr(foreign))/*if 
*foreign *is not None:if /getattr/(*foreign, *'absolute_url'*, 
*False):return {
*field.name*: {'text': *force_text*(*foreign*)*,
*'link': 
*foreign.absolute_url,*}}   
 else:return {
*field.name*: {'text': *force_text*(*foreign*)*,
*'pk': 
*foreign.pk*}}

return {}

def model_to_dict(*self, instance, exclude*=None*, kwargs*) *-> 
*/dict/**:
*"""Convert a model instance to a dictionary of field names and values.

If the model has a method of the same name, that method is called for   
 three reasons:
#. Centralization. This method can be used in other parts of django 
  or an application to 
provide a consistent dictionary of the   model.#. The 
default implementation only 
maps fields. If the model has   important attributes that are 
implemented as properties 
this   mixin will not find them.#. Hiding of sensitive 
fields. The model is better 
equipped to   evaluate if a field contains sensitive information.

 /:param/ instance: the model instance to convert /:type/ 
instance: models.Model 
/:param/ exclude: list of fields to exclude from being sent /:type/ 
exclude: list"""
exclude *= *exclude *or *self.get_excluded_fields*(*instance*)if 
/hasattr/(*instance, 
*'model_to_dict') and *\*/callable/**(/getattr/(*instance, 
*'model_to_dict')):
return *instance.model_to_dict*(*exclude, kwargs*)*retval *= {} 
   for *field *in 
*instance._meta.fields*:if *field.name *in *exclude*:   
 continueif 
/isinstance/(*field, *(*models.ForeignKey, models.ManyToManyField*)):   

Re: julian date to normal date conversion

2017-06-05 Thread Larry Martell
On Mon, Jun 5, 2017 at 6:10 PM, sum abiut  wrote:
> i am using python,and django as my web framework. I use  sqlalchemy to
> connect to  MSSQL data that is running Epicor database. Epicor is using
> julian date. How to you convert julian date to normal date

It's called Gregorian, not normal. You could use this package:

https://pypi.python.org/pypi/jdcal

Or google it to find other solutions.

-- 
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/CACwCsY7F0TY%3Da0j6svV4V_Jq%2B%2BNLd1rEAAAVjFo7BwZ9cgs3sg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


julian date to normal date conversion

2017-06-05 Thread sum abiut
i am using python,and django as my web framework. I use  sqlalchemy to
connect to  MSSQL data that is running Epicor database. Epicor is using
julian

* date. How to you convert julian date to normal date*


*cheers,*

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


CENSORSHIP

2017-06-05 Thread Daniel
GO RETWEET https://twitter.com/VMozghovyi/status/823610114565427201



-- 
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/E1dHxqm-000554-12%40orbit.eternalimpact.info.
For more options, visit https://groups.google.com/d/optout.


Re: Authentication backend - serialization

2017-06-05 Thread ludovic coues
I don't see where in your code the error happen.

With standard python, you can't add a method on your class to make is
JSON serializable. At least to my knowledge. You have to write your
own serializer and instruct the code turning your object into JSON to
use it.

But there are a few easier alternative. For example, model_to_dict (
https://docs.djangoproject.com/en/1.11/_modules/django/forms/models/
). This function will take your model, a list of field then build a
dict. As long as you are not using fancy fields like a DateTimeField,
the dict should be JSON serializable.

2017-06-05 13:14 GMT+02:00 Alison P :
> Hi everyone,
>
> I have written a custom authentication backend, the code is below. It allows
> a user to click "email me a one-time password" on the home page, which is
> saved on the "Person" model (which extends User through a foreign key) and
> then log in with that password. This backend verifies the password and then
> erases it from the database.
> This whole thing works when I put
> SESSION_SERIALIZER='django.contrib.sessions.serializers.PickleSerializer' in
> settings.py, but I don't want that since PickleSerializer is unsafe.
>
> If I use the default session serializer, I get the following error:
>
> TypeError at /login/
>
>  is not JSON serializable
>
>
> how do I solve this? Do I need to write a custom serializer, and if yes,
> how? Can I add serialize/deserialize methods on this class, and what exactly
> do they need to do? Do they need to be classmethods or something?
>
> I would really appreciate some help with this. Thanks in advance!
>
> from django.contrib.auth.models import User
> from allauth.account.models import EmailAddress
> from passlib.hash import pbkdf2_sha256
> from api import models
> from base.settings import ACCOUNT_PASSWORD_MIN_LENGTH
>
> class OneTimePasswordBackend(object):
> def authenticate(self, email=None, one_time_password=None):
> if len(one_time_password) < ACCOUNT_PASSWORD_MIN_LENGTH or
> one_time_password==None:
> return None
> try:
> email_obj = EmailAddress.objects.get(email=email)
> except EmailAddress.DoesNotExist:
> return None
> user = email_obj.user
> person = models.Person.objects.get(user_account=user)
> saved_pw = person.one_time_password
> try:
> verify = pbkdf2_sha256.verify(one_time_password, saved_pw)
> except Exception as e:
> print(e)
> verify = False
> else:
> """reset the one time password"""
> person.one_time_password = ""
> person.save()
> return user
> return None
>
> def get_user(self, user_id):
> try:
> return User.objects.get(pk=user_id)
> except User.DoesNotExist:
> return None
>
> --
> 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/69b91fa4-aca9-458e-9a83-d7b3d3ac35f7%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Ludovic Coues
+33 6 14 87 43 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%2BTYGXTysXTnaQAedsRRGA%3Dp2tPxa5m1vra7tGkQDpJ-sPA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Installing Django

2017-06-05 Thread Carlos Andre
pip install django==1.10



2017-06-05 13:59 GMT-03:00 Melvyn Sopacua :

> On Monday 05 June 2017 06:44:13 Oladipupo Elegbede wrote:
>
> > For the Python prompt from CMD and do the following
>
> >
>
> > >>>import Django
>
> > >>>Django.VERSION
>
>
>
> 1) it's django not Django
>
> > This should tell you what version of Django you have.
>
> >
>
> > On Jun 5, 2017 7:21 AM, "Daniel Roseman"  wrote:
>
> > > On Monday, 5 June 2017 12:33:28 UTC+1, Richard Mungai wrote:
>
> > >> Hi..
>
> > >> I'm trying to install django using the pip command i.e (pip install
>
> > >> django) but i keep getting the same error message i.e "Requirement
>
> > >> already satisfied: django in c:\program files\python
>
> > >> 35-32\lib\site-packages\django -1.10.6-py3.5.egg"
>
>
>
> 2) I'm betting it's 1.10.6 on Python 3.5 (32-bits, shooting for the bonus
> points).
>
> --
>
> Melvyn Sopacua
>
> --
> 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/9871067.85mFGhf4C7%40devstation
> 
> .
>
> 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/CAA8yBMz%2B8nkt88nezW_yPVHU4_%2BOAtV2hPsBa972PDZ3K-D_gQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django-channels with django-tenant-schemas

2017-06-05 Thread Andrew Godwin
Does the WebSocket handshake finish? The developer console in a browser
should tell you if it actually opens up or not.

Normal Django middleware shouldn't affect WebSockets as it's a different
networking style, but it's very easy to get WebSockets set up wrong for a
variety of other reasons.

Andrew

On Sun, Jun 4, 2017 at 10:16 PM, Suc  wrote:

> Does django-tenant-schemas affect django-channels message.reply? Im using
> ngrok in host header spoofing for multitenancy but im having problem on
> sending message on web socket
>
>
> 
> the websocket doesn't receive any data frames
>
> --
> 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/1178b140-e28b-408f-a4ea-e7bb239a7abd%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/CAFwN1uomvOHNquwPWqLiHNYjbsWH8gMiH0YKHJkDybTWkok85A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Installing Django

2017-06-05 Thread Melvyn Sopacua
On Monday 05 June 2017 06:44:13 Oladipupo Elegbede wrote:
> For the Python prompt from CMD and do the following
> 
> >>>import Django
> >>>Django.VERSION

1) it's django not Django
 
> This should tell you what version of Django you have.
> 
> On Jun 5, 2017 7:21 AM, "Daniel Roseman"  wrote:
> > On Monday, 5 June 2017 12:33:28 UTC+1, Richard Mungai wrote:
> >> Hi..
> >> I'm trying to install django using the pip command i.e (pip install
> >> django) but i keep getting the same error message i.e "Requirement
> >> already satisfied: django in c:\program files\python
> >> 35-32\lib\site-packages\django -1.10.6-py3.5.egg"

2) I'm betting it's 1.10.6 on Python 3.5 (32-bits, shooting for the bonus 
points).
-- 
Melvyn Sopacua

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


Re: Fetching API data in json format and inserting it into the django local database.

2017-06-05 Thread MOEGAMMAT FAIEEZ WHITE


On Monday, June 5, 2017 at 2:56:54 PM UTC+2, MOEGAMMAT FAIEEZ WHITE wrote:
>
> I want to get the values and store it. im creating a visualization web 
> application for a data collection application which stores the data 
> directly to the database.
>
> i am doing the application as a honours project, the data collection 
> application is mostly used in under-served communities, and i want to 
> provide a free application that allows the admin user to visualize( in the 
> form of graphs and charts) the data in their forms. 
>
> another question, is there an option to create a MODELS.PY that is 
> dynamic? for example different forms will have different fields.
>
> On Monday, June 5, 2017 at 2:28:55 PM UTC+2, Jani Tiainen wrote:
>>
>>
>>
>> On 05.06.2017 15:23, MOEGAMMAT FAIEEZ WHITE wrote:
>>
>>
>> Hi Jani,
>>
>> i have direct access to the database where the form is stored. I GET the 
>> data using the imported requests e,g [r = requests.get(url, 
>> auth=HTTPBasicAuth('username', 'password'))]
>>
>>
>> So your remote database contains some kind of a form that you want to 
>> copy to Django database and then represent that form to end user?
>>
>>
>> so the user would have to input his/her user name and password , and the 
>> project name for which they want the forms for. i then create a model with 
>> only certain key value pairs i want from the database..
>>
>> my main problem is the models.py and the database insertion of the forms.
>>
>>
>> If it's simple key and value pairs doing that isn't much to code, just 
>> add two fields that fullfil your requirement.
>>
>> also i have a python script which fetches my data, i do not know how to 
>> use views.py to do it.
>>
>>
>> Same way as in your script, unless fetch is really slow when you need to 
>> think of asynchronous alternatives.
>>
>>
>>
>> On Monday, June 5, 2017 at 2:07:08 PM UTC+2, Jani Tiainen wrote: 
>>>
>>> Hi, 
>>> First you need to decide how you are going to activate fetch data from 
>>> remote company database.
>>>
>>> Is it a button in user interface, django management commant or maybe 
>>> timed task?
>>>
>>> Secondly you need to decide how to actually fetch that data from remote 
>>> company database
>>>
>>> Through RESTful API? Direct access to database? Some proprietary API?
>>>
>>> Finally you need to have models and do necessary data transformations to 
>>> add data to your local Django database.
>>>
>>> But it's not a rocket science. Once you know answers, there are several 
>>> tools that can help you to achieve your goal easier.
>>>
>>> On 05.06.2017 10:48, MOEGAMMAT FAIEEZ WHITE wrote:
>>>
>>> Hi i am new to Django, can you please guide me as to how i can fetch 
>>> data from a companies database and insert it into my database. I have been 
>>> reading about models.py and serializers.py and all tutorials and readings i 
>>> came accross has online shown be how to display the database data onto the 
>>> html and how to export data already in the database as json data.
>>>
>>>
>>> Disclaimer - This e-mail is subject to UWC policies and e-mail 
>>> disclaimer published on our website at: 
>>> https://www.uwc.ac.za/Pages/emaildisclaimer.aspx
>>>
>>>
>>>
>>> -- 
>>> 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/51eb014a-88f7-48cb-b729-f3c6e32461d3%40googlegroups.com
>>>  
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>> -- 
>>> Jani Tiainen
>>>
>>>
>>
>> Disclaimer - This e-mail is subject to UWC policies and e-mail disclaimer 
>> published on our website at: 
>> https://www.uwc.ac.za/Pages/emaildisclaimer.aspx
>>
>>
>>
>> -- 
>> 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/5089b155-948f-4af6-aa80-bd45678b5f04%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> -- 
>> Jani Tiainen
>>
>>
-- 


Disclaimer - This e-mail is subject to UWC policies and e-mail 

Re: Fetching API data in json format and inserting it into the django local database.

2017-06-05 Thread MOEGAMMAT FAIEEZ WHITE
I want to get the values and store it. im creating a visualization web 
application for a data collection application which stores the data 
directly to the database.

i am doing the application as a honours project, the data collection 
application is mostly used in under-served communities, and i want to 
provide a free application that allows the admin user to visualize( in the 
form of graphs and charts) the data in their forms. 

another question, is there an option to create a form that is dynamic? for 
example different forms will have different fields.

On Monday, June 5, 2017 at 2:28:55 PM UTC+2, Jani Tiainen wrote:
>
>
>
> On 05.06.2017 15:23, MOEGAMMAT FAIEEZ WHITE wrote:
>
>
> Hi Jani,
>
> i have direct access to the database where the form is stored. I GET the 
> data using the imported requests e,g [r = requests.get(url, 
> auth=HTTPBasicAuth('username', 'password'))]
>
>
> So your remote database contains some kind of a form that you want to copy 
> to Django database and then represent that form to end user?
>
>
> so the user would have to input his/her user name and password , and the 
> project name for which they want the forms for. i then create a model with 
> only certain key value pairs i want from the database..
>
> my main problem is the models.py and the database insertion of the forms.
>
>
> If it's simple key and value pairs doing that isn't much to code, just add 
> two fields that fullfil your requirement.
>
> also i have a python script which fetches my data, i do not know how to 
> use views.py to do it.
>
>
> Same way as in your script, unless fetch is really slow when you need to 
> think of asynchronous alternatives.
>
>
>
> On Monday, June 5, 2017 at 2:07:08 PM UTC+2, Jani Tiainen wrote: 
>>
>> Hi, 
>> First you need to decide how you are going to activate fetch data from 
>> remote company database.
>>
>> Is it a button in user interface, django management commant or maybe 
>> timed task?
>>
>> Secondly you need to decide how to actually fetch that data from remote 
>> company database
>>
>> Through RESTful API? Direct access to database? Some proprietary API?
>>
>> Finally you need to have models and do necessary data transformations to 
>> add data to your local Django database.
>>
>> But it's not a rocket science. Once you know answers, there are several 
>> tools that can help you to achieve your goal easier.
>>
>> On 05.06.2017 10:48, MOEGAMMAT FAIEEZ WHITE wrote:
>>
>> Hi i am new to Django, can you please guide me as to how i can fetch data 
>> from a companies database and insert it into my database. I have been 
>> reading about models.py and serializers.py and all tutorials and readings i 
>> came accross has online shown be how to display the database data onto the 
>> html and how to export data already in the database as json data.
>>
>>
>> Disclaimer - This e-mail is subject to UWC policies and e-mail disclaimer 
>> published on our website at: 
>> https://www.uwc.ac.za/Pages/emaildisclaimer.aspx
>>
>>
>>
>> -- 
>> 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/51eb014a-88f7-48cb-b729-f3c6e32461d3%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> -- 
>> Jani Tiainen
>>
>>
>
> Disclaimer - This e-mail is subject to UWC policies and e-mail disclaimer 
> published on our website at: 
> https://www.uwc.ac.za/Pages/emaildisclaimer.aspx
>
>
>
> -- 
> 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/5089b155-948f-4af6-aa80-bd45678b5f04%40googlegroups.com
>  
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
> -- 
> Jani Tiainen
>
>
-- 


Disclaimer - This e-mail is subject to UWC policies and e-mail disclaimer 
published on our website at: 
https://www.uwc.ac.za/Pages/emaildisclaimer.aspx



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group 

Re: Installing Django

2017-06-05 Thread Oladipupo Elegbede
For the Python prompt from CMD and do the following

>>>import Django
>>>Django.VERSION


This should tell you what version of Django you have.


On Jun 5, 2017 7:21 AM, "Daniel Roseman"  wrote:

> On Monday, 5 June 2017 12:33:28 UTC+1, Richard Mungai wrote:
>>
>> Hi..
>> I'm trying to install django using the pip command i.e (pip install
>> django) but i keep getting the same error message i.e "Requirement already
>> satisfied: django in c:\program files\python 35-32\lib\site-packages\django
>> -1.10.6-py3.5.egg"
>> How can I solve this??
>>
>
> Solve what? It's telling you Django is already installed.
> --
> DR.
>
> --
> 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/9f275611-09d9-4d73-8c4f-bbf48608589e%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/CAHjgLX5T-LjfbipxXCVvsV8OyYZ3pTjzBQ8%2BdLfLoDwM_jXmJA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Fetching API data in json format and inserting it into the django local database.

2017-06-05 Thread Jani Tiainen



On 05.06.2017 15:23, MOEGAMMAT FAIEEZ WHITE wrote:


Hi Jani,

i have direct access to the database where the form is stored. I GET 
the data using the imported requests e,g [r = requests.get(url, 
auth=HTTPBasicAuth('username', 'password'))]


So your remote database contains some kind of a form that you want to 
copy to Django database and then represent that form to end user?




so the user would have to input his/her user name and password , and 
the project name for which they want the forms for. i then create a 
model with only certain key value pairs i want from the database..


my main problem is the models.py and the database insertion of the forms.



If it's simple key and value pairs doing that isn't much to code, just 
add two fields that fullfil your requirement.


also i have a python script which fetches my data, i do not know how 
to use views.py to do it.




Same way as in your script, unless fetch is really slow when you need to 
think of asynchronous alternatives.





On Monday, June 5, 2017 at 2:07:08 PM UTC+2, Jani Tiainen wrote:

Hi,

First you need to decide how you are going to activate fetch data
from remote company database.

Is it a button in user interface, django management commant or
maybe timed task?

Secondly you need to decide how to actually fetch that data from
remote company database

Through RESTful API? Direct access to database? Some proprietary API?

Finally you need to have models and do necessary data
transformations to add data to your local Django database.

But it's not a rocket science. Once you know answers, there are
several tools that can help you to achieve your goal easier.

On 05.06.2017 10:48, MOEGAMMAT FAIEEZ WHITE wrote:

Hi i am new to Django, can you please guide me as to how i can
fetch data from a companies database and insert it into my
database. I have been reading about models.py and serializers.py
and all tutorials and readings i came accross has online shown be
how to display the database data onto the html and how to export
data already in the database as json data.


Disclaimer - This e-mail is subject to UWC policies and e-mail
disclaimer published on our website at:
https://www.uwc.ac.za/Pages/emaildisclaimer.aspx





-- 
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/51eb014a-88f7-48cb-b729-f3c6e32461d3%40googlegroups.com

.
For more options, visit https://groups.google.com/d/optout
.


-- 
Jani Tiainen




Disclaimer - This e-mail is subject to UWC policies and e-mail 
disclaimer published on our website at: 
https://www.uwc.ac.za/Pages/emaildisclaimer.aspx 






--
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/5089b155-948f-4af6-aa80-bd45678b5f04%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
Jani Tiainen

--
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/4e4a8dd6-1ca2-9ad4-773c-c6fec3e9eb56%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Fetching API data in json format and inserting it into the django local database.

2017-06-05 Thread MOEGAMMAT FAIEEZ WHITE

Hi Jani,

i have direct access to the database where the form is stored. I GET the 
data using the imported requests e,g [r = requests.get(url, 
auth=HTTPBasicAuth('username', 'password'))]

so the user would have to input his/her user name and password , and the 
project name for which they want the forms for. i then create a model with 
only certain key value pairs i want from the database..

my main problem is the models.py and the database insertion of the forms.

also i have a python script which fetches my data, i do not know how to use 
views.py to do it.

Thank you in advance..
Faieez



On Monday, June 5, 2017 at 2:07:08 PM UTC+2, Jani Tiainen wrote:
>
> Hi, 
> First you need to decide how you are going to activate fetch data from 
> remote company database.
>
> Is it a button in user interface, django management commant or maybe timed 
> task?
>
> Secondly you need to decide how to actually fetch that data from remote 
> company database
>
> Through RESTful API? Direct access to database? Some proprietary API?
>
> Finally you need to have models and do necessary data transformations to 
> add data to your local Django database.
>
> But it's not a rocket science. Once you know answers, there are several 
> tools that can help you to achieve your goal easier.
>
> On 05.06.2017 10:48, MOEGAMMAT FAIEEZ WHITE wrote:
>
> Hi i am new to Django, can you please guide me as to how i can fetch data 
> from a companies database and insert it into my database. I have been 
> reading about models.py and serializers.py and all tutorials and readings i 
> came accross has online shown be how to display the database data onto the 
> html and how to export data already in the database as json data.
>
>
> Disclaimer - This e-mail is subject to UWC policies and e-mail disclaimer 
> published on our website at: 
> https://www.uwc.ac.za/Pages/emaildisclaimer.aspx
>
>
>
> -- 
> 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/51eb014a-88f7-48cb-b729-f3c6e32461d3%40googlegroups.com
>  
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
> -- 
> Jani Tiainen
>
>
-- 


Disclaimer - This e-mail is subject to UWC policies and e-mail disclaimer 
published on our website at: 
https://www.uwc.ac.za/Pages/emaildisclaimer.aspx



-- 
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/5089b155-948f-4af6-aa80-bd45678b5f04%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Fetching API data in json format and inserting it into the django local database.

2017-06-05 Thread MOEGAMMAT FAIEEZ WHITE
Hi Jani,

i have direct access to the database where the form is stored. I GET the 
data using the imported requests e,g [r = requests.get(url, 
auth=HTTPBasicAuth('username', 'password'))]

so the user would have to input his/her user name and password , and the 
project name for which they want the forms for. i then create a model with 
only certain key value pairs i want from the database..

my main problem is the models.py and the database insertion of the forms.

also i have a python script which fetches my data, i do not know how to use 
views.py to do it.

Thank you in advance..
Faieez



-- 


Disclaimer - This e-mail is subject to UWC policies and e-mail disclaimer 
published on our website at: 
https://www.uwc.ac.za/Pages/emaildisclaimer.aspx



-- 
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/22e113b0-4718-4385-927f-7061bf537541%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Installing Django

2017-06-05 Thread Daniel Roseman
On Monday, 5 June 2017 12:33:28 UTC+1, Richard Mungai wrote:
>
> Hi..
> I'm trying to install django using the pip command i.e (pip install 
> django) but i keep getting the same error message i.e "Requirement already 
> satisfied: django in c:\program files\python 
> 35-32\lib\site-packages\django-1.10.6-py3.5.egg"
> How can I solve this??
>

Solve what? It's telling you Django is already installed.
-- 
DR. 

-- 
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/9f275611-09d9-4d73-8c4f-bbf48608589e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Fetching API data in json format and inserting it into the django local database.

2017-06-05 Thread Jani Tiainen

Hi,

First you need to decide how you are going to activate fetch data from 
remote company database.


Is it a button in user interface, django management commant or maybe 
timed task?


Secondly you need to decide how to actually fetch that data from remote 
company database


Through RESTful API? Direct access to database? Some proprietary API?

Finally you need to have models and do necessary data transformations to 
add data to your local Django database.


But it's not a rocket science. Once you know answers, there are several 
tools that can help you to achieve your goal easier.


On 05.06.2017 10:48, MOEGAMMAT FAIEEZ WHITE wrote:
Hi i am new to Django, can you please guide me as to how i can fetch 
data from a companies database and insert it into my database. I have 
been reading about models.py and serializers.py and all tutorials and 
readings i came accross has online shown be how to display the 
database data onto the html and how to export data already in the 
database as json data.



Disclaimer - This e-mail is subject to UWC policies and e-mail 
disclaimer published on our website at: 
https://www.uwc.ac.za/Pages/emaildisclaimer.aspx 






--
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/51eb014a-88f7-48cb-b729-f3c6e32461d3%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
Jani Tiainen

--
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/9aedf0c9-f75b-68cb-3320-ea1cc1b81437%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Installing Django

2017-06-05 Thread Richard Mungai
Hi..
I'm trying to install django using the pip command i.e (pip install django) 
but i keep getting the same error message i.e "Requirement already 
satisfied: django in c:\program files\python 
35-32\lib\site-packages\django-1.10.6-py3.5.egg"
How can I solve this??

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


django-channels with django-tenant-schemas

2017-06-05 Thread Suc
Does django-tenant-schemas affect django-channels message.reply? Im using 
ngrok in host header spoofing for multitenancy but im having problem on 
sending message on web socket


the websocket doesn't receive any data frames 

-- 
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/1178b140-e28b-408f-a4ea-e7bb239a7abd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Authentication backend - serialization

2017-06-05 Thread Alison P
Hi everyone,

I have written a custom authentication backend, the code is below. It 
allows a user to click "email me a one-time password" on the home page, 
which is saved on the "Person" model (which extends User through a foreign 
key) and then log in with that password. This backend verifies the password 
and then erases it from the database. 
This whole thing works when I put 
SESSION_SERIALIZER='django.contrib.sessions.serializers.PickleSerializer' 
in settings.py, but I don't want that since PickleSerializer is unsafe. 

If I use the default session serializer, I get the following error: 
TypeError at /login/ 

 is not JSON serializable


how do I solve this? Do I need to write a custom serializer, and if yes, 
how? Can I add serialize/deserialize methods on this class, and what 
exactly do they need to do? Do they need to be classmethods or something?

I would really appreciate some help with this. Thanks in advance!

from django.contrib.auth.models import User
from allauth.account.models import EmailAddress
from passlib.hash import pbkdf2_sha256
from api import models
from base.settings import ACCOUNT_PASSWORD_MIN_LENGTH

class OneTimePasswordBackend(object):
def authenticate(self, email=None, one_time_password=None):
if len(one_time_password) < ACCOUNT_PASSWORD_MIN_LENGTH or 
one_time_password==None:
return None
try:
email_obj = EmailAddress.objects.get(email=email)
except EmailAddress.DoesNotExist:
return None
user = email_obj.user
person = models.Person.objects.get(user_account=user)
saved_pw = person.one_time_password
try:
verify = pbkdf2_sha256.verify(one_time_password, saved_pw)
except Exception as e:
print(e)
verify = False
else:
"""reset the one time password"""
person.one_time_password = ""
person.save()
return user
return None

def get_user(self, user_id):
try:
return User.objects.get(pk=user_id)
except User.DoesNotExist:
return None

-- 
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/69b91fa4-aca9-458e-9a83-d7b3d3ac35f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Fetching API data in json format and inserting it into the django local database.

2017-06-05 Thread MOEGAMMAT FAIEEZ WHITE
Hi i am new to Django, can you please guide me as to how i can fetch data 
from a companies database and insert it into my database. I have been 
reading about models.py and serializers.py and all tutorials and readings i 
came accross has online shown be how to display the database data onto the 
html and how to export data already in the database as json data.

-- 


Disclaimer - This e-mail is subject to UWC policies and e-mail disclaimer 
published on our website at: 
https://www.uwc.ac.za/Pages/emaildisclaimer.aspx



-- 
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/51eb014a-88f7-48cb-b729-f3c6e32461d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


TWITTER

2017-06-05 Thread Daniel
FOLLOW https://twitter.com/VMozghovyi



-- 
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/E1dHpoc-0002j2-Eu%40orbit.eternalimpact.info.
For more options, visit https://groups.google.com/d/optout.