css

33 views
Skip to first unread message

Diogene Laerce

unread,
Oct 20, 2013, 8:07:20 AM10/20/13
to django...@googlegroups.com
Hi,

Could someone tell me if it is normal to have the css not working once one
starts the real server (nginx) instead of the dev server on the admin
interface ?

Cos we've got a nice view under the dev server but I surely miss
something in
my static files configuration as I didn't find where to point the admin
css to ?

So the question would be where the dev server point to find his css config ?
Or do I have to write my own (for the admin interface) ?

Thank you

--
�One original thought is worth a thousand mindless quotings.�
�Le vrai n'est pas plus s�r que le probable.�

Diogene Laerce

Timothy W. Cook

unread,
Oct 20, 2013, 8:12:24 AM10/20/13
to django...@googlegroups.com
Check the FAQs or Google django staticfiles. 


On Sun, Oct 20, 2013 at 10:07 AM, Diogene Laerce <me_bu...@yahoo.fr> wrote:
Hi,

Could someone tell me if it is normal to have the css not working once one
starts the real server (nginx) instead of the dev server on the admin interface ?

Cos we've got a nice view under the dev server but I surely miss something in
my static files configuration as I didn't find where to point the admin css to ?

So the question would be where the dev server point to find his css config ?
Or do I have to write my own (for the admin interface) ?

Thank you


--
“One original thought is worth a thousand mindless quotings.”
“Le vrai n'est pas plus sûr que le probable.”  

                                              Diogene Laerce

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5263C778.1000802%40yahoo.fr.
For more options, visit https://groups.google.com/groups/opt_out.



--
MLHIM VIP Signup: http://goo.gl/22B0U
============================================
Timothy Cook, MSc           +55 21 94711995
MLHIM http://www.mlhim.org
Like Us on FB: https://www.facebook.com/mlhim2
Circle us on G+: http://goo.gl/44EV5
Google Scholar: http://goo.gl/MMZ1o
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook

Mike Dewhirst

unread,
Oct 20, 2013, 8:19:31 AM10/20/13
to django...@googlegroups.com
On 20/10/2013 11:07pm, Diogene Laerce wrote:
> Hi,
>
> Could someone tell me if it is normal to have the css not working once one
> starts the real server (nginx) instead of the dev server on the admin
> interface ?

The dev server "just knows" where the static files are. The real server
needs to be configured.

Run manage.py collectstatic to pick up all the static files from
wherever they are in your project (if the dev server can find them so
will collectstatic) and put them into STATIC_ROOT

Configure nginx to serve them from there ...

https://docs.djangoproject.com/en/1.5/howto/static-files/deployment/

Good luck

Mike

Diogene Laerce

unread,
Oct 21, 2013, 2:39:15 AM10/21/13
to django...@googlegroups.com

> On 20/10/2013 11:07pm, Diogene Laerce wrote:
>> Hi,
>>
>> Could someone tell me if it is normal to have the css not working
>> once one
>> starts the real server (nginx) instead of the dev server on the admin
>> interface ?
>
> The dev server "just knows" where the static files are. The real
> server needs to be configured.
>
> Run manage.py collectstatic to pick up all the static files from
> wherever they are in your project (if the dev server can find them so
> will collectstatic) and put them into STATIC_ROOT
>
> Configure nginx to serve them from there ...
>
> https://docs.djangoproject.com/en/1.5/howto/static-files/deployment/

Thanks a lot, it worked well !

Diogene Laerce

unread,
Oct 21, 2013, 8:35:25 AM10/21/13
to django...@googlegroups.com
Hi,

Anyone could share a good process control system software name to use
with uwsgi ? Apart from supervisor, I couldn't make it work :
- can't stop it only kill it
- bug on supervisorctl reload.. Even when using the last version.

Thank you

Lukas Nemec

unread,
Oct 21, 2013, 8:31:30 AM10/21/13
to django...@googlegroups.com
On 10/21/2013 02:35 PM, Diogene Laerce wrote:
> Hi,
>
> Anyone could share a good process control system software name to use
> with uwsgi ? Apart from supervisor, I couldn't make it work :
> - can't stop it only kill it
> - bug on supervisorctl reload.. Even when using the last version.
>
> Thank you
>
Hi,

I'm using supervisor without problems on debian..

the trick is to add supervisor command that specifically tells the
program to NOT daemonize

