Django under supervisord? - python

django project is running under supervisord, when i try to edit the html templates, nothing changes in the web site, should I restart the supervisord or is there other easier way to make changes to the project?

Related

How to start two Django applications at the same server?

I am going to use both Saleor and Wagtail in the same project.
Saleor will take care of all shop related functionalities and Wagtail will be the CMS for everything else (it is a lot of content).
What I need as advice is to how can I run both applications from the same server?
E.g. wagtail will serve urls like www.example.com/about-us etc. and Saleor will serve www.example.com/shop
I understand that this will happen in urls.py but, what confuses me is when I run ./manage.py runserver at the Saleor end how is this going to start the wagtail server.
So basically how can I start both apps with one single management command and share the resource? (it is still a localhost project)
I will be thankful if somebody can show me some web resources about the topic if my approach is correct or can point in a better direction.

How to Access URL of Localhost Django Project - Page Not Found

I transferred my Django project from a Ubuntu server that is currently serving the website. I'm trying to run this project on a localhost MacOSX environment for testing purposes. The command I'm familiar with for Django projects is:
python manage.py runserver
After which when I input 127.0.0.1:8000 into a browser, the project displays.
But my Ubuntu server is not currently running a script in that form, rather in the form of
python manage.py celeryd
My knowledge of how celery interfaces with Django is somewhat limited so this question may be very basic, but I can't find the URL to display the project.
On my Mac server, when I run:
python manage.py celeryd
the script does not error out on me--instead, it appears to be working by displaying this:
However, I don't know how to access the project. When I put 127.0.0.1 in the browser (and many other possible variations using different ports), I get Page Not Found.
Any help is greatly appreciated.
First you need to define 'core' template tag in one of your apps templatetags library say custom_tags.py. Make sure that this app is added to INSTALLED_APPS in settings. Then in your html template add
{% load custom_tags %}
It will fix the error you are getting. For more details please read docs.
You seem confused about what celery is. It is not a webserver, and it won't serve pages for you. It is an offline task manager, useful for performing complex or long running jobs that aren't appropriate to do in the context of a web request.
You'll need an actual web server alongside celery to serve your site itself.

Saving Changes To Django with Nginx?

Anything I modify on my Django app has no effect with what's live on the webapp itself. I can delete the entire project directory and my Django app still works.
With Django and Apache, I would simply enter:
/etc/init.d/apache2 restart
And any changes made to my Django application would go live immediately after Apache was restarted. But with this new Nginx, the same thing doesn't work:
/etc/init.d/nginx restart
My Django home page still shows the:
It worked!
Congratulations on your first Django-powered page.
How do I make my Python changes go live with Django and nginx?
What is your Nginx configuration? What is your WSGI runner, are you using Nginx-wsgi or the inbuilt Django 'runserver' command?
It sounds like the "it worked" page is on a separate port, and you're testing it directly -- not via Nginx. It's really easy to get the two of them confused :)
Nvm just figured it out. For Django One Click Install Image on Digital Ocean you need to run:
service gunicorn restart
After you've made all the changes and you'd like to test changes to your web app.

Refresh urls.py cache in django

I'm using django on nginx with FastCGI and i have a problem with urls.py. According to this question, django caches url.py file and i'm - just like above question's author - not able to modify my URLs definitions.
My question is - is there any way to clear url cache in django/nginx/fcgi without server restart (which not helps anyway)?
This is not just a urls.py thing, it's normal workflow for running a wsgi or fastcgi app. The module is in memory, and it doesn't get reloaded from disk until you tell the server that it's changed.
As per Django's FastCGI docs:
If you change any Python code on your site, you'll need to tell FastCGI the code has changed. But there's no need to restart Apache in this case. Rather, just reupload mysite.fcgi, or edit the file, so that the timestamp on the file will change. When Apache sees the file has been updated, it will restart your Django application for you.
If you have access to a command shell on a Unix system, you can accomplish this easily by using the touch command:
touch mysite.fcgi
For development, in most cases you can use the django development server, which watches for code changes and restarts when it sees something change.
You don't need to restart the whole server, just your FastCGI app. However, I don't know why you say this doesn't help - this is the way to do it. It can't not help.

can a django application be run using paster?

can a django application be run using paster? Or is it pylons specific?
It's pylons specific. There was a Django Paste project, but I'm not sure if it's active or how much progress was ever made.

Categories

Resources