Forum

You are not logged in.

#1 29-10-2007 09:42:15

grimborg
Membre
Registered: 28-10-2007
Posts: 2

can't get django to work

Hi,

First of all, apologies for not writing in French. I can read it, but cannot write it.

I'm having trouble getting django to work. I've done many tries and spent a lot of time but still cannot get it to work.

I have created a project "mysite" using django's tools, so all my files are under mysite/.

I have tried the dev server (running lynx via ssh) and I got the admin pages and some simple views to work, but when I try the "real" server some urls need to be written as /mysite/url and some others as only /url. For example, to get to the admin page I have to go to /mysite/admin, but the login form leads to /admin (which gives a 404).

I tried to circumvent this by creating a .htaccess in /, but couldn't make it work. Also I think there must be an easy way, only I can't find it.

BTW, how does restart work? I find out that very usually I click restart but nothing happens, my application is still using the old files... I've run find . | xargs touch on my files prior to restarting, but still it didn't restart. Do I have a number of restarts per hour or something?

I read your tutorial, the forums and the Django tutorial on deployment using FastCGI and spent a great deal of time, and I really think I cannot solve this by myself. Could you lend me a hand, please?

My url here is http://grimborg.alwaysdata.net/

Merci!

Last edited by grimborg (29-10-2007 09:47:25)

Offline

#2 29-10-2007 09:57:10

@Cyril
Staff
From: Paris
Registered: 06-02-2007
Posts: 5,645
Website

Re: can't get django to work

Hi,

About the admin URL, that's a known bug in Django that assumes that your application is located in root (/). If that's not the case, well... you could get away with some .htaccess I guess. Anyway, try to put your Django application in root (you do not need to move your files, just redirect your subdomain, grimborg.alwaysdata.net to /mysite, in your alwaysdata admin).

Restart works using the restart button in your alwaysdata administration, in Web/Opérations/Restart. Touching the FCGI does not work as we use mod_fcgid, not mod_fastcgi. By the way, we recommend developing your apps locally (= on your own computer) or on our SSH server with the Django dev server. Contact us to get a port range so you don't have to use lynx.

Don't hesitate to ask more questions if you're still in trouble.

Offline

#3 29-10-2007 10:26:51

grimborg
Membre
Registered: 28-10-2007
Posts: 2

Re: can't get django to work

Merci! Redirecting / to /mysite was really useful smile

It still takes a long time from i hit restart till it actually restarts (and sometimes it looks like it doesn't restart at all). I've requested a port range so I can work on dev and don't need so many restarts.

Thanks

Offline

#4 16-11-2007 20:16:38

ton.biegstraaten
Membre
From: Zoetermeer Les Pays Bas
Registered: 14-11-2007
Posts: 4
Website

Re: can't get django to work

About returning to /admin instead of /mysite/admin. I think it's a feature. After a lot of expiriments, reading the web and fighting te cashing of both the browser and the webserver I found a setup in which you can have more django apps in different subdirs without redirecting to /.
When you perform the next commands:
make a dir: mkdir ex
and then cp -R /home/abi/ex ex
You get my setup for two projects(mysite and newproject(the same as mysite, only with other names, some in Dutch, but never mind)). Look at the files. All is to be placed in the www directory. The rewrite in .htaccess to mysite/media should probably be generalised.
This works anyway for me.
Hope it helps

Offline

Board footer

Powered by FluxBB