Starting your first app

2018-05-23 Thread Caleb Bryson
Hey I am new to python and i am trying to use django to make my first web 
page. I know the basics of python but i am stuck on the step where you 
start your app. i made sure i have a directory and have installed south to 
help out but when i type "python mange.py startapp blog" it keeps giving me 
"python: can't open file 'manage.py' : [Error 2] No such file or directory" 
( I am using anaconda prompt by the way). 

these are the instructions i was using, and i got all the way down to 
"creating a app"
https://jeffknupp.com/blog/2012/02/09/starting-a-django-project-the-right-way/

If anyone could help i would greatly appreciate it.

-- 
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/1dcd9fa4-2539-4191-a992-2f706d18838a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Starting a poll

2018-05-24 Thread Caleb Bryson
So I am follow the instructions on the django site to make a poll. I am at 
the current step where you run the server and everything went fine when i 
typed in the command. But now it is just there at saying "GET /favicon.ico 
HTTP/1.1" 404 1977 on the last command line. I was wondering should i wait, 
or close the cmd prompt and open a new one to continue the steps, or quit 
the server with CTRL-BREAK(not sure which button represents break on the 
key board)?

-- 
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/e500ed8f-e5b4-4d3b-aced-29f33dfeb7ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Having trouble loading up my poll app

2018-05-28 Thread Caleb Bryson
Hey guys, I am on part 4 of writing your first django app. And I am stuck 
at the part where it says this "Now, go to /polls/1/ in your browser and 
vote in the question. You should see a results page that gets updated each 
time you vote. If you submit the form without having chosen a choice, you 
should see the error message." . I thought I was supposed to use the url 
"http://localhost:8000/polls/1/"; 
but it gave me a error saying "Template does not exist at /polls/1/". I am 
not really sure how to fix this to move on with the tutorial. Does anyone 
know how to get rid of this error?

-- 
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/fc0f2c87-a6c9-4276-b045-2c2caf1d3e3c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Having trouble loading up my poll app

2018-05-28 Thread Caleb Bryson
P.S.: This is my first attempt at setting up a website using django so my 
code may look a little ruff.

here is my urls.py
from django.urls import path

from . import views

urlpatterns = [
path('', views.index, name='index'),

path('/', views.detail, name='detail'),
path('/results/', views.results, name='results'),
path('/vote/', views.vote, name='vote'),
]

app_name = 'polls'
urlpatterns = [
path('', views.index, name='index'),
path('/', views.detail, name='detail'),
path('/results/', views.results, name='results'),
path('/vote/', views.vote, name='vote'),
]

here is my detail.html 
{{ question.question_text }}

{% if error_message %}{{ error_message }}{% endif %}


{% csrf_token %}
{% for choice in question.choice_set.all %}

{{ choice.choice_text 
}}
{% endfor %}



and here is my result.html
{{ question.question_text }}


{% for choice in question.choice_set.all %}
{{ choice.choice_text }} -- {{ choice.votes }} vote{{ 
choice.votes|pluralize }}
{% endfor %}


Vote again?

On Monday, May 28, 2018 at 9:45:41 PM UTC-4, Caleb Bryson wrote:
Hey guys, I am on part 4 of writing your first django app. And I am stuck 
at the part where it says this "Now, go to /polls/1/ in your browser and 
vote in the question. You should see a results page that gets updated each 
time you vote. If you submit the form without having chosen a choice, you 
should see the error message." . I thought I was supposed to use the url "
http://localhost:8000/polls/1/"; but it gave me a error saying "Template 
does not exist at /polls/1/". I am not really sure how to fix this to move 
on with the tutorial. Does anyone know how to get rid of this error?

-- 
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/a940e7c2-24ed-4412-8424-eff83beaf421%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ValueError at /polls/1/vote/

2018-05-29 Thread Caleb Bryson
How would I apply a return for my view here?

from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404, render
from django.urls import reverse
from django.views import generic

from .models import Choice, Question


class IndexView(generic.ListView):
template_name = 'polls/index.html'
context_object_name = 'latest_question_list'

def get_queryset(self):
"""Return the last five published questions."""
return Question.objects.order_by('-pub_date')[:5]


class DetailView(generic.DetailView):
model = Question
template_name = 'polls/detail.html'


class ResultsView(generic.DetailView):
model = Question
template_name = 'polls/results.html'


def vote(request, question_id):
... # same as above, no changes needed. 

