Re: Django Queries

2018-05-11 Thread Joseph Mutumi
Hello, You need to clearly understand Python objects because the ORM maps fields directly to that. Please check out: https://docs.djangoproject.com/en/2.0/topics/db/queries/ So if you print out the object as a string i.e. people = People.objects.al() print people OR person = People.objects.ge

Re: Django Queries

2018-05-11 Thread Gerald Brown
I was getting the same as you are as I had just first_name & last_name set in the "def __str__(self)".  I added a couple of more fields to that statement but they are still not showing up even after running a makemigration which says "No Change" I tried "p.address" but it gave me an error mess

Re: Django Queries

2018-05-11 Thread Gerald Brown
Thanks for your reply. My model consists of the following: id, first_name, last_name, middle_initial, contact_num, address, town(FK to Town table), date_of_birth, occupation(FK to Occupation table), email & gender. The Django query returns ONLY first_name & last_name. I run migrations after

Re: Django Queries

2018-05-11 Thread Mark Phillips
Please provide the exact output you are seeing. It may be that the output has been truncated, which is correct behavior. For example, when I run this query on the command line for my model Document, >>> Document.objects.all() , , , ]> I get a QuerySet with 4 entries, as there are 4 rows/records

Re: Django Queries

2018-05-11 Thread Joseph Mutumi
Hello, That's strange what does your people model look like? Notice it will only populate the fields you have defined in the model not the columns of the table in the database. Did you run migrations after adding new fields to the model? $ python manage.py migrate Kind regards On Sat, May 12, 2

Django Queries

2018-05-11 Thread Gerald Brown
Greetings: I have just started to use Django Queries and I am having some problems. When i use the query: "p = People.objects.all()" & then "p" it shows just the lastname & firstname fields even though there are many more fields in the table. I thought ALL means ALL, ALL fields & ALL records

Re: IOError when trying to send email in Django app

2018-05-11 Thread James Farris
You probably already have but check the docs https://docs.djangoproject.com/en/2.0/topics/email/ And your postfix configurations (or whatever email send system you are using) On Fri, May 11, 2018 at 12:07 PM Tom Tanner wrote: > I have a Django app running on a server with uWSGI and nginx. > > I

Re: python django group

2018-05-11 Thread James Farris
What errors ? On Fri, May 11, 2018 at 4:41 PM Akinyiga Obadamilare < akinyigaobad...@gmail.com> wrote: > please, when I run my server in local host after creating my polls app in > django but it did not show the presence of polls app in my local host > instead of it to display the presence of adm

python django group

2018-05-11 Thread Akinyiga Obadamilare
please, when I run my server in local host after creating my polls app in django but it did not show the presence of polls app in my local host instead of it to display the presence of admin and polls app, to run the python manage.py make migration polls was was giving me error -- You received

How to make queries using Mysql JSON field and django 2

