Hello, I'm reading the Django book and after reviewing the database
API I was wondering if there was some method to find out which fields
a model contains.
For example, if I have a Publisher model (which translates to a
publisher table in the database) I'm looking for some method in Django
equiva
I'm reading the Django book and playing with the 'mysite' test site,
in many parts I've noticed something like this in views.py:
from mysite.models import Event, BlogEntry
I was wondering if it's good practice using 'mysite.models' (which
seems to be an 'absolute path' for importing) or if it w
Thanks everybody, using __dict__ and meta_fields helped but the most
complete data came from the documentation in admin, that's exactly
what I needed :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users"
Thanks a lot, now I get it. That's exactly why I asked, I suspected
that the imports had to be done is such a way that they would be
independent of the location of app so I can reuse the code in many
projects.
Cheers!
--~--~-~--~~~---~--~~
You received this message
That's also a good idea. Thanks Jim.
--~--~-~--~~~---~--~~
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
Hello, I was reading this discussion:
http://groups.google.com/group/django-users/browse_thread/thread/d2d9ed6599089301
There Donn asks:
"Lastly, on the decoupling thing again, if I end up using (sometime)
HttpResposeRedirect(reverse(project.app.view)) does that not tie the
view to
the app to t
Cool, thanks for the confirmation. I'm still devouring all the
documentation, a couple of books and practicing a lot on Django :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this g
Hey, Malcolm, maybe an example could help. I'm reading the forms
documentation at http://docs.djangoproject.com/en/dev//topics/forms/
and I see this code as part of the view function for a contact form:
def contact(request):
if request.method == 'POST': # If the form has been submitted...
After some more reading and testing I'll try to answer myself, if any
of you could confirm if I'm on the right track please let me know and
please correct me if I'm not using the right terminology as well:
First, in my URLConf I have a url pattern like:
(r'^search/$', 'books.views.search', {}, '
Cool, now it's completely clear.
Thanks a lot Malcolm :)
--~--~-~--~~~---~--~~
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 th
Hi, I'm reading the docs and was testing named url patterns, I have
something like this in my URLConf:
url(r'^search/(?P.*)$', 'books.views.search',
name='search_page'),
And the view is defined like this:
def search(request, words):
Now I'd like to print a link to the search page with certain
Thanks for the reply. I just submitted it as bug 9315.
http://code.djangoproject.com/ticket/9315
Regards.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to dj
Hello, I have a Django app with two models: User and ChatRoom. Each
user can be the owner of many chatrooms and can also link to his
friends's chatrooms. There's is no authentication in this little app,
the User model is just a custom model containing user ids.
This is an app that will work with
Replying to myself :)
I haven't found the solution yet but after reading a few posts in the
group I think I have to try the "dynamic choices in a ChoiceField"
approach and forget about the ModelChoiceField.
There seems to be a few options on getting that done so I'll try
tomorrow with a fresh br
Finally I got my code working by using an __init__ method in my class
form to populate my ChoiceField fields as described in this post:
http://groups.google.com/group/django-users/browse_thread/thread/98bde0a6d818e627
I also tried Malcolm's suggestion:
http://www.pointy-stick.com/blog/2007/03/2
Hi guys, I've got my first 'serious' Django application running on a
production environment and after learning a lot from the great Django
community and extensive documenation I decided to give something back.
Here's a simple tutorial on how to setup Apache, mod_python and a
reverse proxy to Ligh
Hello, I'm reading 'Practical Django Projects' and I'm getting this
error from section 'A Simple Custom Tag' on chapter 6:
TemplateSyntaxError at /weblog/
'coltrane_tags' is not a valid tag library: Could not load template
library from django.templatetags.coltrane_tags, No module named
coltrane_
I use Fabric to automate as much as possible, not only for production but
also for my development and staging environments.
I have shared some code in github:
https://github.com/alexisbellido/The-Django-gunicorn-fabfile-project
I'm currently finishing some changes for making this code more flex
Hello,
I am working on a Django 1.4 project and writing one simple application
using per-site cache as described here:
https://docs.djangoproject.com/en/dev/topics/cache/#the-per-site-cache
I have correctly setup a local Memcached server and confirmed the pages are
being cached.
Then I set CA
ative
> is to add a middleware that does this, which will incur the lookup
> costs for all views.
>
> Bill
>
> On Tue, Aug 21, 2012 at 1:27 PM, Alexis Bellido
> >
> wrote:
> > Hello,
> >
> > I am working on a Django 1.4 project and writing one s
; is to add a middleware that does this, which will incur the lookup
> costs for all views.
>
> Bill
>
> On Tue, Aug 21, 2012 at 1:27 PM, Alexis Bellido
> >
> wrote:
> > Hello,
> >
> > I am working on a Django 1.4 project and writing one simple appl
I'd suggest you decouple your apps from your projects. If you want to have
everything under the same tree you could, I don't do it that way though.
You could have a tree like this:
/home/user
--proj
proj (this contains settings.py in Django 1.4)
app1
app2
--app3
You already noticed
I just created a ticket reporting this issue as a bug:
https://code.djangoproject.com/ticket/18863
Thanks for all the suggestions.
On Tuesday, August 21, 2012 2:27:04 PM UTC-3, Alexis Bellido wrote:
>
> Hello,
>
> I am working on a Django 1.4 project and writing one simple applicat
I don't think you need different braches in your code repository for your
development and production (and don't forget staging) environments. The
main differences are in the settings.py values and the database used. You
can even use the same settings.py for different environments with clever
us
I wrote a Fabric script to automate Django deployment, in my tests with
Ubuntu servers (actually, virtual machines running under KVM) the script
took 14 minutes from a clean Ubuntu install to a running Django environment.
You can get the code in GitHub:
https://github.com/alexisbellido/The-Djan
I think Fabric is the easiest solution, the tutorial is pretty good
[http:/fabfile.org], Katie wrote about how she uses Fabric
[http://therealkatie.net/blog/2011/nov/28/katie-finally-talks-about-her-fabfiles/],
and I tried to extend the idea a little to setup a server from scratch just
with a
It seems like you haven't read the documentation. That's the best place to
start.
Also, as Lloyd already said, you should offer more details about your
problem.
If you are coming from another programming language or frameworks, you
mentioned PHP, you should try to stop comparing and doing thin
27 matches
Mail list logo