project help

2011-12-27 Thread Jesramz
Hello All,

I would like to create a job search project a lot like monster or
indeed.

Does anyone have any resources such as other projects or repositories
similar to what I'm looking for that can push me in the right
direction? Or any advice whatsoever would also be appreciated.

I am planning on using:
django registration
django profiles
geodjango

Not sure what else yet

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: project help

2011-12-28 Thread Denis Darii
You can also consider to use pinax: http://pinaxproject.com/

or userena for accounts: http://django-userena.org/

Denis.

On Tue, Dec 27, 2011 at 8:58 PM, Jesramz wrote:

> Hello All,
>
> I would like to create a job search project a lot like monster or
> indeed.
>
> Does anyone have any resources such as other projects or repositories
> similar to what I'm looking for that can push me in the right
> direction? Or any advice whatsoever would also be appreciated.
>
> I am planning on using:
>django registration
>django profiles
>geodjango
>
> Not sure what else yet
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: project help

2011-12-30 Thread Jesramz
Thank you Denis!  django-userena seems great. Im glad I asked for
advice.

Im a noob so I dont quite get pinax fully.

On Dec 28, 2:33 am, Denis Darii  wrote:
> You can also consider to use pinax:http://pinaxproject.com/
>
> or userena for accounts:http://django-userena.org/
>
> Denis.
>
> On Tue, Dec 27, 2011 at 8:58 PM, Jesramz 
> wrote:
>
>
>
>
>
>
>
> > Hello All,
>
> > I would like to create a job search project a lot like monster or
> > indeed.
>
> > Does anyone have any resources such as other projects or repositories
> > similar to what I'm looking for that can push me in the right
> > direction? Or any advice whatsoever would also be appreciated.
>
> > I am planning on using:
> >    django registration
> >    django profiles
> >    geodjango
>
> > Not sure what else yet
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: project help

2011-12-30 Thread Jesramz
I found something promising https://github.com/wtrevino/
django-djobberbase/wiki">Djobberbase. In case this helps anybody
else.

On Dec 30, 2:10 am, Jesramz  wrote:
> Thank you Denis!  django-userena seems great. Im glad I asked for
> advice.
>
> Im a noob so I dont quite get pinax fully.
>
> On Dec 28, 2:33 am, Denis Darii  wrote:
>
>
>
>
>
>
>
> > You can also consider to use pinax:http://pinaxproject.com/
>
> > or userena for accounts:http://django-userena.org/
>
> > Denis.
>
> > On Tue, Dec 27, 2011 at 8:58 PM, Jesramz 
> > wrote:
>
> > > Hello All,
>
> > > I would like to create a job search project a lot like monster or
> > > indeed.
>
> > > Does anyone have any resources such as other projects or repositories
> > > similar to what I'm looking for that can push me in the right
> > > direction? Or any advice whatsoever would also be appreciated.
>
> > > I am planning on using:
> > >    django registration
> > >    django profiles
> > >    geodjango
>
> > > Not sure what else yet
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "Django users" group.
> > > To post to this group, send email to django-users@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > django-users+unsubscr...@googlegroups.com.
> > > For more options, visit this group at
> > >http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: project help

2011-12-30 Thread Jesramz
Here it is again:

https://github.com/wtrevino/django-djobberbase/wiki

On Dec 31, 12:39 am, Jesramz  wrote:
> I found something promising https://github.com/wtrevino/
> django-djobberbase/wiki">Djobberbase. In case this helps anybody
> else.
>
> On Dec 30, 2:10 am, Jesramz  wrote:
>
>
>
>
>
>
>
> > Thank you Denis!  django-userena seems great. Im glad I asked for
> > advice.
>
> > Im a noob so I dont quite get pinax fully.
>
> > On Dec 28, 2:33 am, Denis Darii  wrote:
>
> > > You can also consider to use pinax:http://pinaxproject.com/
>
> > > or userena for accounts:http://django-userena.org/
>
> > > Denis.
>
> > > On Tue, Dec 27, 2011 at 8:58 PM, Jesramz 
> > > wrote:
>
> > > > Hello All,
>
> > > > I would like to create a job search project a lot like monster or
> > > > indeed.
>
> > > > Does anyone have any resources such as other projects or repositories
> > > > similar to what I'm looking for that can push me in the right
> > > > direction? Or any advice whatsoever would also be appreciated.
>
> > > > I am planning on using:
> > > >    django registration
> > > >    django profiles
> > > >    geodjango
>
> > > > Not sure what else yet
>
> > > > --
> > > > You received this message because you are subscribed to the Google 
> > > > Groups
> > > > "Django users" group.
> > > > To post to this group, send email to django-users@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > django-users+unsubscr...@googlegroups.com.
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Blog project help

