SETTINGS Error
Dear Group, I am pretty new to Django. I was using https://docs.djangoproject.com/en/1.8/intro/tutorial01/ to learn aspects of Django. As I gave the command in IDLE, from django.db import models I am getting the error as, Traceback (most recent call last): File "", line 1, in from django.db import connection File "C:\Python27\lib\site-packages\django\db\__init__.py", line 11, in if settings.DATABASES and DEFAULT_DB_ALIAS not in settings.DATABASES: File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 53, in __getattr__ self._setup(name) File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 46, in _setup % (desc, ENVIRONMENT_VARIABLE)) ImproperlyConfigured: Requested setting DATABASES, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings. I tried to do some research on the problem in internet and did not find anything much of use. I am using Windows 7 Professional, Python 2.7.9 and IDLE as GUI. I am using >>> django.get_version() '1.5.4' as my django version, and learnt more or less how to use command prompt as given in this tutorial. If anyone may kindly suggest how to solve the problem. Regards, Subhabrata Banerjee. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4a3531e6-de46-4106-bfaa-1787e9696d86%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: SETTINGS Error
I misread so deleted the question -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a516f4a2-25c2-4213-98c6-fb788f3c99da%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Two questions on Django Tutorial.
Dear Group, I am very new to Django, and started with Django on Windows. I am using Python 2.7.9. I have some issues learning it. (a) I was following the Tutorial given in https://docs.djangoproject.com/en/1.8/intro/tutorial02/ It is generally going fine I am using, 1.8.1 of Django as given in >>> django.get_version() '1.8.1' Here as I gave python manage.py runserver I could find the login page, http://127.0.0.1:8000/admin/ and could login using my login id and password. But as I changed the admin.py with admin.site.register(Question) I could not find the changed view of the login page, rather it is not coming anymore. (b) I was trying to follow the earlier part of the Tutorial given in, https://docs.djangoproject.com/en/1.8/intro/tutorial01/, things were generally fine, but somehow I am failing to follow, def __str__(self): # __unicode__ on Python 2 return self.question_text in models.py, I am not being able to write models.py So, if I use it as, In [12]: Question.objects.all() Out[12]: [] In [13]: from polls.models import Question, Choice In [14]: Question.objects.all() Out[14]: [] In [15]: Question.objects.filter(id=1) Out[15]: [] In [16]: Question.objects.filter(question_text__startswith='What') Out[16]: [] In [17]: from polls.models import Question, Choice In [18]: Question.objects.all() Out[18]: [] In [19]: Question.objects.filter(id=1) Out[19]: [] I am not getting the desired output. If any one may kindly suggest what is the error I am doing. Thanks in advance, Regards, Subhabrata Banerjee. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/547a0366-b238-4c13-9978-e57450f84d6c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Two questions on Django Tutorial.
Thanks Tim. It worked. Regards, Subhabrata Banerjee. On Monday, May 11, 2015 at 11:02:50 PM UTC+5:30, Tim Graham wrote: > > You are using Python 2, but the tutorial is written for Python 3 as noted > in part 1. If you aren't willing to switch to Python 3, you can rename the > __str__ method to __unicode__ as the comment indicates. > > On Monday, May 11, 2015 at 12:35:39 PM UTC-4, SUBHABRATA BANERJEE wrote: >> >> Dear Group, >> >> I am very new to Django, and started with Django on Windows. I am using >> Python 2.7.9. I have some >> issues learning it. >> >> (a) I was following the Tutorial given in >> https://docs.djangoproject.com/en/1.8/intro/tutorial02/ >> <https://www.google.com/url?q=https%3A%2F%2Fdocs.djangoproject.com%2Fen%2F1.8%2Fintro%2Ftutorial02%2F&sa=D&sntz=1&usg=AFQjCNHffHqfKvFsEfpND42pwKYxOJg7JA> >> It is generally going fine I am using, 1.8.1 of Django as given in >> >>> django.get_version() >> '1.8.1' >> Here as I gave >> python manage.py runserver >> I could find the login page, http://127.0.0.1:8000/admin/ and could >> login using my login id and password. >> But as I changed the admin.py with admin.site.register(Question) I could >> not find the changed view of the login page, rather it is >> not coming anymore. >> >> (b) I was trying to follow the earlier part of the Tutorial given in, >> https://docs.djangoproject.com/en/1.8/intro/tutorial01/, things were >> generally fine, >> but somehow I am failing to follow, >> def __str__(self): # __unicode__ on Python 2 >> return self.question_text >> in models.py, I am not being able to write models.py >> So, if I use it as, >> In [12]: Question.objects.all() >> Out[12]: [] >> >> In [13]: from polls.models import Question, Choice >> >> In [14]: Question.objects.all() >> Out[14]: [] >> >> In [15]: Question.objects.filter(id=1) >> Out[15]: [] >> >> In [16]: Question.objects.filter(question_text__startswith='What') >> Out[16]: [] >> >> In [17]: from polls.models import Question, Choice >> >> In [18]: Question.objects.all() >> Out[18]: [] >> >> In [19]: Question.objects.filter(id=1) >> Out[19]: [] >> >> I am not getting the desired output. >> >> If any one may kindly suggest what is the error I am doing. >> >> Thanks in advance, >> Regards, >> Subhabrata Banerjee. >> >> >> >> >> >> >> >> >> >> > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f62c17e2-9ccc-4647-a194-ca8a06807ae2%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
REST Beginner's Tutorial
Dear Group, I have just started with Django and like to practice bit of REST. If anyone may kindly suggest a beginners Tutorial for the same. I am using Python 2.7.9 on MS-Windows 7 Professional. Regards, Subhabrata Banerjee. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3a83299b-3dec-4096-8491-2def68ff2e7e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: REST Beginner's Tutorial
Dear Sir, Thank you for your kind suggestion. But as I was using it I found an error as, Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\Admin>cd\ C:\>cd Python27 C:\Python27>cd Lib C:\Python27\Lib>cd site-packages C:\Python27\Lib\site-packages>cd django C:\Python27\Lib\site-packages\django>dir Volume in drive C has no label. Volume Serial Number is 5EDF-8D6A Directory of C:\Python27\Lib\site-packages\django 05/12/2015 05:31 PM . 05/12/2015 05:31 PM .. 05/11/2015 08:51 PM apps 05/11/2015 08:55 PM bin 03/20/2015 11:03 AM conf 05/11/2015 08:52 PM contrib 05/11/2015 08:52 PM core 05/11/2015 08:52 PM db 05/11/2015 08:52 PM dispatch 05/11/2015 08:52 PM forms 03/20/2015 11:03 AM http 05/11/2015 08:52 PM middleware 05/12/2015 02:17 PM mysite 05/12/2015 05:36 PM rest_example 03/20/2015 11:03 AM shortcuts 05/11/2015 08:51 PM 7,977 shortcuts.py 05/11/2015 08:51 PM 7,328 shortcuts.pyc 05/11/2015 08:52 PM template 03/20/2015 11:03 AM templatetags 05/11/2015 08:52 PM test 05/12/2015 04:07 PM tutorial 05/11/2015 08:52 PM utils 03/20/2015 11:03 AM views 05/11/2015 08:51 PM 519 __init__.py 05/11/2015 08:51 PM 968 __init__.pyc 10/21/2013 07:53 AM 463 __init__.pyo 5 File(s) 17,255 bytes 21 Dir(s) 112,989,847,552 bytes free C:\Python27\Lib\site-packages\django>cd rest_example C:\Python27\Lib\site-packages\django\rest_example>dir Volume in drive C has no label. Volume Serial Number is 5EDF-8D6A Directory of C:\Python27\Lib\site-packages\django\rest_example 05/12/2015 05:36 PM . 05/12/2015 05:36 PM .. 05/12/2015 05:36 PM36,864 db.sqlite3 05/12/2015 05:31 PM 255 manage.py 05/12/2015 05:42 PM restapp 05/12/2015 05:46 PM rest_example 2 File(s) 37,119 bytes 4 Dir(s) 112,989,847,552 bytes free C:\Python27\Lib\site-packages\django\rest_example>python manage.py runserver Performing system checks... System check identified no issues (0 silenced). You have unapplied migrations; your app may not work properly until they are app lied. Run 'python manage.py migrate' to apply them. May 12, 2015 - 17:58:41 Django version 1.8.1, using settings 'rest_example.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CTRL-BREAK. [12/May/2015 18:03:01]"GET /admin/ HTTP/1.1" 500 71214 ^C C:\Python27\Lib\site-packages\django\rest_example>cd.. C:\Python27\Lib\site-packages\django>dir Volume in drive C has no label. Volume Serial Number is 5EDF-8D6A Directory of C:\Python27\Lib\site-packages\django 05/12/2015 05:31 PM . 05/12/2015 05:31 PM .. 05/11/2015 08:51 PM apps 05/11/2015 08:55 PM bin 03/20/2015 11:03 AM conf 05/11/2015 08:52 PM contrib 05/11/2015 08:52 PM core 05/11/2015 08:52 PM db 05/11/2015 08:52 PM dispatch 05/11/2015 08:52 PM forms 03/20/2015 11:03 AM http 05/11/2015 08:52 PM middleware 05/12/2015 02:17 PM mysite 05/12/2015 05:36 PM rest_example 03/20/2015 11:03 AM shortcuts 05/11/2015 08:51 PM 7,977 shortcuts.py 05/11/2015 08:51 PM 7,328 shortcuts.pyc 05/11/2015 08:52 PM template 03/20/2015 11:03 AM templatetags 05/11/2015 08:52 PM test 05/12/2015 04:07 PM tutorial 05/11/2015 08:52 PM utils 03/20/2015 11:03 AM views 05/11/2015 08:51 PM 519 __init__.py 05/11/2015 08:51 PM 968 __init__.pyc 10/21/2013 07:53 AM 463 __init__.pyo 5 File(s) 17,255 bytes 21 Dir(s) 112,988,057,600 bytes free C:\Python27\Lib\site-packages\django>cd tutorial C:\Python27\Lib\site-packages\django\tutorial>python ./manage.py runserver Performing system checks... System check identified no issues (0 silenced). You have unapplied migrations; your app may not work properly until they are app lied. Run 'python manage.py migrate' to apply them. May 12, 2015 - 18:07:40 Django version 1.8.1, using settings 'tutorial.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CTRL-BREAK. [12/May/2015 18:08:13]"GET /users/ HTTP/1.1" 500 82396 How to fix it? If anyone may kindly suggest? Regards, Subhabrata Banerjee.
Re: REST Beginner's Tutorial
Thank you Sir, for your kind reply. I ran python manage.py migrate and then issue was fixed at command prompt, but as I tried the http://127.0.0.1/ ... I initially got few indentation errors etc. but the issue seems now fixed as I tried to fix those minor errors. Regards, Subhabrata Banerjee. On Tuesday, May 12, 2015 at 6:32:58 PM UTC+5:30, Guilherme Leal wrote: > > The get status 500 "per se" may or may not be an error. Please, send the > traceback of the error, otherwise, we can't help you much. > > Em ter, 12 de mai de 2015 às 10:00, Guilherme Leal > escreveu: > >> Sorry, but despite the fact that you have unapplied migrations, there is >> no error on your app. >> >> (To apply the migrations, simply run *python manage.py migrate*) >> >> Em ter, 12 de mai de 2015 às 09:45, SUBHABRATA BANERJEE < >> subhabrat...@gmail.com > escreveu: >> >>> Dear Sir, >>> >>> Thank you for your kind suggestion. But as I was using it I found an >>> error as, >>> Microsoft Windows [Version 6.1.7601] >>> Copyright (c) 2009 Microsoft Corporation. All rights reserved. >>> >>> C:\Users\Admin>cd\ >>> >>> C:\>cd Python27 >>> >>> C:\Python27>cd Lib >>> >>> C:\Python27\Lib>cd site-packages >>> >>> C:\Python27\Lib\site-packages>cd django >>> >>> C:\Python27\Lib\site-packages\django>dir >>> Volume in drive C has no label. >>> Volume Serial Number is 5EDF-8D6A >>> >>> Directory of C:\Python27\Lib\site-packages\django >>> >>> 05/12/2015 05:31 PM . >>> 05/12/2015 05:31 PM .. >>> 05/11/2015 08:51 PM apps >>> 05/11/2015 08:55 PM bin >>> 03/20/2015 11:03 AM conf >>> 05/11/2015 08:52 PM contrib >>> 05/11/2015 08:52 PM core >>> 05/11/2015 08:52 PM db >>> 05/11/2015 08:52 PM dispatch >>> 05/11/2015 08:52 PM forms >>> 03/20/2015 11:03 AM http >>> 05/11/2015 08:52 PM middleware >>> 05/12/2015 02:17 PM mysite >>> 05/12/2015 05:36 PM rest_example >>> 03/20/2015 11:03 AM shortcuts >>> 05/11/2015 08:51 PM 7,977 shortcuts.py >>> 05/11/2015 08:51 PM 7,328 shortcuts.pyc >>> 05/11/2015 08:52 PM template >>> 03/20/2015 11:03 AM templatetags >>> 05/11/2015 08:52 PM test >>> 05/12/2015 04:07 PM tutorial >>> 05/11/2015 08:52 PM utils >>> 03/20/2015 11:03 AM views >>> 05/11/2015 08:51 PM 519 __init__.py >>> 05/11/2015 08:51 PM 968 __init__.pyc >>> 10/21/2013 07:53 AM 463 __init__.pyo >>>5 File(s) 17,255 bytes >>> 21 Dir(s) 112,989,847,552 bytes free >>> >>> C:\Python27\Lib\site-packages\django>cd rest_example >>> >>> C:\Python27\Lib\site-packages\django\rest_example>dir >>> Volume in drive C has no label. >>> Volume Serial Number is 5EDF-8D6A >>> >>> Directory of C:\Python27\Lib\site-packages\django\rest_example >>> >>> 05/12/2015 05:36 PM . >>> 05/12/2015 05:36 PM .. >>> 05/12/2015 05:36 PM36,864 db.sqlite3 >>> 05/12/2015 05:31 PM 255 manage.py >>> 05/12/2015 05:42 PM restapp >>> 05/12/2015 05:46 PM rest_example >>>2 File(s) 37,119 bytes >>>4 Dir(s) 112,989,847,552 bytes free >>> >>> C:\Python27\Lib\site-packages\django\rest_example>python manage.py >>> runserver >>> Performing system checks... >>> >>> System check identified no issues (0 silenced). >>> >>> You have unapplied migrations; your app may not work properly until they >>> are app >>> lied. >>> Run 'python manage.py migrate' to apply them. >>> May 12, 2015 - 17:58:41 >>> Django version 1.8.1, using settings 'rest_example.settings' >>> Starting development server at http://127.0.0.1:8000/ >>> Quit the server with CTRL-BREAK. >>> [12/May/2015 18:03:01]"GET /admin/ HTTP/1.1" 500 71214 >>> ^C >>> C:\Python27\Lib\site-packages\django\rest_example>cd.. >>
Interaction of Python Code with Django.
Dear Group, I want to integrate an interactive Python code, (it takes user input, processes input and gives output), with Django. I am new to Django, using Python2.7.9 on Windows 7 Professional. I am researching on it, but as it is a room for Django experts, I am trying to post this question, if anyone may kindly suggest how may I proceed? An example or web based tutorial would be great. Regards, Subhabrata Banerjee. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/10699b8a-3e40-42e6-a131-85d78e55a5ec%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Interaction of Python Code with Django.
Thanks Palansh. I have few questions here. a) I saw you have created a job search engine. I found its html source. Nice. b) I found your Django codes. My questions are, i) Where you are calling html source in your django code. ii) Is there any tutorial to learn this? I wanted to know it. Thanks Gergely, I am trying to check pexpect. Regards, Subhabrata Banerjee. On Tuesday, May 12, 2015 at 8:36:32 PM UTC+5:30, palansh agarwal wrote: > > Hi, > https://github.com/py-geek/Startup-job-search > look at the code in this repo an try to understand. It's a simple job > search portal developed by me. A simple way is to use a simple HTML form > and map it's action attribute to a url. map that url to a method in your > urls.py file. write this method in your viws.py file. Put all your logic in > this method and return the result appropriately. > Regards, > > On Tue, May 12, 2015 at 8:29 PM, SUBHABRATA BANERJEE < > subhabrat...@gmail.com > wrote: > >> Dear Group, >> >> I want to integrate an interactive Python code, (it takes user input, >> processes input and gives output), with Django. >> I am new to Django, using Python2.7.9 on Windows 7 Professional. >> >> I am researching on it, but as it is a room for Django experts, I am >> trying to post this >> question, if anyone may kindly suggest how may I proceed? An example or >> web based tutorial would be great. >> >> Regards, >> Subhabrata Banerjee. >> >> -- >> 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 http://groups.google.com/group/django-users. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/10699b8a-3e40-42e6-a131-85d78e55a5ec%40googlegroups.com >> >> <https://groups.google.com/d/msgid/django-users/10699b8a-3e40-42e6-a131-85d78e55a5ec%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > PALANSH AGARWAL > Y13UC185 > Computer Science Engineering > 2nd Year > The LNM Institute of Information Technology, Jaipur > Find me on-> http://pygeek.strikingly.com/ > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f20afe04-b76d-4644-ad50-80127f9025cc%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Interaction of Python Code with Django.
Hi Palansh, Thank you for your prompt answer, is it, return HttpResponse(template.render(context)) https://docs.djangoproject.com/en/1.8/intro/tutorial03/ under Write views that actually do something and you have worked out views.py Regards, Subhabrata Banerjee. On Wednesday, May 13, 2015 at 3:13:54 PM UTC+5:30, palansh agarwal wrote: > > Hello, > I suggest you go through django official docs first. The methods in > views.py returns response on a HTML templates. Look for them and try to > understand the workflow. > > On Wed, May 13, 2015 at 3:10 PM, SUBHABRATA BANERJEE < > subhabrat...@gmail.com > wrote: > >> Thanks Palansh. I have few questions here. >> a) I saw you have created a job search engine. I found its html source. >> Nice. >> b) I found your Django codes. >> My questions are, >> i) Where you are calling html source in your django code. >> ii) Is there any tutorial to learn this? I wanted to know it. >> >> Thanks Gergely, I am trying to check pexpect. >> >> Regards, >> Subhabrata Banerjee. >> >> On Tuesday, May 12, 2015 at 8:36:32 PM UTC+5:30, palansh agarwal wrote: >>> >>> Hi, >>> https://github.com/py-geek/Startup-job-search >>> look at the code in this repo an try to understand. It's a simple job >>> search portal developed by me. A simple way is to use a simple HTML form >>> and map it's action attribute to a url. map that url to a method in your >>> urls.py file. write this method in your viws.py file. Put all your logic in >>> this method and return the result appropriately. >>> Regards, >>> >>> On Tue, May 12, 2015 at 8:29 PM, SUBHABRATA BANERJEE < >>> subhabrat...@gmail.com> wrote: >>> >>>> Dear Group, >>>> >>>> I want to integrate an interactive Python code, (it takes user input, >>>> processes input and gives output), with Django. >>>> I am new to Django, using Python2.7.9 on Windows 7 Professional. >>>> >>>> I am researching on it, but as it is a room for Django experts, I am >>>> trying to post this >>>> question, if anyone may kindly suggest how may I proceed? An example or >>>> web based tutorial would be great. >>>> >>>> Regards, >>>> Subhabrata Banerjee. >>>> >>>> -- >>>> 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 http://groups.google.com/group/django-users. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/django-users/10699b8a-3e40-42e6-a131-85d78e55a5ec%40googlegroups.com >>>> >>>> <https://groups.google.com/d/msgid/django-users/10699b8a-3e40-42e6-a131-85d78e55a5ec%40googlegroups.com?utm_medium=email&utm_source=footer> >>>> . >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> >>> >>> -- >>> PALANSH AGARWAL >>> Y13UC185 >>> Computer Science Engineering >>> 2nd Year >>> The LNM Institute of Information Technology, Jaipur >>> Find me on-> http://pygeek.strikingly.com/ >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to django-users...@googlegroups.com . >> To post to this group, send email to django...@googlegroups.com >> . >> Visit this group at http://groups.google.com/group/django-users. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/f20afe04-b76d-4644-ad50-80127f9025cc%40googlegroups.com >> >> <https://groups.google.com/d/msgid/django-users/f20afe04-b76d-4644-ad50-80127f9025cc%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > PALANSH AGARWAL > Y13UC185 > Computer Science Engineering > 2nd Year > The LNM Institute of Information Technology, Jaipur > Find me on-> http://pygeek.strikingly.com/ > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d9510a20-4731-4a84-a8ee-fd1949b770a9%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Interaction of Python Code with Django.
Thanks, but that is more or less on Flask. In Django I could do Rest with restonframeworks. Now I have to integrate it with my existing code in Python. Palansh has developed almost similar but I am looking for an interactive rest based django api for my interactive python code. Seems bit stuck. Web search is not giving much help. If any one may kindly suggest. Regards, Subhabrata Banerjee. On Wednesday, May 13, 2015 at 4:28:28 PM UTC+5:30, sarfaraz ahmed wrote: > > werkzeug is another debug tool which let you write and test code via > browser itself. > > Regards, > Sarfaraz Ahmed > > On Wed, May 13, 2015 at 3:43 PM, SUBHABRATA BANERJEE < > subhabrat...@gmail.com > wrote: > >> Hi Palansh, >> >> Thank you for your prompt answer, is it, >> return HttpResponse(template.render(context)) >> >> https://docs.djangoproject.com/en/1.8/intro/tutorial03/ >> under >> Write views that actually do something >> and you have worked out views.py >> >> Regards, >> Subhabrata Banerjee. >> >> >> On Wednesday, May 13, 2015 at 3:13:54 PM UTC+5:30, palansh agarwal wrote: >>> >>> Hello, >>> I suggest you go through django official docs first. The methods in >>> views.py returns response on a HTML templates. Look for them and try to >>> understand the workflow. >>> >>> On Wed, May 13, 2015 at 3:10 PM, SUBHABRATA BANERJEE < >>> subhabrat...@gmail.com> wrote: >>> >>>> Thanks Palansh. I have few questions here. >>>> a) I saw you have created a job search engine. I found its html source. >>>> Nice. >>>> b) I found your Django codes. >>>> My questions are, >>>> i) Where you are calling html source in your django code. >>>> ii) Is there any tutorial to learn this? I wanted to know it. >>>> >>>> Thanks Gergely, I am trying to check pexpect. >>>> >>>> Regards, >>>> Subhabrata Banerjee. >>>> >>>> On Tuesday, May 12, 2015 at 8:36:32 PM UTC+5:30, palansh agarwal wrote: >>>>> >>>>> Hi, >>>>> https://github.com/py-geek/Startup-job-search >>>>> look at the code in this repo an try to understand. It's a simple job >>>>> search portal developed by me. A simple way is to use a simple HTML form >>>>> and map it's action attribute to a url. map that url to a method in your >>>>> urls.py file. write this method in your viws.py file. Put all your logic >>>>> in >>>>> this method and return the result appropriately. >>>>> Regards, >>>>> >>>>> On Tue, May 12, 2015 at 8:29 PM, SUBHABRATA BANERJEE < >>>>> subhabrat...@gmail.com> wrote: >>>>> >>>>>> Dear Group, >>>>>> >>>>>> I want to integrate an interactive Python code, (it takes user input, >>>>>> processes input and gives output), with Django. >>>>>> I am new to Django, using Python2.7.9 on Windows 7 Professional. >>>>>> >>>>>> I am researching on it, but as it is a room for Django experts, I am >>>>>> trying to post this >>>>>> question, if anyone may kindly suggest how may I proceed? An example >>>>>> or web based tutorial would be great. >>>>>> >>>>>> Regards, >>>>>> Subhabrata Banerjee. >>>>>> >>>>>> -- >>>>>> 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 http://groups.google.com/group/django-users. >>>>>> To view this discussion on the web visit >>>>>> https://groups.google.com/d/msgid/django-users/10699b8a-3e40-42e6-a131-85d78e55a5ec%40googlegroups.com >>>>>> >>>>>> <https://groups.google.com/d/msgid/django-users/10699b8a-3e40-42e6-a131-85d78e55a5ec%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>>> . >>>>>> For more options, visit https://groups.google.com/d/optout. >>>>>> >>>>> >>>>> >>>>> >&
Re: Interaction of Python Code with Django.
Hi Palansh, May I ask you two or three quick questions. a) Am I understanding fine? b) I wrote a Python Script, and wanted to port it with Django restonframework. I could do upto Django restonframework. How may I go next? If you may kindly suggest. Regards, Subhabrata Banerjee. On Tuesday, May 12, 2015 at 8:36:32 PM UTC+5:30, palansh agarwal wrote: > > Hi, > https://github.com/py-geek/Startup-job-search > look at the code in this repo an try to understand. It's a simple job > search portal developed by me. A simple way is to use a simple HTML form > and map it's action attribute to a url. map that url to a method in your > urls.py file. write this method in your viws.py file. Put all your logic in > this method and return the result appropriately. > Regards, > > On Tue, May 12, 2015 at 8:29 PM, SUBHABRATA BANERJEE < > subhabrat...@gmail.com > wrote: > >> Dear Group, >> >> I want to integrate an interactive Python code, (it takes user input, >> processes input and gives output), with Django. >> I am new to Django, using Python2.7.9 on Windows 7 Professional. >> >> I am researching on it, but as it is a room for Django experts, I am >> trying to post this >> question, if anyone may kindly suggest how may I proceed? An example or >> web based tutorial would be great. >> >> Regards, >> Subhabrata Banerjee. >> >> -- >> 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 http://groups.google.com/group/django-users. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/10699b8a-3e40-42e6-a131-85d78e55a5ec%40googlegroups.com >> >> <https://groups.google.com/d/msgid/django-users/10699b8a-3e40-42e6-a131-85d78e55a5ec%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > PALANSH AGARWAL > Y13UC185 > Computer Science Engineering > 2nd Year > The LNM Institute of Information Technology, Jaipur > Find me on-> http://pygeek.strikingly.com/ > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/91b284e6-d373-4785-8658-bc894f6f33db%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
User defined API for Django Rest-Framework
Dear Group, I am trying to design API on Rest framework on Django. I could make one Browsable API as given in http://www.django-rest-framework.org/tutorial/quickstart/. I am looking to change the views, to user defined views. If anyone may kindly suggest how may I do it? I am pretty new in Django and working on Python2.7+ on Windows 7 Professional. Thanks in advance, Subhabrata Banerjee. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4323b1de-feee-42e5-bc74-2dfe77ae5e5a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
File Upload in Django
Dear Group, I want to upload file and form in Django. I am using Django 1.8 on Windows 2.7+ on Windows 7 Professional. I am bit new and I was confused how may I upload file and form in Django. If anyone may kindly show me an example tutorial. I tried some examples on Github and stackoverflow but not of much help. Regards, Subhabrata Banerjee. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e94e0724-f243-43d2-834f-f7a41652fcac%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Post Error
Dear Group, I was trying to write a RestDjango Application with the help of a web based book available from https://www.safaribooksonline.com/library/view/lightweight-django/9781491946275/ch04.html Project's folder structure is as follows, tutoriall/ tutoriall/ migrations/ _init_.py _init_.py admin.py models.py serializers.py tests.py views.py quickstart/ __init__.py settings.py urls.py wsgi.py db.sqlite3 manage.py I am writing the tutoriall/tutoriall/serializer.py as follows: from rest_framework import serializers from .models import Sprint class SprintSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Sprint #fields = ('id','name','description') fields = ('name','description') I am writing tutoriall/tutoriall/models.py as follows: from django.db import models # Create your models here. from django.conf import settings from django.db import models from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _ class Sprint(models.Model): """Development iteration period.""" name = models.CharField(max_length=100, blank=True, default='') description = models.TextField(blank=True, default='') end = models.DateField(unique=True) def __unicode__(self): return self.name or _('Sprint ending %s') % self.end class Task(models.Model): """Unit of work to be done for the sprint.""" STATUS_TODO = 1 STATUS_IN_PROGRESS = 2 STATUS_TESTING = 3 STATUS_DONE = 4 STATUS_CHOICES = ( (STATUS_TODO, _('Not Started')), (STATUS_IN_PROGRESS, _('In Progress')), (STATUS_TESTING, _('Testing')), (STATUS_DONE, _('Done')), ) name = models.CharField(max_length=100) description = models.TextField(blank=False, default='') sprint = models.ForeignKey(Sprint, blank=True, null=True) status = models.SmallIntegerField(choices=STATUS_CHOICES, default=STATUS_TODO) order = models.SmallIntegerField(default=0) assigned = models.ForeignKey(settings.AUTH_USER_MODEL, null=True, blank=True) started = models.DateField(blank=True, null=True) due = models.DateField(blank=True, null=True) completed = models.DateField(blank=True, null=True) def __unicode__(self): return self.name I am writing tutoriall/tutoriall/views.py as follows: from django.shortcuts import render from django.contrib.auth.models import User, Group from rest_framework import viewsets from models import Sprint from serializers import SprintSerializer class UserViewSet(viewsets.ModelViewSet): """ API endpoint that allows users to be viewed or edited. """ queryset = User.objects.all() serializer_class = SprintSerializer I am writing tutoriall/quickstart/urls.py as follows: from django.contrib import admin from django.conf.urls import url, include from rest_framework import routers from quickstart import views from rest_framework.authtoken.views import obtain_auth_token router = routers.DefaultRouter() router.register(r'users', views.UserViewSet) #Wire up our API using automatic URL routing. # Additionally, we include login URLs for the browsable API. urlpatterns = [ url(r'^', include(router.urls)), url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')), url(r'^admin/', include(admin.site.urls)), url(r'^api/token/', obtain_auth_token, name='api-token') ] As I am running it I am getting the command as, C:\Python27\Lib\site-packages\django\tutoriall>python ./manage.py runserver Performing system checks... System check identified no issues (0 silenced). May 20, 2015 - 13:44:01 Django version 1.8.1, using settings 'tutoriall.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CTRL-BREAK. I am getting the screen as this: Given as attached .docx file. but as I am trying to post I am getting the following error. Request Method: POST Request URL: http://127.0.0.1:8000/users/ Django Version: 1.8.1 Exception Type: OperationalError Exception Value: no such table: quickstart_sprint I have slightly changed few names of folders, and I am using Python2.7+ on Windows 7 Professional. If any one may kindly suggest the error I am doing. Regards, Subhabrata Banerjee. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a15a0ac3-c872-4640-a472-2e6fc04e972d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.