On Tuesday, May 29, 2018 at 7:56:03 AM UTC-4, Julio Biason wrote:
>
> View require that you return an HttpResponse object. Your function does 
> not (it probably even lacks a "return").
>
> You need to return the response back in the view.
>
> On Tue, May 29, 2018 at 8:48 AM, Caleb Bryson  > wrote:
>
>> Hey i am getting this error now can anyone help me fix this? and what 
>> code do you need to see to help out?
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/a3a72079-74a0-404f-aedd-828597090663%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/a3a72079-74a0-404f-aedd-828597090663%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> *Julio Biason*, Sofware Engineer
> *AZION*  |  Deliver. Accelerate. Protect.
> Office: +55 51 3083 8101  |  Mobile: +55 51 *99907 0554*
>

-- 
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/ab1fd070-f57d-4cf2-b370-c0953c1d15fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Syntax error

2018-05-30 Thread Caleb Bryson
I can not seem to figure out what the syntax error is in line 7 of this 
code, can anyone help

from django.shortcuts import render

def index(request):
return render(request, 'hybridair/home.html')

def contact(request):
return render(request, 'hybridair/basic.html' {'content' : ['contact the 
team at', 'mar...@flymat21.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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/efe2686c-1e4d-477e-8057-90a81b1bef00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Syntax error

2018-05-30 Thread Caleb Bryson
it did thanks :). and changing the { to ( helped also for anyone view for 
future reference
. 

On Wednesday, May 30, 2018 at 8:48:53 PM UTC-4, Michael MacIntosh wrote:
>
> Hi Caleb,
>
> I think there should be a comma here 
>
> basic.html' {'content'
>
> so it should be
>
> basic.html', {'content'
> Hope that helps!
>
> On 5/30/2018 5:45 PM, Caleb Bryson wrote:
>
> I can not seem to figure out what the syntax error is in line 7 of this 
> code, can anyone help 
>
> from django.shortcuts import render
> def index(request):
> return render(request, 'hybridair/home.html')
> def contact(request):
> return render(request, 'hybridair/basic.html' {'content' : ['contact the 
> team at', 'mar...@flymat21.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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/efe2686c-1e4d-477e-8057-90a81b1bef00%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/efe2686c-1e4d-477e-8057-90a81b1bef00%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
> -- 
> This message has been scanned for viruses and dangerous content by 
> *E.F.A. Project* <http://www.efa-project.org>, and is believed to be 
> clean. 
> Click here to report this message as spam. 
> <http://lsefa1.linear-systems.com/cgi-bin/learn-msg.cgi?id=F23C9100627.AB423&token=cfc190fea6a5055650a1e751b5e05171>
>  
>
>
>

-- 
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/5131b543-4ac1-49a9-8bc2-4bed615606d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Attribute error

2018-05-30 Thread Caleb Bryson
I am getting a attribute error when i try to run my server. does anyone 
know what i can change in this code to fix that?

from django.db import models

class Post(models.Model) :
title = models.Charfield(max_length=140)
body = models.Textfield()
date = models.DataTimeField()

def __str__(self):
return self.title

-- 
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/b0ffbdfa-8eee-4560-9fc1-16849c8fdceb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Attribute error

2018-05-30 Thread Caleb Bryson
it is still saying "AttributeError: model 'django.db.models' has no 
attribute 'Charfeild'

On Wednesday, May 30, 2018 at 10:04:04 PM UTC-4, Mike Dewhirst wrote:
>
> On 31/05/2018 11:45 AM, Caleb Bryson wrote: 
> > I am getting a attribute error when i try to run my server. does 
> > anyone know what i can change in this code to fix that? 
>
> Try indenting the __str__ method so it is within the scope of the Post 
> class 
>
> > 
> > from django.db import models 
> > class Post(models.Model) : 
> > title = models.Charfield(max_length=140) 
> > body = models.Textfield() 
> > date = models.DataTimeField() 
> > def __str__(self): 
> > return self.title 
> > -- 
> > 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  
> > <mailto:django-users+unsubscr...@googlegroups.com >. 
> > To post to this group, send email to django...@googlegroups.com 
>  
> > <mailto:django...@googlegroups.com >. 
> > Visit this group at https://groups.google.com/group/django-users. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/django-users/b0ffbdfa-8eee-4560-9fc1-16849c8fdceb%40googlegroups.com
>  
> > <
> https://groups.google.com/d/msgid/django-users/b0ffbdfa-8eee-4560-9fc1-16849c8fdceb%40googlegroups.com?utm_medium=email&utm_source=footer>.
>  
>
> > 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/e2d17976-18e1-4120-950d-1457858f012b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Attribute error

2018-05-30 Thread Caleb Bryson
I think it was because i did not use camel casing so CharField instead of 
Charfield. I will continue the tutorial and see if that works


On Wednesday, May 30, 2018 at 10:04:04 PM UTC-4, Mike Dewhirst wrote:
>
> On 31/05/2018 11:45 AM, Caleb Bryson wrote: 
> > I am getting a attribute error when i try to run my server. does 
> > anyone know what i can change in this code to fix that? 
>
> Try indenting the __str__ method so it is within the scope of the Post 
> class 
>
> > 
> > from django.db import models 
> > class Post(models.Model) : 
> > title = models.Charfield(max_length=140) 
> > body = models.Textfield() 
> > date = models.DataTimeField() 
> > def __str__(self): 
> > return self.title 
> > -- 
> > 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  
> > <mailto:django-users+unsubscr...@googlegroups.com >. 
> > To post to this group, send email to django...@googlegroups.com 
>  
> > <mailto:django...@googlegroups.com >. 
> > Visit this group at https://groups.google.com/group/django-users. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/django-users/b0ffbdfa-8eee-4560-9fc1-16849c8fdceb%40googlegroups.com
>  
> > <
> https://groups.google.com/d/msgid/django-users/b0ffbdfa-8eee-4560-9fc1-16849c8fdceb%40googlegroups.com?utm_medium=email&utm_source=footer>.
>  
>
> > 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/931b7ebc-430d-4e6c-802f-db0f0c2a1a73%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


href not working

2018-05-30 Thread Caleb Bryson
So i am trying to create a directory with a Home,Blog,and Contact 
selection. But every time i click on one of them they all go back to the 
home page. How do i fix this, and here is the secton of code below. let me 
know if you need to see more


   
Home
Blog
Contact
   
  

-- 
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/9dc7004b-4fff-412d-8560-6308f13db92c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: href not working

2018-05-31 Thread Caleb Bryson


my blog view.py is empty at the moment


Mysite url.py

from django.contrib import admin

from django.conf.urls import url, include

 

urlpatterns = [

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

url(r'^', include( 'hybridair.urls')),

url(r'^blog/$', include( 'blog.urls')),

]

 

 

 

Hybrid Air url.py

from django.conf.urls import url, include

from . import views

urlpatterns = [

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

url(r'^contact/', views.contact, name='contact'),

]

 

 

Hybrid Air view.py

from django.shortcuts import render

 

def index(request):

return render(request, 'hybridair/home.html')

 

def contact(request):

return render(request, 'hybridair/basic.html' ('content' ['contact the 
team at', 'mar...@flymat21.com']))

 

def blog(request):

return render(request, 'hybridair/header.html')

 

 

 

 

 

blog url.py

from django.conf.urls import url, include

from django.views.generic import ListView, DetailView

from blog.models import Post

 

urlpatterns = [

url(r'^$', ListView.as_view(

queryset=Post.objects.order_by('-date')[:25],

template_name="blog/blog.html")),

 

url(r'^(?P\d+)$', DetailView.as_view(model = Post,

template_name='blog/post.html')),

]

Do you see what I need to change?
On Thursday, May 31, 2018 at 4:31:47 AM UTC-4, Mike Dewhirst wrote:
>
> On 31/05/2018 1:56 PM, Caleb Bryson wrote: 
> > So i am trying to create a directory with a Home,Blog,and Contact 
> > selection. But every time i click on one of them they all go back to 
> > the home page. 
>
> It feels like your urls.py is insufficiently fleshed out or maybe your 
> home page url isn't fully formed. Django obviously thinks that whatever 
> is handed in can be interpreted as requesting the home page view. 
>
> For example, I would expect your home page url pattern (url or re_path 
> depending on Django version) might look something like ... 
>
> url_patterns = [ 
>  url(r'^$', home_page_view), 
>  ... 
> ] 
>
> If you have omitted that $ anything will match and your home page view 
> will be called. 
>
> Just a guess 
>
>
> > How do i fix this, and here is the secton of code below. let me know 
> > if you need to see more 
> > 
> >  
> >  
> > Home 
> > Blog 
> > Contact 
> >  
> >  
> > -- 
> > 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  
> > <mailto:django-users+unsubscr...@googlegroups.com >. 
> > To post to this group, send email to django...@googlegroups.com 
>  
> > <mailto:django...@googlegroups.com >. 
> > Visit this group at https://groups.google.com/group/django-users. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/django-users/9dc7004b-4fff-412d-8560-6308f13db92c%40googlegroups.com
>  
> > <
> https://groups.google.com/d/msgid/django-users/9dc7004b-4fff-412d-8560-6308f13db92c%40googlegroups.com?utm_medium=email&utm_source=footer>.
>  
>
> > 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/1fb184b5-04e1-4592-90b4-bafaa4809dbb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: href not working

2018-05-31 Thread Caleb Bryson


my blog view.py is empty at the moment


Mysite url.py

from django.contrib import admin

from django.conf.urls import url, include

 

urlpatterns = [

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

url(r'^', include( 'hybridair.urls')),

url(r'^blog/$', include( 'blog.urls')),

]

 

 

 

Hybrid Air url.py

from django.conf.urls import url, include

from . import views

urlpatterns = [

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

url(r'^contact/', views.contact, name='contact'),

]

 

 

Hybrid Air view.py

from django.shortcuts import render

 

def index(request):

return render(request, 'hybridair/home.html')

 

def contact(request):

return render(request, 'hybridair/basic.html' ('content' ['contact the 
team at', 'mar...@flymat21.com']))

 

def blog(request):

return render(request, 'hybridair/header.html')

 

 

 

 

 

blog url.py

from django.conf.urls import url, include

from django.views.generic import ListView, DetailView

from blog.models import Post

 

urlpatterns = [

url(r'^$', ListView.as_view(

queryset=Post.objects.order_by('-date')[:25],

template_name="blog/blog.html")),

 

url(r'^(?P\d+)$', DetailView.as_view(model = Post,

template_name='blog/post.html')),

]

Do you see what I need to change?

On Thursday, May 31, 2018 at 7:11:46 AM UTC-4, Mohammed Noor wrote:
>
> I think the mistake is using a '/' before the name inside href. Try 
> changing it from href= '/contact'/ to href= 'contact/' 
>
> Have a great day 
>
> On 31-May-2018, at 9:26 AM, Caleb Bryson > 
> wrote:
>
> So i am trying to create a directory with a Home,Blog,and Contact 
> selection. But every time i click on one of them they all go back to the 
> home page. How do i fix this, and here is the secton of code below. let me 
> know if you need to see more
>
> 
>
> Home
> Blog
> Contact
>
>   
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users...@googlegroups.com .
> To post to this group, send email to django...@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/9dc7004b-4fff-412d-8560-6308f13db92c%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/9dc7004b-4fff-412d-8560-6308f13db92c%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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/e7cc8fdf-03a2-4d4e-a8f6-1b949714fbc9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: href not working

2018-05-31 Thread Caleb Bryson


my blog view.py is empty at the moment


Mysite url.py

from django.contrib import admin

from django.conf.urls import url, include

 

urlpatterns = [

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

url(r'^', include( 'hybridair.urls')),

url(r'^blog/$', include( 'blog.urls')),

]

 

 

 

Hybrid Air url.py

from django.conf.urls import url, include

from . import views

urlpatterns = [

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

url(r'^contact/', views.contact, name='contact'),

]

 

 

Hybrid Air view.py

from django.shortcuts import render

 

def index(request):

return render(request, 'hybridair/home.html')

 

def contact(request):

return render(request, 'hybridair/basic.html' ('content' ['contact the 
team at', 'mar...@flymat21.com']))

 

def blog(request):

return render(request, 'hybridair/header.html')

 

 

 

 

 

blog url.py

from django.conf.urls import url, include

from django.views.generic import ListView, DetailView

from blog.models import Post

 

urlpatterns = [

url(r'^$', ListView.as_view(

queryset=Post.objects.order_by('-date')[:25],

template_name="blog/blog.html")),

 

url(r'^(?P\d+)$', DetailView.as_view(model = Post,

    template_name='blog/post.html')),

]

Do you see what I need to change?

On Thursday, May 31, 2018 at 9:01:23 AM UTC-4, Melvyn Sopacua wrote:
>
> On donderdag 31 mei 2018 05:56:59 CEST Caleb Bryson wrote: 
> > So i am trying to create a directory with a Home,Blog,and Contact 
> > selection. But every time i click on one of them they all go back to the 
> > home page. 
>
> If the url in your addressbar is /blog/  after clickin on it, but you see 
> the 
> homepage content, then your homepage url pattern matches too much. 
>
> If you get redirected to the homepage, then there's something wrong in 
> your 
> blog view code. 
>
> Given that it applies to both contact and blog, the first option is more 
> likely, but you could be making the same mistake in both views. 
>
> -- 
> 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/2ed614e4-cb26-47ef-9bfb-4e07d10b5ef2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Learning django

2018-08-05 Thread Caleb Bryson
Are there any books that teach django for the most recent version out there? I 
have not been successful at finding a book with up to date info

-- 
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/0ef86713-ab00-4ae5-8bc5-9c448b9afa13%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Rest API for plane tracker

2018-10-08 Thread Caleb Bryson
Hey guys I am trying to figure out how to create a api using the django 
rest frame work to display a airplane flight tracker on a website. I am not 
really sure how to do it as from what i have seen as examples the api's 
have been used form simple data like names, height, id number, etc. I am 
looking to use the the code from https://aviation-edge.com/ but am stuck on 
how to put it into the existing code that i have. Do i just create a model 
and views .py to display it on the site or is there another process for 
this. Thanks in advance for the help.

-- 
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/ba19202f-7563-4130-b22f-3ba41a2a44d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.