2020-03-18 Thread Luka Nik
Hello fellow djangos,

I have a slight problem with my project, a simple solution is needed I
believe, but I couldn't figure it out.

I wanted to add a comment section for my blog posts.
Here is the code:

Models.py:

class Comment(models.Model):
post = models.ForeignKey(Post, on_delete=models.CASCADE,
related_name='comments')
name = models.CharField(max_length=80)
email = models.EmailField()
body = models.TextField()
created_on = models.DateTimeField(auto_now_add=True)
active = models.BooleanField(default=False)

class Meta:
ordering = ['-created_on']

def __str__(self):
return 'Comment {} by {}'.format(self.body, self.name)


Views.py:

class PostDetailView(DetailView):
model = Post

def post_detail(request, slug):

template_name = 'blog/post_detail.html'
post = get_object_or_404(Post, slug=slug)
comments = post.comments.filter(active=True)
new_comment = None
if request.method == 'POST':
comment_form = CommentForm(data=request.POST)
if comment_form.is_valid():
new_comment = comment_form.save(commit=False)
new_comment.post = post
new_comment.save()
else:
comment_form = CommentForm()

return render(request, template_name, {'post': post,
   'comments': comments,
   'new_comment': new_comment,
   'comment_form': comment_form
   })


Blog/post_detail.html:

{%extends 'blog/base.html'%}
{% load crispy_forms_tags %}
{%block content%}





{{ object.author }}
{{
object.date_posted|date:"d F, Y" }}

{% if object.author == user %}

 Home 
 Update 
 Delete 


{% endif %}


{{ object.title }}
{{ object.content }}


{% for comment in comments %}
 

{{ comment.name }}

{{ comment.created_on }}


{{ comment.body | linebreaks }}

{% endfor %}


{% if new_comment %}

Your comment is awaiting moderation

{% else %}
Leave a comment

{{ comment_form | crispy }}
{% csrf_token %}
Submit

{% endif %}


{% endblock content%}


And the urls.py:

urlpatterns = [
path('', PostListView.as_view(), name='blog-home'),
path('about/', views.about, name='blog-about'),
path('showroom/', views.showroom, name='blog-showroom'),
path('photos/', views.photos, name='blog-photos'),
path('post//', PostDetailView.as_view(), name='post-detail'),
path('post/new/', PostCreateView.as_view(), name='post-create'),
path('post//update/', PostUpdateView.as_view(), name='post-update'),
path('post//delete/', PostDeleteView.as_view(), name='post-delete'),
path('user/', UserPostListView.as_view(), name='user-posts'),

]




The problem is following:
In the post detail page, I can not see the fields required for commenting,
I only see "Leave a comment" and submit button that does not work..
Any help would be nice

Cheers,
Luka

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMqindt2sqxVH1M7usu9sF0y84Lu7o6pRV27HVWUc_PTMu2NEg%40mail.gmail.com.


Re: Blog project help

2020-03-18 Thread Python Programming
Hello my friend this site is for you:

https://djangocentral.com/building-a-blog-application-with-django/

‫‪Luka Nik‬‏ <‪luka2...@gmail.com‬‏> در تاریخ چهارشنبه ۱۸ مارس ۲۰۲۰ ساعت
۱۹:۵۷ نوشت:‬