[program:my_uwsgi]
command = /usr/local/bin/uwsgi -i /path/to/config.ini
autorestart = True
user = your_user

config.ini:
your standard uwsgi config, but NO daemonize=logfile path

that works perfectly

I'm reloading all the time ..

Diogene Laerce

unread,
Oct 21, 2013, 8:51:28 AM10/21/13
to django...@googlegroups.com
Thanks for reply.

> the trick is to add supervisor command that specifically tells the
> program to NOT daemonize
>
> [program:my_uwsgi]
> command = /usr/local/bin/uwsgi -i /path/to/config.ini
> autorestart = True
> user = your_user
>
> config.ini:
> your standard uwsgi config, but NO daemonize=logfile path
>
> that works perfectly
>
> I'm reloading all the time ..

That means that you need to reload for every change in the code source,
doesn't it ?
There's no over way ?

Lukas Nemec

unread,
Oct 21, 2013, 8:47:01 AM10/21/13
to django...@googlegroups.com
On 10/21/2013 02:51 PM, Diogene Laerce wrote:
> Thanks for reply.
>
>> the trick is to add supervisor command that specifically tells the
>> program to NOT daemonize
>>
>> [program:my_uwsgi]
>> command = /usr/local/bin/uwsgi -i /path/to/config.ini
>> autorestart = True
>> user = your_user
>>
>> config.ini:
>> your standard uwsgi config, but NO daemonize=logfile path
>>
>> that works perfectly
>>
>> I'm reloading all the time ..
>
> That means that you need to reload for every change in the code
> source, doesn't it ?
> There's no over way ?
>
>
Exactly, the uwsgi has no idea that you edited .py files, you need to
reload it. although there is some feature like the django server of
autoreload, but just to be safe, you should reload the uwsgi processes
by hand. I think I even saw some plugin for supervisor that does this
automatically, but I'm not sure...

Hoewer on a different note, you should have your dev code separated from
production, so you don't change it that often that it would bother you
to reload it :)

Lukas

Roberto De Ioris

unread,
Oct 21, 2013, 8:47:29 AM10/21/13
to django...@googlegroups.com

> Hi,
>
> Anyone could share a good process control system software name to use
> with uwsgi ? Apart from supervisor, I couldn't make it work :
> - can't stop it only kill it
> - bug on supervisorctl reload.. Even when using the last version.
>
> Thank you
>


Are you sure you need one ?

uWSGI Emperor is way more capable (in terms of monitoring and management
of bad-behaving apps) and easy to manage (just drop files in a directory)

By the way, if you cannot use distro-included process managers (upstart or
systemd), i find circus a great alternative to suprvisord. I have seen lot
of users happy with 'god' too (it is a ruby app)

--
Roberto De Ioris
http://unbit.it

Diogene Laerce

unread,
Oct 22, 2013, 12:24:36 PM10/22/13
to django...@googlegroups.com
Actually it didn't work for me : all my troubles remained the same.

I found another software in the repositories : monit. It works (well I
managed to
make it work..) and I can even monitor CPU load with it. But I didn't
see anyone
use it in a django stack, do you know why ?

Thanks anyway

Diogene Laerce

unread,
Oct 22, 2013, 12:24:05 PM10/22/13
to django...@googlegroups.com

> Are you sure you need one ?
>

Well I need to monitor at least uwsgi to keep the site up. I rely now on
monit,
it seems ok. Like I asked to Lukas, what do you think of it ?

> uWSGI Emperor is way more capable (in terms of monitoring and management
> of bad-behaving apps) and easy to manage (just drop files in a directory)
>

Yes I think I saw something like that on my readings but it seemed (on the
moment) way over my humble needs : I've got only 1 application to run.

> By the way, if you cannot use distro-included process managers (upstart or
> systemd), i find circus a great alternative to suprvisord. I have seen lot
> of users happy with 'god' too (it is a ruby app)
>

I tried circus : it's nice but there is no much docs on it and I'm quite
a newbie
at all this.

And I just realize now that when you said 'god', you didn't mean 'God'.. :)
So I may give a shot later.

Lukáš Němec

unread,
Oct 22, 2013, 12:27:59 PM10/22/13
to django...@googlegroups.com
Dne 22. 10. 2013 18:24, Diogene Laerce napsal(a):
Never heard of monit... so can't tell you much :)
Reply all
Reply to author
Forward
0 new messages