Multisite strategy

2018-05-21 Thread Carlo Ascani
Hi all,

I'd like to implement something like this:

One Django project to serve 3 sites:
1. `domain.com` which is the "master" site, containing just a landing page
2. `de.domain.com` which is the "German" site
3. `en.domain.com` which is the "UK" site

`de` and `en` refers the location, not the language (e.g. 
`de.domain.com/en/` is the German site in English)

If you go to `domain.com` you can choose the language and the country, and 
you are just redirected to the right place.

Is `contrib.site` suitable for that scenario?
I was thinking at 3 different sites.
If so, how can I use them locally while in development?

Any other suggestions?

Best,
Carlo


-- 
You received this message because you are subscribed 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/3b068855-78e7-4742-890d-1fc8a545b4f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to create receipt forms using django.

2018-05-21 Thread subhani shaik
Hi...
Iknowthe django project creations.but i need how to create receipt forms
with multiple submit buttons and it's open another window automatically to
other receipt.how..
please tell me know.

On Mon, May 21, 2018 at 11:38 PM, Daniel Germano Travieso <
danielgtravi...@gmail.com> wrote:

> Hello
>
> Dwelve into the official Django Tutorial and learn it's basic, then go on
> to trying to create the app you want!
>
> https://docs.djangoproject.com/en/2.0/intro/tutorial01/
>
> Hope it helps.
>
> On Monday, May 21, 2018 at 4:20:37 AM UTC-3, subhani shaik wrote:
>>
>> Hi group numbers...
>>
>> How to create supermarket receipt forms using django& python with the
>> help of HTML.please give me that code.plz..
>>
>>
>>
>>
>>
>> Thanks.
>> subhani shaik
>>
> --
> You received this message because you are subscribed 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/778f828f-4bae-4ae0-8738-31d676942588%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Thanks&Regards,

Subhani Shaik
8897630945

-- 
You received this message because you are subscribed 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/CAGytu6BeTmFBO5CpXTO3cwYbF1rCSFC87Rj3tLz_rb-3Ys4rLw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


money field question

2018-05-21 Thread Mike Dewhirst

I have just read ...

* Martin Fowler's Money base pattern (P488 to 495) 
https://martinfowler.com/eaaCatalog/money.html

* https://github.com/poswald/python-money
* https://github.com/django-money/django-money
* https://github.com/limist/py-moneyed

... and I am spoiled for choice. I was going to just use a DecimalField 
and CharField for currency and do my own thing when I decided to pull 
Martin Fowler off my shelf and saw how careful I was going to need to be.


My question: Is Django planning to adopt one or other of the above 
implementations?


I'm just trying to short-circuit more detailed analysis of these 
packages and perhaps others I haven't yet found. If one is on the 
horizon for Django I'll just go with that.


Thanks

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/adcc29e7-95a7-06bc-420e-78af3037458b%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: Insert data into multiple models when doing POST method

2018-05-21 Thread Daniel Germano Travieso
Hello!

​As my initial understanding, you are attempting to use some sort of Django
REST Framework.
Check the django-rest-framework documentation for some insights:
http://www.django-rest-framework.org/api-guide/serializers/

You will need to overwrite the .create method of the Patient Model and the
.create method of the Serializer.

Hope it helps!​


*[]'s*
*Daniel Germano Travieso*
*Engenharia da Computação Turma: 013*
*Unicamp*

On Mon, May 21, 2018 at 12:59 PM, thiagarajan.kpt  wrote:

> Hi,
>
> I have two models (Patients and PatientAddress). I want to create a new
> patient using POST method and data should be inserted in Patient and
> PatientAddress tables. But the data is inserted only into Patients table
> and not in PatientAddress table.
>
> When I POST a new patient with Address then automatically it should create
> a new record in PatientAddress table with patnt_refno referencing to the
> Patient table. *Could someone please assist to proceed further.*
>
> Below is my code.
>
> *POST Input:*
> {
> "Address": [
> {
> "line": "3A insert Second Street",
> "city": "insert city",
> "country": "India"
> }
> ],
> "patnt_id": "P14",
> "surname": "Smith",
> "forename": "James",
> "gender": "M",
> "active": 1
> }
>
>
> *models.py*
> class Patients(models.Model):
> patnt_refno = models.AutoField(primary_key=True)
> patnt_id = models.CharField(unique=True, max_length=10, blank=True,
> null=True)
> surname = models.CharField(max_length=30, blank=True, null=True)
> forename = models.CharField(max_length=50, blank=True, null=True)
> gender = models.CharField(max_length=1, blank=True, null=True)
> dttm_of_birth = models.DateTimeField(blank=True, null=True)
> dttm_of_death = models.DateTimeField(blank=True, null=True)
> marital_status = models.CharField(max_length=50, blank=True,
> null=True)
> active = models.IntegerField()
>
> def __str__(self):
> return self.patnt_id
>
> class Meta:
> managed = False
> db_table = 'patients'
>
> class PatientAddress(models.Model):
> addss_refno = models.AutoField(primary_key=True)
> patnt_refno = models.ForeignKey('Patients', db_column='patnt_refno',
> related_name='Address')
> line = models.CharField(max_length=30, blank=True, null=True)
> city = models.CharField(max_length=50, blank=True, null=True)
> state = models.CharField(max_length=50, blank=True, null=True)
> country = models.CharField(max_length=50, blank=True, null=True)
> postcode = models.CharField(max_length=50, blank=True, null=True)
> active = models.IntegerField(blank=True, null=True)
>
> class Meta:
> managed = False
> db_table = 'patientaddress'
>
>
> *serializers.py*
> class PatientAddressSerializer(serializers.ModelSerializer):
>
> class Meta:
> model = PatientAddress
> fields = ('line','city','country')
>
> class PatientsSerializer(serializers.ModelSerializer):
> Address = PatientAddressSerializer(read_only=True,many=True)
>
> class Meta:
> model = Patients
> fields = ('Address','patnt_refno','patnt_id','surname','forename'
> ,'gender','active')
>
>
> *views.py*
> class PatientsList(APIView):
>
> def get(self, request):
> patients = Patients.objects.filter(gender='M',active=1).order_by(
> 'dttm_of_birth').reverse()
> serializer = PatientsSerializer(patients, many=True)
> return Response(serializer.data)
>
> def post(self, request):
> serializer = PatientsSerializer(data=request.data)
> if serializer.is_valid():
> serializer.save()
> return Response(serializer.data, status=status.HTTP_201_
> CREATED)
> return Response(serializer.errors, status=status.HTTP_400_BAD_
> REQUEST)
>
> *urls.py*
> urlpatterns = [
> url(r'^admin/', admin.site.urls),
> url(r'^patients/$', views.PatientsList.as_view()),
> ]
>
>
>
> Thanks in advance,
> Thiagu Palaniappan
>
> --
> You received this message because you are subscribed 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/7a69934b-f4c7-4c85-9107-25062187a1a2%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 

Re: First View

2018-05-21 Thread Daniel Germano Travieso
Hello!

As you configured, the available url patterns you have on your project are:
"/admin/" and "/boutique/"... And as you request
states, you are trying to access the path "/".. So django didn't
find any matching url pattern for that.

To access the view you are intended to access, you should access
"/boutique/".

To advance further I recommend you to check the documentation on URL
patterns!

Hope it helps.

*[]'s*
*Daniel Germano Travieso*
*Engenharia da Computação Turma: 013*
*Unicamp*

On Mon, May 21, 2018 at 5:55 PM, Tristan Demot 
wrote:

> Hello,
>
> I use tutorial 1.11
>
> beaumarche (startproject)
>
> from django.conf.urls import include, url
> from django.contrib import admin
>
>
> urlpatterns = [
>
> url(r'^boutique/', include('boutique.urls')) ,
> url(r'^admin/', admin.site.urls),
> ]
>
>
> boutique (app)
>
>
> urls.py
>
>
> from django.conf.urls import url
>
>
> from . import views
>
>
> urlpatterns = [
>   url(r'^$', views.index, name='index'),
> ]
>
>
>
>
> views.py
> from django.http import HttpResponse
>
>
> def index(request):
>  return HttpResponse ("Hello, world...")
>
>
> 127.0.0.1:8000
> Using the URLconf defined in beaumarche.urls, Django tried these URL
> patterns, in this order:
>
>
> 1.^boutique/
> 2^admin/
>
>
> The empty path didn't match any of these
>
> An idea maybe
>
> 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/5431a0c8-1365-4a73-8026-25c57c2f775b%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/CABF8kZPpN_nQ1Xkjq-5%2BWBip1EMxtY-sUuo9grZ4ZnttL5hRag%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Temporal table in Django 1.6