> Hello fellow djangos,
>
> I have a slight problem with my project, a simple solution is needed I
> believe, but I couldn't figure it out.
>
> I wanted to add a comment section for my blog posts.
> Here is the code:
>
> Models.py:
>
> class Comment(models.Model):
> post = models.ForeignKey(Post, on_delete=models.CASCADE, 
> related_name='comments')
> name = models.CharField(max_length=80)
> email = models.EmailField()
> body = models.TextField()
> created_on = models.DateTimeField(auto_now_add=True)
> active = models.BooleanField(default=False)
>
> class Meta:
> ordering = ['-created_on']
>
> def __str__(self):
> return 'Comment {} by {}'.format(self.body, self.name)
>
>
> Views.py:
>
> class PostDetailView(DetailView):
> model = Post
>
> def post_detail(request, slug):
>
> template_name = 'blog/post_detail.html'
> post = get_object_or_404(Post, slug=slug)
> comments = post.comments.filter(active=True)
> new_comment = None
> if request.method == 'POST':
> comment_form = CommentForm(data=request.POST)
> if comment_form.is_valid():
> new_comment = comment_form.save(commit=False)
> new_comment.post = post
> new_comment.save()
> else:
> comment_form = CommentForm()
>
> return render(request, template_name, {'post': post,
>'comments': comments,
>'new_comment': new_comment,
>'comment_form': comment_form
>})
>
>
> Blog/post_detail.html:
>
> {%extends 'blog/base.html'%}
> {% load crispy_forms_tags %}
> {%block content%}
> 
> 
> 
>
> 
> {{ object.author }}
> {{ object.date_posted|date:"d F, Y" 
> }}
>
> {% if object.author == user %}
> 
>  Home 
>  href="{% url 'post-update' object.id %}"> Update 
>  Delete 
> 
>
> {% endif %}
> 
>
> {{ object.title }}
> {{ object.content }}
> 
> 
> {% for comment in comments %}
>  
> 
> {{ comment.name }}
> 
> {{ comment.created_on }}
> 
> 
> {{ comment.body | linebreaks }}
> 
> {% endfor %}
> 
> 
> {% if new_comment %}
> 
> Your comment is awaiting moderation
> 
> {% else %}
> Leave a comment
> 
> {{ comment_form | crispy }}
> {% csrf_token %}
> Submit
> 
> {% endif %}
> 
> 
> {% endblock content%}
>
>
> And the urls.py:
>
> urlpatterns = [
> path('', PostListView.as_view(), name='blog-home'),
> path('about/', views.about, name='blog-about'),
> path('showroom/', views.showroom, name='blog-showroom'),
> path('photos/', views.photos, name='blog-photos'),
> path('post//', PostDetailView.as_view(), name='post-detail'),
> path('post/new/', PostCreateView.as_view(), name='post-create'),
> path('post//update/', PostUpdateView.as_view(), 
> name='post-update'),
> path('post//delete/', PostDeleteView.as_view(), 
> name='post-delete'),
> path('user/', UserPostListView.as_view(), 
> name='user-posts'),
>
> ]
>
>
>
>
> The problem is following:
> In the post detail page, I can not see the fields required for commenting,
> I only see "Leave a comment" and submit button that does not work..
> Any help would be nice
>
> Cheers,
> Luka
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMqindt2sqxVH1M7usu9sF0y84Lu7o6pRV27HVWUc_PTMu2NEg%40mail.gmail.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 view this disc

Re: Blog project help

2020-03-18 Thread Luka Nik
Yes, I used that, but it's not working for me.
Actually I combined two projects, but, I think my blog/post-detail is not
working

On Wed, Mar 18, 2020 at 6:00 PM Python Programming 
wrote:

