I can successfully run a toy WSGI app with my Apache/mod_wsgi set up.
When I try to run my Django app with mod_wsgi it can't ever find the
modules to load and Apache's error.log gives ImportError's.
I tried adding paths to sys.path in the wsgi file.
Not what else to try.
cs
--
You received th
On May 25, 9:03 pm, Kenneth Gonsalves wrote:
> you need to add the path to the *parent* directory of your project, and your
> project should have __init__.py in every folder where there are python files
Thanks. I added __init__.py to an apache directory I created in my
project directory that inc
I fixed the path issue that was causing the spinning but now I'm back
to getting import errors even with __init__.py in my apache
directory. Here is the exact error from Apache's error.log.
...
[Thu May 27 10:18:18 2010] [error] [client 99.159.221.130]
_default = translation(settings.LANGUAG
On May 27, 10:51 am, Nuno Maltez wrote:
> > ImportError: No module named mvc
>
> What's the "mvc" module? Python can't seem to find it. Is it in your
> python path?
My project is called seoconquer.
My app is called mvc.
My absolute directory path to mvc is /home/seb/MAIN/seoconquer/mvc.
I have /
On May 27, 6:56 pm, Graham Dumpleton
wrote:
> You also need to add '/home/seb/MAIN/seoconquer'. Read:
>
> http://blog.dscpl.com.au/2010/03/improved-wsgi-script-for-use-with.html
I tried both versions of the wsgi script on your blog. And I still get
this same error.
ImportError: No module na
My Django app runs great with Apache+mod_wsgi.
Apache now runs my Django app as user www-data.
This causes issues since my Django app is sitting in my non-root
user's $HOME directory.
Best solution seems to be to add my user and www-data to same group
and then put my Django app directory in that g
I don't want Django site to block while form data is being processed.
What is easiest way to run a separate script in a separate thread or
process with form data as input parameters?
e.g. commands.getoutput("my_script arg1 arg2") or
os.system("my_script arg1 arg2") <--- possible to run the
1. Restarting Apache+mod_wsgi
2. Clearing Firefox cache and
3. Visiting Django app URL
are all done often when debugging/developing a DJango app under Apache
+mod_wsgi.
I've noticed with mod_wsgi, I will *SOMETIMES* get an error after this
triad.
Reloading the Django URL makes it go away so it o
On Jun 14, 7:02 pm, Graham Dumpleton
wrote:
> Use WSGI script described in:
>
> http://blog.dscpl.com.au/2010/03/improved-wsgi-script-for-use-with.html
In mod_wsgi's defense, remember that this error happens sporadically
and is NOT a showstopper as a reload makes it go away completely
(until a
I found the Apache error for this mod_wsgi error that only appears the
first time I reload an app after restarting Apache
[Tue Jun 15 18:12:39 2010] [error] [client ] request
failed: error reading the headers, referer: http://
--
You received this message because you are subscribed to the Go
On Jun 15, 6:42 pm, Graham Dumpleton
wrote:
> This occurs when Apache is first reading HTTP headers for request and
> long before it hands it off to any Django application or even
> mod_wsgi.
Is there anything I can do about this? I assume this means we should
pronounce the mod_wsgi setup I hav
How set initial form field value in the view function?
The initial keyword is great when defining a subclass of Form if you
the initial values is ALWAYS the same.
What if it varies?...I'm guessing I must set it in the view.
How set this initial value in the view?
Chris
--
You received this me
How interate over just a slice of form fields in template?
I tried {% for e in form|slice:":5" %} but it appears the slice part
is just ignored.
cs
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us.
Ever time a web page is visited, a view is called and a NEW request
object is passed in right?
Then if I'm not mistaken, it appears you can't maintain
request.session when you visit a new web page and a new view because a
NEW request object is passed in to the new view right?
My personal co
Wow beautiful. Thanks. I needed that.
cs
On Jul 10, 12:14 am, Javier Guerra Giraldez
wrote:
> On Fri, Jul 9, 2010 at 11:36 PM, Chris Seberino wrote:
> > elif form.is_valid():
> > ...
> > request.session["posts"].append(form.cleaned_data)
>
SESSION_SAVE_EVERY_REQUEST = True
(in settings.py)
seems to avoid a lot of potential bugs from forgetting to set
request.session.modified = True when necessary.
Is this a serious performance problem? If not, I would think this
would be a good *default* value for Django no?
Chris
--
You receiv
How can a view tweak the response object so that client sees a
specific anchor instead of the top of the page?
Chris
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubs
On Jul 15, 3:44 am, Daniel Roseman wrote:
> window.location = window.location + '#whatever'
I added that code to script element in head and it didn't work.
I have a TinyMCE javascript editor that gets run too. I don't know if
that is conflicting or if there is something else I need to do t
On Jul 15, 3:57 am, Oleg Lomaka wrote:
> First without javascript. You cat check URL of HttpRequest and if it is
> without
#anchor element, then send redirect to the same URL with #anchor.
Yes redirection is a great non-Javascript way to do this.
Is there ANY way to preserve the old form data t
On Jul 17, 11:16 am, Justin Myers wrote:
> or just put that one line (with a semicolon at the end, since it's
> missing one) in a
I understand the need for web pages to denote the 5 HTML special
characters >, &, <, ', and " with alternate representations like
".
(These 5 are the *only* special characters in HTML right?)
What I don't understand is why an HTML page encoded with UTF-8 would
use this ...; format for other
I'm trying to make the options of a particular drop down box be
determined at runtime.
I added a __init__ constructor to my django.forms.Form subclass as
follows...
def __init__(self,
data= None,
error_class =
d
On Aug 3, 3:29 am, Daniel Roseman wrote:
> Anyway, I suspect the cause is setting the widget.
I found my bug. To convert a textbox to a drop down box, it isn't
enough to reset the widget and choices settings. It is also necessary
of course to reset the field type from a CharField to a Choices
Adding extra attributes to User classes seems to be handled originally
by a "profiles".
A new way seems to be to subclass the User class.
One problem with the shiny new way is that lots of code is written to
handle User classes instead of subclasses. The suggested way to fix
this is nontrivial.
I don't know what changed but I can't seem to extract valid form data.
(It was working for months previously.)
Below is the function that creates new users when they register.
I store the data in cd. I can print the contents of cd and confirm cd
is a dictionary
but I can't access any values!!!
Fo
The following code extracts the user info from a registration page on
my Django site.
Lately it isn't extracting the different fields from
form.cleaned_data. When
I print cd["username"] (i.e. form.cleaned_data["username"]) it
gives the ENTIRE
form.cleaned_data dict!?!?! Why can't I extract ele
INVITATION_CODE = "You should have received one of these."
PAR_EMAIL_ADD = "Will be used for all communications."
PASSWORD= ""
STUD_FIRST_NAME = "Enter what the student prefers to go by."
STUD_LAST_NAME = ""
COURSE_1= "Select the course enrolled in and/or getting
tutoring in."
CO
> Field clean methods do not return cleaned_data dict, they return
> specific data from within that dict.
Tom
Thanks so much! That fixed it! For the life of me I can't
understand how my site has been operating
for MONTHS without this bug manifesting itself. I guess my site
didn't have to use
I have Homework objects that are related to Course objects for a
school related Django app. I can access Course and Homework objects
but there is one Homework query at the end of this email that bombs
and I don't know why.
===
First
I've noticed that this doesn't often work in Django shell...
x = MyModel.objects.all()
x[3].some_field = "new value"
x[3].save()
Rather, I must often do this...
temp = x[3]
temp.some_field = "new value"
temp.save()
*Sometimes* the first works and I don't know why.
Please advise.
Chris
--
Y
On Oct 7, 10:39 am, Jacob Kaplan-Moss wrote:
> On Fri, Oct 7, 2011 at 10:30 AM, Chris Seberino wrote:
>
> > I've noticed that this doesn't often work in Django shell...
>
> > x = MyModel.objects.all()
> > x[3].some_field = "new value"
> >
I printed the content_type of an uploaded file in Django and noticed
that for PDFs I was getting
"application/text"?
I was getting "application/pdf" a few days ago with same client,
server, browser, etc.
Anyone know what would cause content type to show wrong kind for PDFs?
cs
--
You received
I want some files to only be accessible by certain users.
For example, imagine a teacher wanting to distribute graded exams on a
Django server w/o violating any student's privacy.
Is there an easy way to do this?I am aware of the access control
decorator for specific views but not for specifi
On Dec 25, 7:53 am, Ivo Brodien wrote:
> > I was getting "application/pdf" a few days ago with same client,
> > server, browser, etc.
>
> If this really is the case and the code is exactly the same, maybe it depends
> somehow on the PDF itself? Did you check that?
I used the Linux/Unix file co
I get the following error when attempting to delete an object of my
model...
"AssertionError: Question object can't be deleted because its id
attribute is set to None."
The class definition is thus...
class Question(django.db.models.Model):
"""
Represents a database table.
I am proxying my Django app behind Apache. I created a 404.html in my
template directory but when I try to test it I get the following error
that appears to come from Apache...
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your requ
On Jan 21, 6:44 am, Tom Evans wrote:
> Models are representations of rows in a database.
> Deleting a model instance implies removing a row from a database.
> Model instances have an id attribute which denotes their row in the database.
> Models whose id is None don't exist in the database, and s
> Check your apache logs.
Last line below says error is that there is no handler500. I thought
a missing web page for some URL was a 404 error so I'm not sure why
this error is popping up.
cs
[Sat Jan 21 13:24:44 2012] [error] [client 75.108.243.48] mod_wsgi
(pid=19346): Exception occurred pr
On Jan 21, 2:43 pm, JohnA wrote:
> How are you finding these objects? That might point to the answer.
>
> Probably the likeliest explanation is that you are creating the
> objects but not saving them.
In the Django shell I do
quests = Question.objects.all()
quests[579].delete()
Why does the ob
I have a typical Django app using MySQL.
I've decided to change a model and make some fields unique=True
AFTER tables and data exist in MySQL.
I noticed that "python manage.py syncdb" doesn't automatically modify
MySQL
database to make desired fields unique now.
Is there some MySQL command line
Shawn
Thanks! Is South just a script that runs? Can I uninstall after the
conversion if desired?
Or, does it permanently alter a Django app somehow?
cs
On May 14, 10:53 pm, Shawn Milochik wrote:
> The best way is to use South.
>
> http://south.aeracode.org/
>
> In your current situation, aft
I have 3 classes that have a ManyToMany relation with the User class.
When I try to do syncdb I get this error
Error: One or more models did not validate:
mvc.course: 'users' has an m2m relation with model User, which has
either not been installed or is abstract.
mvc.homework: 'users' has an
I am migrating my Django app from an old database to a new one with
DIFFERENT model classes. How can I copy my passwords/hashes over?
Is there some special way to copy over the hash? Is that even
possible?
A MySQL command line would be fine.
cs
--
You received this message because you are su
I have a model class called Message with an attribute called text.
** When I pass a list of these objects called messages to my template,
it doesn't show up.
** When I instead create this derivative called fred, that *does*
work...
fred = [e.text for e in messages]
Why would fred work f
On May 21, 5:22 am, Duane Griffin wrote:
> Is the messaging framework configured (note that it is by default)?
Wow. I thanks so much! I never would have caught this!
I renamed Message to Annoucement and now it works!
cs
--
You received this message because you are subscribed to the Google G
When I restart my server, I get an error on the first page reload and
then all is fine on the second page reload!
The error is this...
--
ViewDoesNotExist at /blog
Tried blog in module mvc.controllers.controllers. Error was: 'module'
object has no attribute 'models'
I get a similar err
On May 21, 6:35 pm, Mateusz Marzantowicz
wrote:
> What server are you using? What is your configuration? Do you have mod_wsgi,
> mod_python or something else? What is your browser, OS, etc. Please do not
> let us guess.
I am using mod_wsgi which uses Apache 2.2.16
I use Firefox on Ubuntu Linux 10
Mateusz
Thanks for the feedback. Those docs you pointed to were about missing
views. I checked and my views are not missing.
I looked more closely at the error message and noticed it appears to
be complaining that my models are missing. I don't know if that
helps. (see below) Could it also b
I have Apache in front of my Django app. It forces login pages to use
HTTPS but then forces rest of pages to only use HTTP.
Is client browser sending sensitive login or session info in the clear
when I am not using HTTPS?
My nonencrypted pages don't present or ask for sensitive info. The
only d
On Jun 14, 10:47 am, Tom Evans wrote:
> Yes, of course it is - HTTP is stateless, so how else would sessions
> work if the session id is not transmitted back to the server by the
> browser?
I agree. Yet, eBay, Google Groups & Godaddy drop down to HTTP after
login.
Why aren't they worred?
cs
-
My Django app only allows someone to access a /books page, that is
part of the Django app, if they are signed in.
The pages below that URL are just static directory listings of PDFs
all handled by Apache.
For example /books/book_1, /books/book_2, etc.
Because these directory listings aren't handl
On Aug 1, 7:11 am, DrBloodmoney wrote:
> You can look into protecting them with mod_xsendfile for Apache
Thanks. I'll look into that. Is there no way to have a view hand off
a page to Apache?
If there was, I could have a view that was password protected and only
when I was in the view would I
How configure Django to handle /books URL and yet allow access to PDFs
and images in subdirs of /books?
Specifically, I want /books to be a dynamic page with lots of links to
PDFs and images of book covers contained in subdirectories of /books
like /books/some_book_1 and /books/some_book_1/book_co
On Jan 4, 2:48 am, Graham Dumpleton
wrote:
> If using Apache/mod_wsgi it is quite simple, and wouldn't even need URL
> rewriting as suggested by others.
>
> So, what are you hosting it with.
Yes I am using mod_wsgi. The following line sends all URLs to WSGI
script
WSGIScriptAlias/
Nevermind. I figured it out. To only have subdirs by static you need
to add a "/" at the end of an Alias line...
e.g.
Alias /books/ /some/static/dir/
Thanks!
cs
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send
My Django app's html won't validate because CSRF middleware adds
hidden
tags like this...
The only problem is the slash "/>" at the end.
How make Django templates not automatically add hidden tags that won't
validate?
Thanks!
cs
--
You received this message because you are subscribed to the
Ian
Thanks for the reply. Your solution makes perfect sense. My forms
are
automatically generated by Django via Form classes. So I can't
embed this suggested input element in any form element present in my
template.
Where should I put this code in since there is no form element?
cs
>
>
My views have the standard decorator to automatically bounce clients
to the login page if they are not logged in
@django.contrib.auth.decorators.login_required
I would like to dynamically set the hidden next parameter in the login
template to the aforementioned page they were trying to access
I'm using Django authentication for my http://phil4.com/sign_in page.
You notice all the Django form input elements generated on that page
don't validate
(They have a "/>" at the end rather than just ">".)
How fix!?
cs
--
You received this message because you are subscribed to the Google G
By the wayby "validate" I meant to say that I want it be be *valid
HTML*.
cs
On Apr 9, 12:06 am, Chris Seberino wrote:
> I'm using Django authentication for myhttp://phil4.com/sign_inpage.
>
> You notice all the Django form input elements generated on that page
>
Sorry n/m. Apparently this is a long running discussion. I just
found the
start of a big part of it...
http://groups.google.com/group/django-developers/browse_thread/thread/bbf75f0eeaf9fa64/59822bbce1e0be22?#59822bbce1e0be22
cs
On Apr 9, 12:08 am, Chris Seberino wrote:
> By the way...
How pass custom data to login template? (Seems only some like 'next'
param are allowed!?)
The reason for this problem is the Django auth system doesn't ask user
to
write the view for login page.
cs
--
You received this message because you are subscribed to the Google Groups
"Django users" gro
Perhaps can wrap the default login view by calling it in my own view?
I really just need to add a few elements to dict I assume gets emitted
by it.
cs
On Apr 11, 5:00 am, bruno desthuilliers
wrote:
> On 11 avr, 01:20, ChrisSeberino wrote:
>
> > How pass custom data to login template? (Seems onl
I tried viewing the value of is_authenticated() for a user and it always is
true...before and after logging in and after signing out.
I'm trying to determine if a user has logged in or not. Is this the right
variable to use? Why not changing?
Thanks.
cs
--
You received this message becaus
Is there a way to answer your question "is user x logged into the website
right now" in Django code?
On Thursday, July 31, 2014 11:05:29 AM UTC-5, cmawe...@gmail.com wrote:
>
> Right, the question isn't "is user x logged into the website right now",
> it actually only makes sense for for request
Is this the latest greatest docs for Django on Google AppEngine?
http://django-nonrel.org/
There seems to be another page high on a search:
http://www.allbuttonspressed.com/projects/djangoappengine#installation
With the first doc I was able to get a toy Django app running wit
My fresh Django install on Ubuntu 14.04 works fine. WSGI starts the app up
just fine.
I can run manage.py without getting this error...
% ./manage.py
Traceback (most recent call last):
File "./manage.py", line 6, in
django.core.management.execute_manager(settings)
AttributeError: 'modul
ODULE", "philfour.settings")
django.core.management.execute_from_command_line(sys.argv)
On Monday, August 11, 2014 11:00:22 AM UTC-5, Chris Seberino wrote:
>
> My fresh Django install on Ubuntu 14.04 works fine. WSGI starts the app
> up just fine.
>
> I can run m
If I set DEBUG=True this Django app runs fine. If I remove DEBUG=True I get
a "Bad Request (400)" and apache error logs show lots of this..
[Fri Aug 15 03:04:27.400567 2014] [core:warn] [pid 2011:tid
140575764432768] AH00045: child process 2015 still did not exit, sending a
SIGTERM
[Fri Aug 15
Ug!! That was it!! THanks!!!
cs
On Thursday, August 14, 2014 10:14:34 PM UTC-5, Collin Anderson wrote:
>
> a quick thing to check: is your ALLOWED_HOSTS set correctly?
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this
I cannot track down why 404 page isn't being used. I can't get any help
from syslog or Nginx log files.
I tried adding DEBUG=True to settings.py and still no clues.
I only get "Server Error 500".
Here is settings.py
TEMPLATES= [{"BACKEND" :
"django.template.backe
>
> For more information, you need to show us your nginx configuration and
> your wsgi server configuration.
>
>
>
Thanks a million. Here is what you asked for...
---
% mor
I didn't have logging enabled in my settings.py.
Problem solved.
>
>
>
> ---
> % more nginx.conf
>
> server {
> server_name ~^(www\.)?domainname\.(org|co
I'm trying to get a 404 page to show instead of a 500 error when Django app
sees a nonexistent URL.
I'm still getting 500 errors with this clue in logs but I don't know what
it means
Please explain "TypeError: handle_404() got an unexpected keyword argument
'exception'"
(The nonexistent U
>
>
>>
>> Please explain "TypeError: handle_404() got an unexpected keyword
>> argument 'exception'"
>>
>
> It means literally that "handle_404() got an unexpected keyword argument
> 'exception'", how are you calling handle_404()?
>
>
Thanks for your help. In my urls.py I have this...
django.c
>
>
>
> And what does your handle_404 function look like? As the error says, it
> needs to accept an "exception" keyword argument.
>
> Note also that overriding the 404 handler is a very specialized thing to
> do and is almost always not required. Why are you doing this?
>
>
Here it is. The
Maybe this will shed some light
https://medium.com/@cseberino/toll-equality-b11b07267456
>
>
--
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+u
Why redirects to foo.com/?next=/some/folder show up as
foo.com/?next=%2Fsome%2Ffolder in browser? (i.e. how remove the %2F's? )
Is there a function I can call on URLs built in a view to avoid that?
cs
--
You received this message because you are subscribed to the Google Groups
"Django users"
I am trying to be consistent and make urls.py expect / after every url.
The problem is Django isn't automatically adding / at the end and so now
I get 404s when I try to access my web pages.
How fix?
Thanks!
Chris
--
You received this message because you are subscribed to the Google Groups
On Saturday, April 23, 2016 at 2:47:58 PM UTC-5, François Schiettecatte
wrote:
>
> Because the slashes are escaped, this is normal as they are a parameter
> and not part of the path itself.
>
> Why URLs created by Django show /'s instead of %2F's? The Django code
knows how to
fix the appeara
I have this urlpattern to map base url (easycharting.tk/) to a view called
home...
urlpatterns = [django.conf.urls.url("^$", mvc.controllers.controllers.home)]
If you visit easycharting.tk/ you'll notice it automatically REMOVES the ending
/.
Why?
For all other suburls, it ADDS the missing /!
But I still don't see why sometimes the slash is escaped then sometimes it
isn't. I've seen both ways for query parameters The ugly Escape version
shows up when I have handmade URLs but not when Django creates the next URL
itself like for logging in
--
You received this message because yo
Nevermindthis is weird but the / at end was there but Chrome browser
doesn't display it.
When I pasted the url into a terminal is was there. Also, using curl I got
the real info
and it was there. Weird
On Saturday, April 23, 2016 at 5:10:52 PM UTC-5, Chris Seberino wrote:
>
>
at 7:50:21 PM UTC-5, Stephen Butler wrote:
>
> You mean on the standard login form? The hidden "next" form value? That
> value isn't part of a URL so it isn't URL escaped. It's part of the HTML
> attribute value, so it is HTML attribute escaped.
>
> On
I love Django. It is a beautiful system for developers. You seem to start
at a lower level with Django than with WordPress which gives you more power
and flexibility.
Nevertheless, I also like how WordPress STARTS with a very professional
looking sites and almost locks you into a nice looking
Flask has a neat design where instead of having a urls.py file they bind
URLs to view functions with decorators.
Possible to do something similar with Django? What modifications would be
needed?
Thanks,
cs
--
You received this message because you are subscribed to the Google Groups
"Django
I'm trying to create a simple stripped down skeleton Django application.
Django ver1.9 forces
everything to be in apps which are not needed for this application.
When I try using models I get an error like the following:
"Model class doesn't declare an explicit app_label and isn't in an
applic
>
>
> Just think of an app actually being a namespace rather than an app.
> Django uses INSTALLED_APPS entries just like a search path added to the
> BASE_DIR so it can find your models.
>
>
Ah yes thanks. That helped a lot. I just needed to basically mention
the directory in settings.py and
On Saturday, April 2, 2016 at 5:37:22 PM UTC-5, Devrhoid Davis wrote:
>
> Hi All,
>
> I have been working with Python for just over 3 years now and have
> recently taken up django. I have completed both the polls app and have
> created an address book app by following a tutorial on youtube. I
I can't seem to get authenticate to return a User object even when password
is correct.
I dropped into a Django shell to recreate the problem.
>>> js
>>> js.username
'jsmith'
>>> js.check_password("test")
True
>>> django.contrib.auth.authenticate(username = 'jsmith', password = "test")
>
Solved...must add AUTHENTICATION_BACKENDS =
["django.contrib.auth.backends.ModelBackend"]
to settings.py
On Thursday, April 21, 2016 at 5:20:38 PM UTC-5, Chris Seberino wrote:
>
> I can't seem to get authenticate to return a User object even when
> password is corre
91 matches
Mail list logo