django beginner

195 views
Skip to first unread message

ngangsia akumbo

unread,
Jul 2, 2014, 6:22:32 AM7/2/14
to django...@googlegroups.com
I am new to django

i have been given a task to build a website using django . I dont know where to start.
I am suppose to include a services page, events, booking and a blog

This is my first project, can i have some tips ? Thanks

alghafli

unread,
Jul 2, 2014, 6:53:14 AM7/2/14
to django...@googlegroups.com
Hi,
I am also new to django and I started by reading the django tutorial.
https://docs.djangoproject.com/en/1.6/intro/overview/
It covers installation then shows how to construct a django application. It takes you step by step in constructing an example application.
I believe it is a very good place to start and understand what django is and how it works.

Regards,
Mohammad
--
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/2bc06d81-c21e-458e-ac7c-e78aab15e76e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mike Dewhirst

unread,
Jul 2, 2014, 6:59:18 AM7/2/14
to django...@googlegroups.com
Step 1 is to work through the excellent tutorial ...

https://docs.djangoproject.com/en/1.6/

Step 2 is to draw on paper what you want the website to look like and
what the various buttons and links will do.

Step 3 is to look for something which has already been done which might
suit your needs. You could look through Django packages for events,
booking and blog apps.

Provided you don't skip step 1 it will be easy.

Cheers

Mike
> --
> 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...@googlegroups.com>.
> To post to this group, send email to django...@googlegroups.com
> <mailto:django...@googlegroups.com>.
> <https://groups.google.com/d/msgid/django-users/2bc06d81-c21e-458e-ac7c-e78aab15e76e%40googlegroups.com?utm_medium=email&utm_source=footer>.

ngangsia akumbo

unread,
Jul 2, 2014, 8:14:12 AM7/2/14
to django...@googlegroups.com
i do the installation, create the virtualenv, startproject, startapp, create models, activate admin,

i still confuse with one thing, if i randomly create this apps how do i present them on the html page

That is where my prob is

Sithembewena Lloyd Dube

unread,
Jul 2, 2014, 8:16:51 AM7/2/14
to django...@googlegroups.com
Did you complete the entire tutorial?


--
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.

For more options, visit https://groups.google.com/d/optout.



--
Regards,
Sithu Lloyd Dube

ngangsia akumbo

unread,
Jul 2, 2014, 8:21:39 AM7/2/14
to django...@googlegroups.com
no i did not

Sithembewena Lloyd Dube

unread,
Jul 2, 2014, 8:47:08 AM7/2/14
to django...@googlegroups.com
I suggest you do so. It is important to understand how the framework works before attempting to create your own projects or even using existing apps.


On Wed, Jul 2, 2014 at 10:21 AM, ngangsia akumbo <ngan...@gmail.com> wrote:
no i did not

--
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.

For more options, visit https://groups.google.com/d/optout.

ngangsia akumbo

unread,
Jul 2, 2014, 11:01:54 AM7/2/14
to django...@googlegroups.com


On Wednesday, July 2, 2014 9:47:08 AM UTC+1, Lloyd Dube wrote:
I suggest you do so. It is important to understand how the framework works before attempting to create your own projects or even using existing apps.

Page not found (404)
Request Method:    GET
Request URL:    http://127.0.0.1:8000/articles/year
Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:
^articles/(\d{4})/$
^articles/(\d{4})/(\d{2})/$
^articles/(\d{4})/(\d{2})/(\d+)/$
^admin/
The current URL, articles/year, didn't match any of these.
You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.


I keep having this prob

Lachlan Musicman

unread,
Jul 2, 2014, 11:25:24 AM7/2/14
to django...@googlegroups.com
You need a ^articles/year/$ in your urls.py if you want to visit
http://127.0.0.1:8000/articles/year/

Your URLs are looking for:

http://127.0.0.1:8000/articles/dddd - eg http://127.0.0.1:8000/articles/2014
http://127.0.0.1:8000/articles/dddd/dd/ - eg
http://127.0.0.1:8000/articles/2014/07/
http://127.0.0.1:8000/articles/dddd/dd/{digits} - eg
http://127.0.0.1:8000/articles/2014/07/02

There is no http://127.0.0.1:8000/articles/year/ in that list.

Cheers
L.
> --
> 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/50e3f958-f1f3-4330-837a-41269b432549%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



--
The idea is that a beautiful image is frameable. Everything you need
to see is there: It’s everything you want, and it’s very pleasing
because there’s no extra information that you don’t get to see.
Everything’s in a nice package for you. But sublime art is
unframeable: It’s an image or idea that implies that there’s a bigger
image or idea that you can’t see: You’re only getting to look at a
fraction of it, and in that way it’s both beautiful and scary, because
it’s reminding you that there’s more that you don’t have access to.
It’s now sort of left the piece itself and it’s become your own
invention, so it’s personal as well as being scary as well as being
beautiful, which is what I really like about art like that.
-----------------------------------------------------------------------------------------------------------
Adventure Time http://theholenearthecenteroftheworld.com/

ngangsia akumbo

unread,
Jul 5, 2014, 12:26:06 PM7/5/14
to django...@googlegroups.com


On Wednesday, July 2, 2014 12:25:24 PM UTC+1, Lachlan Musicman wrote:


Why is this template not outputting the Title area?
I am using django-1.4.13


<!DOCTYPE html>
<html lang="en">

<head>
    <title>My test page</title>
</head>
<body>
<div class="side_bar">
    <h1>News Updates</h1>
    {% for entry in entries %}
        <h2>{{entry.headline}}</h2>
        <h3>Posted on {{ entry.pub_date }} by {{ entry.reporter }}</h3>
        <p>{{entry.content}}</p>
    {% endfor %}
