urlpatterns += patterns('bullet.views.noticeview', (r'^$', 'notice'), (r'^board', 'board'),)
What do you mean it doesn't work? What error message you get? Are you sure it is provided by Django and not the webserver?
Also, GMail is marking your message as a possible malware; consider pasting your urls.py inline instead of an attachment.
--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/48902712-26b6-4f3a-b465-ab4699f4dbfb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
from django.conf.urls import include, url, patternsfrom django.contrib import admin
urlpatterns = [ url(r'^admin/', include(admin.site.urls)),]
urlpatterns += patterns('bullet.views.noticeview', (r'^$', 'notice'), (r'^board', 'board'),)
def notice(request): logger = logging.getLogger('school') logger.info("ko ") board_list=board.objects.using("default").all() return render_to_response('index.html',locals())
def board(request): t = loader.get_template("index.html") response_data = {} response_data["result"] = "Y" board_list=board.objects.using("default").all() response_data["content_html"] = t.render(Context({'board_list':board_list})) return HttpResponse(json.dumps(response_data), content_type="application/json")
def board(request): logger = logging.getLogger('school') logger.info("ko ") board_list=board.objects.using("default").all() return render_to_response('index.html',locals())
On May 9, 2016 10:06, "minom du" <min...@gmail.com> wrote:
>
> sorry,my english is not good
> my urls.py is
> from django.conf.urls import include, url, patterns
> from django.contrib import admin
>
> urlpatterns = [
> url(r'^admin/', include(admin.site.urls)),
> ]
>
> urlpatterns += patterns('bullet.views.noticeview',
> (r'^$', 'notice'),
> (r'^board', 'board'),
> )
patterns is going away soon, so try this instead:
urlpatterns = [
url(r'^admin/', include(admin.sites.urls)),
url(r'^$', 'notice'),
url(r'^board', 'board'),
]
My guess is that it will solve your problem. If not, come back to us with the results!
> so i don't understand why ubuntu+nginx will return 404 not found
>
>
>
>
>
>
>
>
> Gergely Polonkai於 2016年5月9日星期一 UTC+8上午1時36分49秒寫道:
>>
>> What do you mean it doesn't work? What error message you get? Are you sure it is provided by Django and not the webserver?
>>
>> Also, GMail is marking your message as a possible malware; consider pasting your urls.py inline instead of an attachment.
>>>
>>>
> --
> 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...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c23eb219-a5ba-4353-b938-79c478783921%40googlegroups.com.
thanks ,but it not fix the problem
[uwsgi]vhost = trueproject=schoolbase = /home/minom/projectplugins =http, python3socket = /tmp/school.sockmaster = trueenable-threads = trueprocesses = 4wsgi-file =/home/minom/project/school/school/wsgi.py
chdir = /home/minom/project/schoolmodule = %(project).wsgi:application
server { listen 82 default_server; listen [::]:82 default_server; client_max_body_size 4G; charset utf-8; root /home/minom/project/school/school;
index index.html index.htm index.nginx-debian.html;
server_name _;
access_log /var/log/nginx/school.access.log; error_log /var/log/nginx/school.error.log;
location /static/ { autoindex on; alias /home/minom/project/school/static/; }
location /_upload/ { autoindex on; alias /home/minom/project/school/_upload/; }
location /templates { autoindex on; alias /home/minom/project/school/templates/; } location / { uwsgi_pass unix://tmp/school.sock; include uwsgi_params; try_files $uri $uri/ =404; }
}
<uwsgi> <module>wsgi</module> <master>true</master> <pidfile>/home/minom/project/School/school.pid</pidfile> <socket>127.0.0.1:9998</socket> <processes>5</processes> <uid>1000</uid> <gid>2000</gid> <harakiri>20</harakiri> <limit-as>128</limit-as> <max-requests>5000</max-requests> <vacuum>true</vacuum> <plugin>python3</plugin> <pythonpath>/home/minom/project/school/school</pythonpath> <logdate>true</logdate> <daemonize>/home/minom/project/school/school/uwsgi.log</daemonize></uwsgi>
when i run localhost:82 it will run notice and goto index.htmlbut when i run localhost:82/boardit will return 404 not found
If your 404 pages are white with DEBUG=True, then the problem lies within the web server config. Could you show us the working apache config, too?
<VirtualHost *:8080>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /static /home/minom/project/school/static <Directory /home/minom/project/school/static> Require all granted </Directory> WSGIScriptAlias / /home/minom/project/school/school/wsgi.py WSGIDaemonProcess abc.com user=minom processes=2 threads=15 WSGIProcessGroup abc.com <Directory /home/minom/project/school/school> <Files wsgi.py> Require all granted </Files> </Directory> </VirtualHost>
location / {uwsgi_pass unix://tmp/school.sock;include uwsgi_params;try_files $uri $uri/ =404;}