Re: Another Noob questions

2014-09-01 Thread Matt Gushee
Hello again-- Since I don't really understand what you are doing, I can't give you any specific help. But since I have the impression you are new not only to Django but to online technical forums, let me give you a general recommendation: You will get better answers if you ask better questions. T

Re: Django 1.7 tutorial: Use generic views

2014-09-01 Thread Michael Martin
James, Yes, you are correct. It would have made more sense if they placed the "Amend Views" section first. On Mon, Sep 1, 2014 at 6:12 PM, James Schneider wrote: > Did you finish out the 'Amend Views' section of the tutorial? > > https://docs.djangoproject.com/en/dev/intro/tutorial04/#am

Re: Another Noob questions

2014-09-01 Thread Matt Gushee
Hi, Michael-- On Mon, Sep 1, 2014 at 6:58 PM, Michael Carey wrote: > > I have pushed the site to git and am trying to view it on git for a start. Seeing as I'm the one who recommended Git to you, I'd better say something ... If you literally mean 'view it on git' - though I'm not even sure what

Re: Django 1.7 tutorial: Use generic views

2014-09-01 Thread James Schneider
Did you finish out the 'Amend Views' section of the tutorial? https://docs.djangoproject.com/en/dev/intro/tutorial04/#amend-views Based on the dir() output below, you didn't. You won't be able to reference those view classes from your urls.py until you create them in views.py. Personal note: I t

Re: Another Noob questions

2014-09-01 Thread Michael Carey
No I didnt have a url(r'^$', views.home_page), I have pushed the site to git and am trying to view it on git for a start. On Tuesday, 2 September 2014 10:18:21 UTC+10, Michael Carey wrote: > > So I followed a tutorial on graphing a graph in Django. > > I have the urls page set up, do I need a i

Re: Django 1.7 tutorial: Use generic views

2014-09-01 Thread Michael Martin
Here are the results that I recieved >>> from polls import views >>> dir(views) ['Choice', 'HttpResponse', 'HttpResponseRedirect', 'Question', '__doc__', '__fil e__', '__name__', '__package__', 'detail', 'get_object_or_404', 'index', 'render ', 'results', 'reverse', 'vote'] >>> On Sat, Aug 30, 2

Re: crispy forms two forms and context

2014-09-01 Thread James Schneider
I would assume you want something akin to the first example here: https://docs.djangoproject.com/en/dev/topics/forms/modelforms/ Once you have the form object built with the instance of your Answer object, just pass it along. Since I've never needed more than one form on a page, there may be oth

Re: Another Noob questions

2014-09-01 Thread Collin Anderson
do you have a url for you home page? url(r'^$', views.home_page), and it works on your dev server, but not when you deploy? how are you hosting it? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop re

Re: Another Noob questions

2014-09-01 Thread Michael Carey
I have created an app and have content showing under (mysite)/graph but I am not getting a home page. I have pushed it to git and am not getting a response. on the dev server (port8000) it shows. Thank you, Michael Carey On Tuesday, 2 September 2014 10:18:21 UTC+10, Michael Carey wrote: > > S

Re: Another Noob questions

2014-09-01 Thread Collin Anderson
what are you trying to do? what happens when you try? -- 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

Re: crispy forms two forms and context

2014-09-01 Thread Brad Rice
Here is my entire view class to go with a ModelForm. How do I get the various forms as context into my template? class ApplicationVerify(UpdateView): model = Answers form_class = ApplicationCheckForm template_name = 'requestform/application_detail.html' @method_decorator(login_re

Another Noob questions

2014-09-01 Thread Michael Carey
So I followed a tutorial on graphing a graph in Django. I have the urls page set up, do I need a index.html? Thank you, MC -- 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

Re: How to make a widget with no history?

2014-09-01 Thread Yarick Antonov
Many thanks :) That's just what i need. On Monday, September 1, 2014 8:48:16 PM UTC+4, Collin Anderson wrote: > > You need to turn html autocomplete off. > > class CommentForm(forms.Form): > name = forms.CharField(widget=forms.TextInput(attrs={'autocomplete': > 'off'})) > > which will generat

Re: crispy forms two forms and context

2014-09-01 Thread James Schneider
It looks like you are passing the context an actual Answers object, not a Form or ModelForm object that will add/update an Answers object, hence the reason the trace back complains about a lack of 'fields'. -James On Monday, September 1, 2014, Brad Rice wrote: > This document seems to indicate

crispy forms two forms and context

2014-09-01 Thread Brad Rice
This document seems to indicate I can have two forms inside one set of form tags: http://django-crispy-forms.readthedocs.org/en/latest/crispy_tag_forms.html#rendering-several-forms-with-helpers I cannot figure out how to set the context to be able to iterate over both forms. {% crispy form %}

Re: Django and AJAX jQuery