</div>


</body>
</html>

ngangsia akumbo

unread,
Jul 7, 2014, 1:17:56 PM7/7/14
to django...@googlegroups.com
I have created my first app for my website which is a news post that will be located on the menu bar. 

I wish to create a separate app for photo, events, calendars , services and a contact all on the same site.

But i have just created a separate app call photo, but when i run syncdb nothing happens

I don't know to treat this apps separately on the same database
am using sqlite3 django-1.4.13.

How do i create multiple apps on one site?

Thanks in advance.........

Javier Guerra Giraldez

unread,
Jul 7, 2014, 1:48:17 PM7/7/14
to django...@googlegroups.com
On Mon, Jul 7, 2014 at 8:17 AM, ngangsia akumbo <ngan...@gmail.com> wrote:
> But i have just created a separate app call photo, but when i run syncdb
> nothing happens


have you added it to INSTALLED_APPS in settings.py?

--
Javier

ngangsia akumbo

unread,
Jul 7, 2014, 2:13:05 PM7/7/14
to django...@googlegroups.com
yes i added it to installed app

monoBOT

unread,
Jul 7, 2014, 3:23:27 PM7/7/14
to django...@googlegroups.com
is the
__init__.py
file in the directory?


--
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.

For more options, visit https://groups.google.com/d/optout.



--
monoBOT
Visite mi sitio(Visit my site): monobotsoft.es/blog/

ngangsia akumbo

unread,
Jul 8, 2014, 8:13:14 AM7/8/14
to django...@googlegroups.com
yes


Mando

unread,
Jul 8, 2014, 3:13:41 PM7/8/14
to django...@googlegroups.com
Is there anything in your models for the other apps ex: photo, events, etc... ? syncdb will not do anything with those until you create your models. Besides that you just need to crate your view and a url pointer to it and you should get a response.



On Tuesday, July 8, 2014 3:13:14 AM UTC-5, ngangsia akumbo wrote:
yes


Mando

unread,
Jul 8, 2014, 4:28:02 PM7/8/14
to django...@googlegroups.com
can you post the output when you run syncdb?

ngangsia akumbo

unread,
Jul 10, 2014, 7:52:13 AM7/10/14
to django...@googlegroups.com
it is not working thanks bro




i have one more question.
I have created a series of apps for my project. like services, contact, news ,booking app for my hotel site.
i created their individual individual templates for each of them and extended it to the base.html, they are all working fine.

my probe now is how do i feature all of these feature on a single page cos all the apps are opening individually using thei various urls?

How do i place these seperate apps on a single web page ? how do i introduce design patterns on them ?

how do i deploy it so that even a client can views the already finished site from his desk or office, just by typing the name of the site and getting in to the webiste?


thanks for the reply


booking app

Mario Gudelj

unread,
Jul 10, 2014, 8:02:10 AM7/10/14
to django...@googlegroups.com

You mentioned that you haven't completed a tutorial. You should because this stuff is in it. Your questions are too broad and covered in docs and other material on the web. Google is your bro :)

--
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.
Message has been deleted

ngangsia akumbo

unread,
Jul 10, 2014, 8:16:05 AM7/10/14
to django...@googlegroups.com
can u post the link again cos i have completed some tutorials on articles from django docs

Lachlan Musicman

unread,
Jul 10, 2014, 8:23:22 AM7/10/14
to django...@googlegroups.com
https://docs.djangoproject.com/en/1.6/intro/tutorial01/

cheers
L.

On 10 July 2014 18:16, ngangsia akumbo <ngan...@gmail.com> wrote:
> can u post the link again cos i have completed some tutorials on articles
> from django docs
>
> --
> 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/241db83d-f0ae-42ea-9e9c-c3a098567594%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



ngangsia akumbo

unread,
Jul 10, 2014, 8:33:25 AM7/10/14
to django...@googlegroups.com


This tutorial does not tell me how to place multiple apps on a webpage. it is just a single app tutorials.

i have created more than 5 apps how do i display them to be on one web page cos each of the have their individual templates


ngangsia akumbo

unread,
Jul 10, 2014, 8:40:28 AM7/10/14
to django...@googlegroups.com
sorry i saw what am looking for Thanks

ngangsia akumbo

unread,
Jul 11, 2014, 10:31:09 AM7/11/14
to django...@googlegroups.com

i have a problem
from django.db import models # Create your models here.

class Post(models.Model):
      headline = models.CharField(max_length=200)
      slug = models.SlugField(max_length=60)
      pub_date = models.DateField()
      photo = models.ImageField(upload_to='static/blog', blank=True)
      content = models.TextField()
      reporter = models.CharField(max_length=100)

 def __unicode__(self): return
self.headline


views 


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

from blogs.models import Post

class IndexNews(generic.ListView):
    template_name = 'index.html'
    context_object_name = 'news_list'

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

class NewsDetail(generic.DetailView):
    model = Post
    template_name = 'news.html'
    context_objects_name = 'news_details'

{% extends 'base.html' %}
{% block content %}
<div id="news">
<h1> News Updates </h1>
  <ul>
    {% for news in news_list %}
        <li><a href="/blogs/{{ news.id }}/">{{ news.headline }}</a></li>
    {% endfor %}
    </ul>
</div>
{% endblock %}


when i had a  news update on the admin page it list on the web browser using the heading which is a link

how to i create a template so that when i click on the heading link it ouputs the entire information a different page

i am a little bit confused here

please need help

Reply all
Reply to author
Forward
0 new messages