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
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
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
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
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
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
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
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
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
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":
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
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
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
>
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
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:
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
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
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
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
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
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
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,
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
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 {
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
"
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
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
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
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
29 matches
Mail list logo