Am lost as to what to do, I try troubleshooting but couldn't fine de answer... This are my codes
from django.contrib.auth.models import User from django.shortcuts import render, redirect, get_object_or_404 from .models import Board, Topic, Post def new_topic(request, pk): board = get_object_or_404(Board, pk=pk) if request.method == 'POST': subject = request.POST['subject'] message = request.POST['message'] user = User.objects.first() # TODO: get the currently logged in user topic = Topic.objects.create( subject=subject, board=board, starter=user ) post = Post.objects.create( message=message, topic=topic, created_by=user ) return redirect('board_topics', pk=board.pk) # TODO: redirect to the created topic page return render(request, 'new_topic.html', {'board': board})
This is the error
url(r'^$', views.home, name='home')
attributeError: module 'boards.views' has no attribute 'home'
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+unsubscribe@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/9a2b1e04-5f45-ecd5-6d43-17f247a6836c%40stacktrace.dk.
For more options, visit https://groups.google.com/d/optout.
Kasper thanks for your brotherly advice, please I will be glad next time u add me a link. But I came across another error, when I run python manage.py runserver everything work find but when I enter 127.0.0.1 I gets "no internet connection" do I hv to be connected wit internet before I can access de local server?
That's what I have been trying since, but it's not going through
Try http://127.0.0.1:8000
On 12/07/2018 6:40 PM, Umar Kambala wrote:
Kasper thanks for your brotherly advice, please I will be glad next time u add me a link. But I came across another error, when I run python manage.py runserver everything work find but when I enter 127.0.0.1 I gets "no internet connection" do I hv to be connected wit internet before I can access de local server?
On Jul 9, 2018 11:57 AM, "Kasper Laudrup" <lau...@stacktrace.dk <mailto:lau...@stacktrace.dk>> wrote:
Hi Umar.
On 07/09/2018 01:52 PM, Umar Kambala wrote:
This is the error
url(r'^$', views.home, name='home')
attributeError: module 'boards.views' has no attribute 'home'
Do you know what a Python module is and what an attribute on a
module means? Then the answer is obvious.
Try to read up on that.
Kind regards,
Kasper Laudrup
-- 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+unsubscribe@googlegroups.com
<mailto:django-users%2Bunsubscri...@googlegroups.com>.
To post to this group, send email to django...@googlegroups.com
<mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users
<https://groups.google.com/group/django-users>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/9a2b1e04-5f45-ecd5-6d43-17f247a6836c%40stacktrace.dk
<https://groups.google.com/d/msgid/django-users/9a2b1e04-5f45-ecd5-6d43-17f247a6836c%40stacktrace.dk>.
For more options, visit https://groups.google.com/d/optout
<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+unsubscribe@googlegroups.com <mailto:django-users+unsubscrib...@googlegroups.com>.
To post to this group, send email to django...@googlegroups.com <mailto: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/CAPkbFbYeTZU6G0rtcpQ9Cgm6qf--cD-JfhO4dwNYHD-eUjr_fw%40mail.gmail.com <https://groups.google.com/d/msgid/django-users/CAPkbFbYeTZU6G0rtcpQ9Cgm6qf--cD-JfhO4dwNYHD-eUjr_fw%40mail.gmail.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+unsubscribe@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/429e7c72-256a-23b7-762d-4adb5a6c8d69%40dewhirst.com.au.