2018-05-11 Thread Mark Phillips
I have a model Document that has a json field "metadata" containing a dictionary of different values. One example: {"Orientation": "Landscape", "Address": "Bethany Home Road", "Photo Type": "Many People", "a boolean": false, "Person": ["Sam Smith", "Hank Jones"], "Date": "05/13/2018", "Location":

IOError when trying to send email in Django app

2018-05-11 Thread Tom Tanner
I have a Django app running on a server with uWSGI and nginx. In my `local_settings.py` file I have this: ### # EMAIL SETUP # ### EMAIL_HOST = 'smtp.privateemail.com' EMAIL_HOST_USER = 'supp...@mydomain.com' EMAIL_HOST_PASSWORD = 'MY EMAIL PASSWORD

RE: Deploy on windows IIS

2018-05-11 Thread Matthew Pava
I just go straight to the source or Google around. https://httpd.apache.org/docs/2.4/platform/windows.html Apache has different flavors for Windows. We’re either using ApacheHaus or Apache Lounge. From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Majid Hoja

Re: Deploy on windows IIS

2018-05-11 Thread Majid Hojati
Is there any good tuturial which I can use Apache? I am also using Geoserver which runs on tomcat port 8080 I hope it does not make any problems On Friday, May 11, 2018 at 10:55:45 PM UTC+4:30, Matthew Pava wrote: > > I know it doesn’t directly answer your question, but I have Django running >

RE: Deploy on windows IIS

2018-05-11 Thread Matthew Pava
I know it doesn’t directly answer your question, but I have Django running on Windows Server 2012. After wrestling with IIS for just a bit, I decided to just use Apache instead. From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Majid Hojati Sent: Friday, M

Re: While going through the django tutorial i stuck while writing a code i.e., automated test.And error is showing with some tracebacks.I tried to resolve the error but i failed.Please help me to reso

2018-05-11 Thread Avitab Ayan Sarmah
hey Dylan, two days ago anthony said to troubleshoot myself, the answer was there only.Since i am a beginer i tried myself but couldn't find out the error also i was tired as i just reached from office and started questioning On Friday, May 11, 2018 at 11:19:43 PM UTC+5:30, Dylan Reinhold wrote:

Deploy on windows IIS

2018-05-11 Thread Majid Hojati
Hi, I have faced a problem while deploying django on windows server 2008 with IIS I followed this http://blog.mattwoodward.com/2016/07/running-django-application-on-windows.html and it returns unexpectedly exited error. I am using python 3.6 and the development pythons server runs with no probl

Deploy on windows server 2008 and IIS

2018-05-11 Thread Majid Hojati
Hi, I followed this http://blog.mattwoodward.com/2016/07/running-django-application-on-windows.html to deploy django on windows server 2008 and IIS but at the last step it returns 500 error, it says wfastcgi.py unexpectedly exit. What Other options do I have to fix this problem, I am on python 3

Re: While going through the django tutorial i stuck while writing a code i.e., automated test.And error is showing with some tracebacks.I tried to resolve the error but i failed.Please help me to reso

2018-05-11 Thread Dylan Reinhold
Is it grounds hogs day, didn't this exact error get asked two days ago and Daniel answered then? On Fri, May 11, 2018 at 10:40 AM, Daniel Hepper wrote: > The error message is a hint that Django is not properly initialized. > > My guess is that you are using a plain python shell, which you starte

Re: While going through the django tutorial i stuck while writing a code i.e., automated test.And error is showing with some tracebacks.I tried to resolve the error but i failed.Please help me to reso

2018-05-11 Thread Avitab Ayan Sarmah
ok ok i got it thanks On Friday, May 11, 2018 at 11:11:00 PM UTC+5:30, Daniel Hepper wrote: > > The error message is a hint that Django is not properly initialized. > > My guess is that you are using a plain python shell, which you started > using the command „python“. > > Use „python manage.py s

Re: While going through the django tutorial i stuck while writing a code i.e., automated test.And error is showing with some tracebacks.I tried to resolve the error but i failed.Please help me to reso

2018-05-11 Thread Avitab Ayan Sarmah
i wrote the code inside mysite directory but still the error shows On Friday, May 11, 2018 at 11:11:00 PM UTC+5:30, Daniel Hepper wrote: > > The error message is a hint that Django is not properly initialized. > > My guess is that you are using a plain python shell, which you started > using the

Re: While going through the django tutorial i stuck while writing a code i.e., automated test.And error is showing with some tracebacks.I tried to resolve the error but i failed.Please help me to reso

2018-05-11 Thread Daniel Hepper
The error message is a hint that Django is not properly initialized. My guess is that you are using a plain python shell, which you started using the command „python“. Use „python manage.py shell“ instead. As explained in part 2 of the tutorial, this properly initializes Django. Hope that help

While going through the django tutorial i stuck while writing a code i.e., automated test.And error is showing with some tracebacks.I tried to resolve the error but i failed.Please help me to resolve

2018-05-11 Thread Avitab Ayan Sarmah
Exceptions: Type "help", "copyright", "credits" or "license" for more information. >>> import datetime >>> from django.utils import timezone >>> from polls.models import Question Traceback (most recent call last): File "", line 1, in File "C:\Users\AVITABAYAN\mysite\polls\models.py", line 7,

Re: 400 error, nginx debug log confusion, Django app

2018-05-11 Thread Tom Tanner
I ran `sudo reboot` and `sudo service nginx configtest && sudo service nginx restart`. Now the site loads just fine. I don't know which of those two commands did it. On Friday, May 11, 2018 at 12:22:11 PM UTC-4, Tom Tanner wrote: > > Note: `mydomain.com` is not my real domain name. > > When I go

400 error, nginx debug log confusion, Django app

2018-05-11 Thread Tom Tanner
Note: `mydomain.com` is not my real domain name. When I go to `test.mydomain.com`, I get a page that just says `Bad Request (400)`. I'm running a Django app located at `/home/django/product_blog`. Here are the contents of my nginx file at `/etc/nginx/sites-available/BRBR2`. server {

Re: How to debug? -- DoesNotExist at /admin/login/

2018-05-11 Thread mynoveltrans
for people checking this in 2018 you need to check the settings INSTALLED_APPS = [ > > > 'django.contrib.sites', this needs to go or you need to Increment > SITE_ID if you really need the app to be installed > -- You received this message because you are subscribed to the Google Groups "

Re: Display Users Posts also whether it is logged in or logged out

2018-05-11 Thread James Farris
If you want to show posts, which I assume is blog posts or something (not seen in your code) You would add an additional queryset that is passed to your template Something like Posts.objects.filter(user_id=pk) Sent from my mobile device > On May 10, 2018, at 6:45 PM, objectiveapps...@gmail.co

Re: Problem with debug = True/False

2018-05-11 Thread Gerald Brown
Thanks for the info. I will check it out.  I am still in development so it will be awhile before I need it. On Friday, 11 May, 2018 09:06 PM, James Farris wrote: I also recommend going through the deploy checklist. I ran into the same problem and then other problems after that because I didn’t

Re: Problem with debug = True/False

2018-05-11 Thread Gerald Brown
Thanks for the info. I will check it out.  I am still in development so it will be awhile before I need it. On Friday, 11 May, 2018 01:53 PM, Andréas Kühne wrote: Hi, That is the way it should be if you look in the documentation: https://docs.djangoproject.com/en/2.0/howto/static-files/ Serv

Re: Problem with debug = True/False

2018-05-11 Thread James Farris
I also recommend going through the deploy checklist. I ran into the same problem and then other problems after that because I didn’t follow this. https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/ Sent from my mobile device > On May 10, 2018, at 10:53 PM, Andréas Kühne > wrote