2018-05-21 Thread Daniel Germano Travieso
Hello!

First of all, I highly recommend you to use django* 1.8 or upper*, as de
1.6 version is* no longer supported* by the official django development.
After that note, as you can see, the database engine backends that come
bundled with Django are as follows (
https://docs.djangoproject.com/en/2.0/ref/settings/#engine )

- 'django.db.backends.postgresql'
- 'django.db.backends.mysql'
- 'django.db.backends.sqlite3'
- 'django.db.backends.oracle'

But as stated on the same page, you can create your own backend (one that
supports Temporal Tables on another DBMS - suche as MS SQL Server 2016) and
bundle it with your app. To see the appropriate documentation for the
databases api for you to create the backend, just go to the appropriate
section ( https://docs.djangoproject.com/en/2.0/ref/databases/ ).

Another option is for you to find an app available somewhere out there on
the internet that provides a backend with Temporal Tables.

Hope it helps!

*[]'s*
*Daniel Germano Travieso*
*Engenharia da Computação Turma: 013*
*Unicamp*

On Mon, May 21, 2018 at 4:13 PM, Nirali Supe 
wrote:

> Hello,
>
> I need to create Temporal table in Django 1.6
> Does Django support  Temporal table model? I unable to find the Django
> documentation on it.
> Can someone please point me to the documentation?
>
> Thank you,
> Nirali Supe
>
> --
> You received this message because you are subscribed 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/918a65bb-e9c3-42fb-9170-6e5092b62bc5%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/CABF8kZODAepLqyEoFhM7%2BWww4FGO7zskJrOyt37rhAgdqBUb6w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


First View

2018-05-21 Thread Tristan Demot
Hello,

I use tutorial 1.11

beaumarche (startproject)

from django.conf.urls import include, url
from django.contrib import admin


urlpatterns = [

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


boutique (app)


urls.py


from django.conf.urls import url


from . import views


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




views.py
from django.http import HttpResponse


def index(request):
 return HttpResponse ("Hello, world...")


127.0.0.1:8000
Using the URLconf defined in beaumarche.urls, Django tried these URL 
patterns, in this order:


1.^boutique/
2^admin/


The empty path didn't match any of these

An idea maybe

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/5431a0c8-1365-4a73-8026-25c57c2f775b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to import functions of app from the same project from other app

2018-05-21 Thread Asif Khan
thanks yes I am doing day by day to improve python and django both.

On Monday, May 21, 2018 at 11:05:56 PM UTC+5, Daniel Germano Travieso wrote:
>
> Hello Asif!
>
> To use a method from one app in another app would require you to import 
> the app's module (using from - import statements), allowing the interpreter 
> to know that the function from one scope is available on another.
>
> In a serious note, I recommend that you first familiarize yourself with 
> the Python language, maybe take a online course/tutorial about all its 
> functionalities, and then go on to learning Django (maybe take the Django 
> Documentation tutorial, it is really good).
>
> I will leave you here some links to good resources for both beginner and 
> advanced python and django.
>
> https://learnpythonthehardway.org/book/
> https://docs.python.org/3/tutorial/index.html
> https://developers.google.com/edu/python/
>
> https://docs.djangoproject.com/en/2.0/intro/tutorial01/
> https://docs.djangoproject.com/en/2.0/
>
> Hope it helps!
>
> On Monday, May 21, 2018 at 2:01:45 PM UTC-3, Asif Khan wrote:
>>
>> I am trying to import function wrote in one of app in a project to import 
>> that function in other app in same project.
>>
>> like I have one project and two apps.
>>
>> Project1
>>Project1
>>accounts app (function written in this app)
>>VV app (wants to utilize in this app)
>>
>> I am new to Python and Django as developer.
>>
>> Regards, Asif
>>   
>>
>>

-- 
You received this message because you are subscribed 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/aa9939d4-5c29-45ff-b2de-fcc07d22de1a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to import functions of app from the same project from other app

2018-05-21 Thread Asif Khan
thanks it is resolved.

On Tuesday, May 22, 2018 at 12:18:49 AM UTC+5, Coder Dude wrote:
>
> Suppose your function is in accounts.models . And you want to import in 
> VV.views 
>
> In views.py of VV, 
> Write, 
> from accounts.models import foo

-- 
You received this message because you are subscribed 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/973a079b-2768-49e2-8bb8-ff6a77e15c8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django

2018-05-21 Thread James Farris
Start with the Django docs tutorials
https://docs.djangoproject.com/en/2.0/intro/tutorial01/


On Mon, May 21, 2018 at 12:20 PM chaitanya goud 
wrote:

> Google "full stack python "
>
> On 22-May-2018 12:49 am, "Shivprasad Khandapure" <
> shivkhandapure...@gmail.com> wrote:
>
> Hii everyone
> I'm interested to learn django framework. I'm new in python and
> django so give some important important ideas, details about django and its
> basics. How can i work with django and its python libraries and its
> templates.
>  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/CAFR1ACRU_YGo-otVE-hD9nBTNCcznuXMhy8m00%3DoaPz%2B9%2BmsBw%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/CA%2BkSnu6kWcePXQtFWot2ZMrbMd%2BTLBjSFmFaX2fY2zdV3J8oow%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/CAE-E-_3%3D3R%3D25QYifm8NneDFE6j6Cqw18jRNzGTTFtAm0%3DjvLg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django

2018-05-21 Thread chaitanya goud
Google "full stack python "

On 22-May-2018 12:49 am, "Shivprasad Khandapure" <
shivkhandapure...@gmail.com> wrote:

Hii everyone
I'm interested to learn django framework. I'm new in python and
django so give some important important ideas, details about django and its
basics. How can i work with django and its python libraries and its
templates.
 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/CAFR1ACRU_YGo-otVE-hD9nBTNCcznuXMhy8m00%3DoaPz%2B9%2BmsBw%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/CA%2BkSnu6kWcePXQtFWot2ZMrbMd%2BTLBjSFmFaX2fY2zdV3J8oow%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Insert data into multiple models when doing POST method

2018-05-21 Thread thiagarajan.kpt
Hi,

I have two models (Patients and PatientAddress). I want to create a new 
patient using POST method and data should be inserted in Patient and 
PatientAddress tables. But the data is inserted only into Patients table 
and not in PatientAddress table.

When I POST a new patient with Address then automatically it should create 
a new record in PatientAddress table with patnt_refno referencing to the 
Patient table. *Could someone please assist to proceed further.*

Below is my code.

*POST Input:*
{
"Address": [
{
"line": "3A insert Second Street",
"city": "insert city",
"country": "India"
}
],
"patnt_id": "P14",
"surname": "Smith",
"forename": "James",
"gender": "M",
"active": 1
}


*models.py*
class Patients(models.Model):
patnt_refno = models.AutoField(primary_key=True)
patnt_id = models.CharField(unique=True, max_length=10, blank=True, 
null=True)
surname = models.CharField(max_length=30, blank=True, null=True)
forename = models.CharField(max_length=50, blank=True, null=True)
gender = models.CharField(max_length=1, blank=True, null=True)
dttm_of_birth = models.DateTimeField(blank=True, null=True)
dttm_of_death = models.DateTimeField(blank=True, null=True)
marital_status = models.CharField(max_length=50, blank=True, null=True)
active = models.IntegerField()

def __str__(self):
return self.patnt_id

class Meta:
managed = False
db_table = 'patients'

class PatientAddress(models.Model):
addss_refno = models.AutoField(primary_key=True)
patnt_refno = models.ForeignKey('Patients', db_column='patnt_refno', 
related_name='Address')
line = models.CharField(max_length=30, blank=True, null=True)
city = models.CharField(max_length=50, blank=True, null=True)
state = models.CharField(max_length=50, blank=True, null=True)
country = models.CharField(max_length=50, blank=True, null=True)
postcode = models.CharField(max_length=50, blank=True, null=True)
active = models.IntegerField(blank=True, null=True)

class Meta:
managed = False
db_table = 'patientaddress'


*serializers.py*
class PatientAddressSerializer(serializers.ModelSerializer):

class Meta:
model = PatientAddress
fields = ('line','city','country')

class PatientsSerializer(serializers.ModelSerializer):
Address = PatientAddressSerializer(read_only=True,many=True)

class Meta:
model = Patients
fields = 
('Address','patnt_refno','patnt_id','surname','forename','gender','active')


*views.py*
class PatientsList(APIView):

def get(self, request):
patients = 
Patients.objects.filter(gender='M',active=1).order_by('dttm_of_birth').reverse()
serializer = PatientsSerializer(patients, many=True)
return Response(serializer.data)

def post(self, request):
serializer = PatientsSerializer(data=request.data)
if serializer.is_valid():
serializer.save()
return Response(serializer.data, status=status.HTTP_201_CREATED)
return Response(serializer.errors, 
status=status.HTTP_400_BAD_REQUEST)

*urls.py*
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^patients/$', views.PatientsList.as_view()),
]



Thanks in advance,
Thiagu Palaniappan

-- 
You received this message because you are subscribed 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/7a69934b-f4c7-4c85-9107-25062187a1a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


how to import functions of app from the same project from other app

2018-05-21 Thread Coder Dude
Suppose your function is in accounts.models . And you want to import in VV.views

In views.py of VV,
Write,
from accounts.models import foo

-- 
You received this message because you are subscribed 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/225a01ac-d99a-4f08-b080-cc432a67b8b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django

2018-05-21 Thread Shivprasad Khandapure
Hii everyone
I'm interested to learn django framework. I'm new in python and
django so give some important important ideas, details about django and its
basics. How can i work with django and its python libraries and its
templates.
 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/CAFR1ACRU_YGo-otVE-hD9nBTNCcznuXMhy8m00%3DoaPz%2B9%2BmsBw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Temporal table in Django 1.6

2018-05-21 Thread Nirali Supe
Hello,

I need to create Temporal table in Django 1.6
Does Django support  Temporal table model? I unable to find the Django 
documentation on it.
Can someone please point me to the documentation?

Thank you,
Nirali Supe

-- 
You received this message because you are subscribed 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/918a65bb-e9c3-42fb-9170-6e5092b62bc5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to create receipt forms using django.

2018-05-21 Thread Daniel Germano Travieso
Hello

Dwelve into the official Django Tutorial and learn it's basic, then go on 
to trying to create the app you want!

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

Hope it helps.

On Monday, May 21, 2018 at 4:20:37 AM UTC-3, subhani shaik wrote:
>
> Hi group numbers...
>
> How to create supermarket receipt forms using django& python with the help 
> of HTML.please give me that code.plz..
>
>
>
>
>
> Thanks.
> subhani shaik
>

-- 
You received this message because you are subscribed 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/778f828f-4bae-4ae0-8738-31d676942588%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to import functions of app from the same project from other app

2018-05-21 Thread Daniel Germano Travieso
Hello Asif!

To use a method from one app in another app would require you to import the 
app's module (using from - import statements), allowing the interpreter to 
know that the function from one scope is available on another.

In a serious note, I recommend that you first familiarize yourself with the 
Python language, maybe take a online course/tutorial about all its 
functionalities, and then go on to learning Django (maybe take the Django 
Documentation tutorial, it is really good).

I will leave you here some links to good resources for both beginner and 
advanced python and django.

https://learnpythonthehardway.org/book/
https://docs.python.org/3/tutorial/index.html
https://developers.google.com/edu/python/

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

Hope it helps!

On Monday, May 21, 2018 at 2:01:45 PM UTC-3, Asif Khan wrote:
>
> I am trying to import function wrote in one of app in a project to import 
> that function in other app in same project.
>
> like I have one project and two apps.
>
> Project1
>Project1
>accounts app (function written in this app)
>VV app (wants to utilize in this app)
>
> I am new to Python and Django as developer.
>
> Regards, Asif
>   
>
>

-- 
You received this message because you are subscribed 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/17ff2816-73db-431f-a1c4-bcf0a7417eca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django login() function works in production but not in development

2018-05-21 Thread pieceofkayk2718
I should elaborate even further.. The 'do something' does not show, instead 
the 'do something else' shows.

-- 
You received this message because you are subscribed 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/22888574-c869-4b0d-9215-283073229604%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


how to import functions of app from the same project from other app

2018-05-21 Thread Asif Khan
I am trying to import function wrote in one of app in a project to import 
that function in other app in same project.

like I have one project and two apps.

Project1
   Project1
   accounts app (function written in this app)
   VV app (wants to utilize in this app)

I am new to Python and Django as developer.

Regards, Asif
  

-- 
You received this message because you are subscribed 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/68cef8ab-cd1f-45c1-9ce9-62e12b511ef0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django login() function works in production but not in development

2018-05-21 Thread pieceofkayk2718
Thanks, I probably should elaborate on that.  I determine the user does not 
get logged in through the logic of my template language.  I have {% if 
user.is_authenticated %} do something {% else %} do something else {% endif 
%} where user is passed through the context dictionary of my corresponding 
view displayed 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/2baac722-e1d1-4c6a-833e-69e69a7542a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: f-strings with self.stdout management commands

2018-05-21 Thread Matthew Pava
Nevermind…
I was using self.stdout(f’’)
Instead of
self.stdout.write(f’’)

Go figure…

From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of Matthew Pava
Sent: Monday, May 21, 2018 9:21 AM
To: django-users@googlegroups.com
Subject: f-strings with self.stdout management commands

I was using Python 3’s f-strings with self.stdout in a BaseCommand.
I keep getting this exception:
TypeError: ‘OutputWrapper’ object is not callable

Any ideas?

--
You received this message because you are subscribed 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/ab17b313e3e44e01b7c9a3a55fddc7a5%40ISS1.ISS.LOCAL.
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/d3821c48706b4dd6ae81e96c809e3672%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.


f-strings with self.stdout management commands

2018-05-21 Thread Matthew Pava
I was using Python 3's f-strings with self.stdout in a BaseCommand.
I keep getting this exception:
TypeError: 'OutputWrapper' object is not callable

Any ideas?

-- 
You received this message because you are subscribed 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/ab17b313e3e44e01b7c9a3a55fddc7a5%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.


Re: How do you deal with two third party apps with the same App label?

2018-05-21 Thread Mario R. Osorio
Thanks Daniel,

I've read that material but could make much sense out of it (I'm sure its 
me) I did read it again today and I *think* I've got it. Will check it 
tonight and I'll let you know.

Thanks again



On Saturday, May 19, 2018 at 10:45:17 PM UTC-4, Daniel Germano Travieso 
wrote:
>
> Hello!
>
> As seen here on the documentation for Applications configuration for app 
> users, you can provide a custom app configuration for one of the third 
> party apps you are using on your project.
>
>
> https://docs.djangoproject.com/en/2.0/ref/applications/#for-application-users
>
> I believe this would solve the ImproperlyConfigured exception as on your 
> settings.py on your INSTALLED_APPS you would have the apps with different 
> names.
> Hope it helps!
>
> On Saturday, May 19, 2018 at 10:54:02 PM UTC-3, Mario R. Osorio wrote:
>>
>> Hello everyone,
>>
>> In  Django 2.0.5; I want to use python-twitter and allauth's twitter 
>> provider and both these apps use the same App label which results in  the 
>> *django.core.exceptions.ImproperlyConfigured: 
>> Application labels aren't unique* error
>>
>> I have searched the internet and found no solutions to this Issue and 
>> would really appreciate your input on this matter.
>>
>> Any and all comments and ideas are welcome.
>>
>>
>> TIA!
>>
>>

-- 
You received this message because you are subscribed 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/b62b32cc-5469-4cbf-92dd-3dd6941ee0a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django 2.0 tutorial :: exception:: application labels are not unique.

2018-05-21 Thread Melvyn Sopacua
On woensdag 16 mei 2018 14:00:28 CEST Paolo Chilosi wrote:
> just a note on your note: I created a few more new project/app using
> PyCharm create facility and I found the app registered in the
> INSTALLED_APPS settings. I do not know if it is Django or PyCharm that
> introduce this setting. 

It's you. Cause you filled in "polls" as the application name (not the project 
name).

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


Re: Setting up Django templates

2018-05-21 Thread Daniel Roseman


On Sunday, 20 May 2018 15:31:08 UTC+1, Salty beggar wrote:
>
> Hi, I'm trying to set up Templates for Django. I already have models and 
> views that function, and now I'm trying to figure out a way to get an 
> actual page to show for it. 
>
> 
>
 

> The views return JSON-formatted information, as you can see. What I'm 
> trying to achieve in the template is implement templates that display 
> countries and their data in a table on the bottom of a page. The table 
> should only be visible after user requests this view with a country code, 
> and above the table I'm trying to have links to all the continents in the 
> database. 
>
>
Why does your view return JSON if you want to use templates? Your view 
should be rendering the template, passing it data as context.
--
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/ebcbb40f-7753-4cae-9e27-30093cadb845%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to create receipt forms using django.

2018-05-21 Thread subhani shaik
Hi group numbers...

How to create supermarket receipt forms using django& python with the help 
of HTML.please give me that code.plz..





Thanks.
subhani shaik

-- 
You received this message because you are subscribed 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/13980ebc-0262-4662-947f-bcd9fec993a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.