2014-09-01 Thread Martin Spasov
Perfect, thank you On 9/1/14, Collin Anderson wrote: > If the url name is not guessable (for example, it includes a secure random > string, like django's forgot password url), that should provide enough > security. > > Though you can always pass in the csrf token using javascript: > https://docs.

Re: Django and AJAX jQuery

2014-09-01 Thread Collin Anderson
If the url name is not guessable (for example, it includes a secure random string, like django's forgot password url), that should provide enough security. Though you can always pass in the csrf token using javascript: https://docs.djangoproject.com/en/dev/ref/contrib/csrf/#ajax -- You receive

Re: Apache on Windows & multiple Django apps

2014-09-01 Thread Collin Anderson
See the docs on deploying with mod_wsgi: https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/modwsgi/ If multiple Django sites are run in a single mod_wsgi process, all of them will use the settings of whichever one happens to run first. This can be solved with a minor edit to wsgi.py (

Re: How create a custom permission for a model?

2014-09-01 Thread Collin Anderson
> Can't create other users > Can't create other topics or subtopics These can be done using built in permissions and groups Something like this might work for the rest: class NewsAdmin(models.Model): def get_queryset(self, request): queryset = super(NewsAdmin, self).get_queryset(requ

Re: How to make a widget with no history?

2014-09-01 Thread Collin Anderson
You need to turn html autocomplete off. class CommentForm(forms.Form): name = forms.CharField(widget=forms.TextInput(attrs={'autocomplete': 'off'})) which will generate html like this: -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Django and AJAX jQuery

2014-09-01 Thread Martin Spasov
I am completely new to AJAX and I was wondering. I have a a view that ajax is posting to but in order for the request to be processed in the view correctly i have to add csrf_exempt decorator to that view, but is that safe? I named the url for that view with a name that would not be guessable,

Waitress vs Gunicorn etc

2014-09-01 Thread Robert Grant
Having read the nicely-written Don't use Gunicorn to host your Django sites on Heroku , I'm in the standard non-expert position of thinking that it seems well reasoned, but because I don't know what I don't know, I can't tell how

Re: Migrating to a custom User model with South

2014-09-01 Thread Guy Tamir
I'll change it, thanks for the tip. Found my problem though. Inside the same models file where I created the CustomUser I also defined a "CaseInsensitiveModelBackend" that uses the get_user_model function Since they were both in the same file it created a loop (i think) and when I moved it to an

Apache on Windows & multiple Django apps

2014-09-01 Thread DJ-Tom
Hi, I'm currently trying to get the same Django app running twice under different URLs on the same server. App 1 ran last year under https://www.sample.com/2013/app and should stay there for reference purposes. App 2 should run under https://www.sample.com/2014/app and also should use a diffe

Re: Migrating to a custom User model with South

2014-09-01 Thread Helton Alves
why don't you put your app in your own directory? this mode is more organized. project/ settings.py views.py urls.py wsgi.py myappname/ model.py forms.py views.py urls.py 2014-09-01 13:05 GMT+01:00 Guy Tamir : > myappname(dir): > -settings.py >

Re: Migrating to a custom User model with South

2014-09-01 Thread Guy Tamir
myappname(dir): -settings.py - admin.py - forms.py - models.py - urls.py - views.py - wsgi.py On Monday, September 1, 2014 3:02:42 PM UTC+3, Helton Alves wrote: > > can you put here your full directory? > > > 2014-09-01 12:53 GMT+01:00 Guy Tamir >: > >> the layout is like this: >> >> myappname (di

Re: Migrating to a custom User model with South

2014-09-01 Thread Helton Alves
can you put here your full directory? 2014-09-01 12:53 GMT+01:00 Guy Tamir : > the layout is like this: > > myappname (dir): > - settings.py > - models.py (here is the CustomUser model) > > > On Monday, September 1, 2014 2:51:18 PM UTC+3, Helton Alves wrote: > >> your "myappname" is in the sam

Re: Migrating to a custom User model with South

2014-09-01 Thread Guy Tamir
the layout is like this: myappname (dir): - settings.py - models.py (here is the CustomUser model) On Monday, September 1, 2014 2:51:18 PM UTC+3, Helton Alves wrote: > > your "myappname" is in the same directory? > > ex: > settings.py > myappname/ > > or > > settings.py > apps/ > myappname/

Re: Migrating to a custom User model with South

2014-09-01 Thread Helton Alves
your "myappname" is in the same directory? ex: settings.py myappname/ or settings.py apps/ myappname/ if in another directory, on INSTALLED_APPS have to are this mode "directory.myappname". 2014-09-01 12:12 GMT+01:00 Guy Tamir : > Yes its there. > Not sure if this can cause an issue but

Re: Migrating to a custom User model with South

2014-09-01 Thread Guy Tamir
Yes its there. Not sure if this can cause an issue but "myappname" is the main app for my project where the settings.py file is at.. and the CustomUser is a model inside this app On Monday, September 1, 2014 1:50:20 PM UTC+3, Helton Alves wrote: > > do you put your "myappname" in INSTALLED_APPS

Re: Migrating to a custom User model with South

2014-09-01 Thread Helton Alves
do you put your "myappname" in INSTALLED_APPS on settings ? 2014-09-01 8:17 GMT+01:00 Guy Tamir : > Hey all, > > I'm trying to create a custom User model on an existing project (Django > 1.5.5). > I followed this tutorial >

Migrating to a custom User model with South

2014-09-01 Thread Guy Tamir
Hey all, I'm trying to create a custom User model on an existing project (Django 1.5.5). I followed this tutorial , I created the new model, ran a "schemamigration" once, which created the tables in the DB, also