> Hello my friend this site is for you:
>
> https://djangocentral.com/building-a-blog-application-with-django/
>
> ‫‪Luka Nik‬‏ <‪luka2...@gmail.com‬‏> در تاریخ چهارشنبه ۱۸ مارس ۲۰۲۰ ساعت
> ۱۹:۵۷ نوشت:‬
>
>> Hello fellow djangos,
>>
>> I have a slight problem with my project, a simple solution is needed I
>> believe, but I couldn't figure it out.
>>
>> I wanted to add a comment section for my blog posts.
>> Here is the code:
>>
>> Models.py:
>>
>> class Comment(models.Model):
>> post = models.ForeignKey(Post, on_delete=models.CASCADE, 
>> related_name='comments')
>> name = models.CharField(max_length=80)
>> email = models.EmailField()
>> body = models.TextField()
>> created_on = models.DateTimeField(auto_now_add=True)
>> active = models.BooleanField(default=False)
>>
>> class Meta:
>> ordering = ['-created_on']
>>
>> def __str__(self):
>> return 'Comment {} by {}'.format(self.body, self.name)
>>
>>
>> Views.py:
>>
>> class PostDetailView(DetailView):
>> model = Post
>>
>> def post_detail(request, slug):
>>
>> template_name = 'blog/post_detail.html'
>> post = get_object_or_404(Post, slug=slug)
>> comments = post.comments.filter(active=True)
>> new_comment = None
>> if request.method == 'POST':
>> comment_form = CommentForm(data=request.POST)
>> if comment_form.is_valid():
>> new_comment = comment_form.save(commit=False)
>> new_comment.post = post
>> new_comment.save()
>> else:
>> comment_form = CommentForm()
>>
>> return render(request, template_name, {'post': post,
>>'comments': comments,
>>'new_comment': new_comment,
>>'comment_form': comment_form
>>})
>>
>>
>> Blog/post_detail.html:
>>
>> {%extends 'blog/base.html'%}
>> {% load crispy_forms_tags %}
>> {%block content%}
>> 
>> 
>> 
>>
>> 
>> {{ object.author }}
>> {{ object.date_posted|date:"d F, 
>> Y" }}
>>
>> {% if object.author == user %}
>> 
>>  Home 
>> > href="{% url 'post-update' object.id %}"> Update 
>>  Delete 
>> 
>>
>> {% endif %}
>> 
>>
>> {{ object.title }}
>> {{ object.content }}
>> 
>> 
>> {% for comment in comments %}
>>  
>> 
>> {{ comment.name }}
>> 
>> {{ comment.created_on }}
>> 
>> 
>> {{ comment.body | linebreaks }}
>> 
>> {% endfor %}
>> 
>> 
>> {% if new_comment %}
>> 
>> Your comment is awaiting moderation
>> 
>> {% else %}
>> Leave a comment
>> 
>> {{ comment_form | crispy }}
>> {% csrf_token %}
>> Submit
>> 
>> {% endif %}
>> 
>> 
>> {% endblock content%}
>>
>>
>> And the urls.py:
>>
>> urlpatterns = [
>> path('', PostListView.as_view(), name='blog-home'),
>> path('about/', views.about, name='blog-about'),
>> path('showroom/', views.showroom, name='blog-showroom'),
>> path('photos/', views.photos, name='blog-photos'),
>> path('post//', PostDetailView.as_view(), name='post-detail'),
>> path('post/new/', PostCreateView.as_view(), name='post-create'),
>> path('post//update/', PostUpdateView.as_view(), 
>> name='post-update'),
>> path('post//delete/', PostDeleteView.as_view(), 
>> name='post-delete'),
>> path('user/', UserPostListView.as_view(), 
>> name='user-posts'),
>>
>> ]
>>
>>
>>
>>
>> The problem is following:
>> In the post detail page, I can not see the fields required for commenting,
>> I only see "Leave a comment" and submit button that does not work..
>> Any help would be nice
>>
>> Cheers,
>> Luka
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAMqindt2sqxVH1M7usu9sF0y84Lu7o6pRV27HVWUc_PTMu2NEg%40mail.gmail.com
>> 

Re: Blog project help

2020-03-18 Thread sanka nanaji
I cannot see forms/serializers here. You have to make a
modelserializer/form in your serializers.py/form.py file and write class
meta in that and put comment fields in model user.
I would suggest you to go look in the document.
Thank you

On Wed, Mar 18, 2020, 13:06 Luka Nik  wrote:

> Yes, I used that, but it's not working for me.
> Actually I combined two projects, but, I think my blog/post-detail is not
> working
>
> On Wed, Mar 18, 2020 at 6:00 PM Python Programming <
> mahdipyton...@gmail.com> wrote:
>
>> Hello my friend this site is for you:
>>
>> https://djangocentral.com/building-a-blog-application-with-django/
>>
>> ‫‪Luka Nik‬‏ <‪luka2...@gmail.com‬‏> در تاریخ چهارشنبه ۱۸ مارس ۲۰۲۰ ساعت
>> ۱۹:۵۷ نوشت:‬
>>
>>> Hello fellow djangos,
>>>
>>> I have a slight problem with my project, a simple solution is needed I
>>> believe, but I couldn't figure it out.
>>>
>>> I wanted to add a comment section for my blog posts.
>>> Here is the code:
>>>
>>> Models.py:
>>>
>>> class Comment(models.Model):
>>> post = models.ForeignKey(Post, on_delete=models.CASCADE, 
>>> related_name='comments')
>>> name = models.CharField(max_length=80)
>>> email = models.EmailField()
>>> body = models.TextField()
>>> created_on = models.DateTimeField(auto_now_add=True)
>>> active = models.BooleanField(default=False)
>>>
>>> class Meta:
>>> ordering = ['-created_on']
>>>
>>> def __str__(self):
>>> return 'Comment {} by {}'.format(self.body, self.name)
>>>
>>>
>>> Views.py:
>>>
>>> class PostDetailView(DetailView):
>>> model = Post
>>>
>>> def post_detail(request, slug):
>>>
>>> template_name = 'blog/post_detail.html'
>>> post = get_object_or_404(Post, slug=slug)
>>> comments = post.comments.filter(active=True)
>>> new_comment = None
>>> if request.method == 'POST':
>>> comment_form = CommentForm(data=request.POST)
>>> if comment_form.is_valid():
>>> new_comment = comment_form.save(commit=False)
>>> new_comment.post = post
>>> new_comment.save()
>>> else:
>>> comment_form = CommentForm()
>>>
>>> return render(request, template_name, {'post': post,
>>>'comments': comments,
>>>'new_comment': new_comment,
>>>'comment_form': comment_form
>>>})
>>>
>>>
>>> Blog/post_detail.html:
>>>
>>> {%extends 'blog/base.html'%}
>>> {% load crispy_forms_tags %}
>>> {%block content%}
>>> 
>>> 
>>> 
>>>
>>> 
>>> {{ object.author }}
>>> {{ object.date_posted|date:"d F, 
>>> Y" }}
>>>
>>> {% if object.author == user %}
>>> 
>>> >> href="{% url 'blog-home'%}"> Home 
>>> >> href="{% url 'post-update' object.id %}"> Update 
>>>  Delete 
>>> 
>>>
>>> {% endif %}
>>> 
>>>
>>> {{ object.title }}
>>> {{ object.content }}
>>> 
>>> 
>>> {% for comment in comments %}
>>>  
>>> 
>>> {{ comment.name }}
>>> 
>>> {{ comment.created_on }}
>>> 
>>> 
>>> {{ comment.body | linebreaks }}
>>> 
>>> {% endfor %}
>>> 
>>> 
>>> {% if new_comment %}
>>> 
>>> Your comment is awaiting moderation
>>> 
>>> {% else %}
>>> Leave a comment
>>> 
>>> {{ comment_form | crispy }}
>>> {% csrf_token %}
>>> Submit
>>> 
>>> {% endif %}
>>> 
>>> 
>>> {% endblock content%}
>>>
>>>
>>> And the urls.py:
>>>
>>> urlpatterns = [
>>> path('', PostListView.as_view(), name='blog-home'),
>>> path('about/', views.about, name='blog-about'),
>>> path('showroom/', views.showroom, name='blog-showroom'),
>>> path('photos/', views.photos, name='blog-photos'),
>>> path('post//', PostDetailView.as_view(), name='post-detail'),
>>> path('post/new/', PostCreateView.as_view(), name='post-create'),
>>> path('post//update/', PostUpdateView.as_view(), 
>>> name='post-update'),
>>> path('post//delete/', PostDeleteView.as_view(), 
>>> name='post-delete'),
>>> path('user/', UserPostListView.as_view(), 
>>> name='user-posts'),
>>>
>>> ]
>>>
>>>
>>>
>>>
>>> The problem is following:
>>> In the post detail page, I can not see the fields required for
>>> commenting,
>>> I only see "Leave a comment" and submit button that does not work..
>>> Any hel

Re: Blog project help

2020-03-18 Thread Motaz Hejaze
where is your forms.py file ???
you have to write the comments form ..

using forms.Form
write field by field

or using forms.modelform
class meta : model = Comment



On Wed, Mar 18, 2020 at 8:10 PM sanka nanaji 
wrote:

> I cannot see forms/serializers here. You have to make a
> modelserializer/form in your serializers.py/form.py file and write class
> meta in that and put comment fields in model user.
> I would suggest you to go look in the document.
> Thank you
>
> On Wed, Mar 18, 2020, 13:06 Luka Nik  wrote:
>
>> Yes, I used that, but it's not working for me.
>> Actually I combined two projects, but, I think my blog/post-detail is not
>> working
>>
>> On Wed, Mar 18, 2020 at 6:00 PM Python Programming <
>> mahdipyton...@gmail.com> wrote:
>>
>>> Hello my friend this site is for you:
>>>
>>> https://djangocentral.com/building-a-blog-application-with-django/
>>>
>>> ‫‪Luka Nik‬‏ <‪luka2...@gmail.com‬‏> در تاریخ چهارشنبه ۱۸ مارس ۲۰۲۰
>>> ساعت ۱۹:۵۷ نوشت:‬
>>>
 Hello fellow djangos,

 I have a slight problem with my project, a simple solution is needed I
 believe, but I couldn't figure it out.

 I wanted to add a comment section for my blog posts.
 Here is the code:

 Models.py:

 class Comment(models.Model):
 post = models.ForeignKey(Post, on_delete=models.CASCADE, 
 related_name='comments')
 name = models.CharField(max_length=80)
 email = models.EmailField()
 body = models.TextField()
 created_on = models.DateTimeField(auto_now_add=True)
 active = models.BooleanField(default=False)

 class Meta:
 ordering = ['-created_on']

 def __str__(self):
 return 'Comment {} by {}'.format(self.body, self.name)


 Views.py:

 class PostDetailView(DetailView):
 model = Post

 def post_detail(request, slug):

 template_name = 'blog/post_detail.html'
 post = get_object_or_404(Post, slug=slug)
 comments = post.comments.filter(active=True)
 new_comment = None
 if request.method == 'POST':
 comment_form = CommentForm(data=request.POST)
 if comment_form.is_valid():
 new_comment = comment_form.save(commit=False)
 new_comment.post = post
 new_comment.save()
 else:
 comment_form = CommentForm()

 return render(request, template_name, {'post': post,
'comments': comments,
'new_comment': new_comment,
'comment_form': comment_form
})


 Blog/post_detail.html:

 {%extends 'blog/base.html'%}
 {% load crispy_forms_tags %}
 {%block content%}
 
 
 

 
 {{ object.author }}
 {{ object.date_posted|date:"d F, 
 Y" }}

 {% if object.author == user %}
 
 >>> href="{% url 'blog-home'%}"> Home 
 >>> href="{% url 'post-update' object.id %}"> Update 
 >>> href="{% url 'post-delete' object.id %}"> Delete 
 

 {% endif %}
 

 {{ object.title }}
 {{ object.content }}
 
 
 {% for comment in comments %}
  
 
 {{ comment.name }}
 
 {{ comment.created_on }}
 
 
 {{ comment.body | linebreaks }}
 
 {% endfor %}
 
 
 {% if new_comment %}
 
 Your comment is awaiting moderation
 
 {% else %}
 Leave a comment
 
 {{ comment_form | crispy }}
 {% csrf_token %}
 Submit
 
 {% endif %}
 
 
 {% endblock content%}


 And the urls.py:

 urlpatterns = [
 path('', PostListView.as_view(), name='blog-home'),
 path('about/', views.about, name='blog-about'),
 path('showroom/', views.showroom, name='blog-showroom'),
 path('photos/', views.photos, name='blog-photos'),
 path('post//', PostDetailView.as_view(), name='post-detail'),
 path('post/new/', PostCreateView.as_view(), name='post-create'),
 path('post//update/', PostUpdateVie

Transferring mySQL databases to Django project help

2007-05-11 Thread Michael Newman

I am switching over a couple of news Web sites to Django. Sadly our
deadline is creeping up on me and I have never worked with mySQL
before. One site has an active database with the tables that need to
be transferred and the other has a text dump of the old database.

I figure this should not take very long for someone who has done this
before, and the two news sites are willing to pay for the work. If you
are interested and have a few free hours this week let me know
(Newmaniese at gmail) and I will get a contract to you immediately.

Thank you.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---