manage.py

Permission denied in Django makemessages

断了今生、忘了曾经 提交于 2020-01-15 10:13:18
问题 I'm trying to add i8n into a Django app, but when I execute: (venv) user@machine:~/path/to/repo$ django-admin makemessages -l es The next error is thrown: PermissionError: [Errno 13] Permission denied: './venv/lib/python3.5/site-packages/Jinja2-2.9.5.dist-info/LICENSE.txt.py' But if I use it with manage.py instead of django-admin it works correctly. In django documentation they recommend to use django-admin. Any ideas? 回答1: Django's doc does not really "recommand" to use django-admin instead

Problem with Django-1.3 beta

◇◆丶佛笑我妖孽 提交于 2020-01-03 07:27:06
问题 Guys!! I'm really enthusiastic in learning django and learnt a bit on Django-1.2 but then I installed 1.3 version which is ok till I run the server using the command "python manage.py runserver". It's giving a huge error. I can't figure out a way to solve this. And error is given as : Traceback (most recent call last): File "manage.py", line 11, in <module> execute_manager(settings) File "/usr/local/lib/python2.6/dist-packages/django/core/management/__init__.py", line 438, in execute_manager

django change default runserver port

跟風遠走 提交于 2019-12-28 07:47:12
问题 I would like to make the default port that manage.py runserver listens on specifiable in an extraneous config.ini . Is there an easier fix than parsing sys.argv inside manage.py and inserting the configured port? The goal is to run ./manage.py runserver without having to specify address and port every time but having it take the arguments from the config.ini . 回答1: create a bash script with the following: #!/bin/bash exec ./manage.py runserver 0.0.0.0:<your_port> save it as runserver in the

django logging in script near manage.py - messages are just ignored

限于喜欢 提交于 2019-12-24 07:26:54
问题 I'm using Django 1.4.1. There's a script tmp.py in the same direcotry as manage.py , it does some routime operatons and is started from cron with command like python /path/to/project/tmp.py Here is tmp.py : import os if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "MYPROJECT.settings") if __name__ == "__main__": import logging logger = logging.getLogger('parser.test') logger.info('Hello, world') This script makes a log entry, but this entry is just ignored by logger

django manage.py syncdb not working?

自作多情 提交于 2019-12-22 10:43:37
问题 Trying to learn Django, I closed the shell and am getting this problem now when I call python manage.py syncdb, any idea what happened?: I've already set up a db. I have manage.py set up in the folder django_bookmarks. What's up here? Traceback (most recent call last): File "manage.py", line 2, in <module> from django.core.management import execute_manager ImportError: No module named django.core.management my-computer:~/Django-1.1.1/django_bookmarks mycomp$ export PATH=/Users/mycomp/bin:

How to load .sql file with manage.py

与世无争的帅哥 提交于 2019-12-13 16:16:52
问题 I have a .sql file from one of my production servers, and am now trying to load it into the database of another. I tried python manage.py loaddata, but its giving me an error CommandError: Problem installing fixture 'social': sql is not a known serialization format. How can I load my data into postgres from a .sql file with manage.py ? 回答1: Django managment doesn't work with SQL as per documentation on initial data A fixture is a collection of data that Django knows how to import into a

Run manage.py migrate but no accout related tables created in graphite.db

无人久伴 提交于 2019-12-12 02:33:01
问题 I'm installing graphite 0.9.15 on Ubuntu Server 16.04 LTS. During configuration step cd /opt/graphite/webapp/graphite sudo cp local_settings.py.example local_settings.py Then using the command in the official installation instruction: sudo PYTHONPATH=/opt/graphite/webapp/ python manage.py migrate --settings=local_settings Gave information Operations to perform: Apply all migrations: (none) Running migrations: No migrations to apply. Then I went to check the graphite.db sqlite3 graphite.db

manage.py syncdb error while Django model using non-ascii verbose_name

懵懂的女人 提交于 2019-12-11 13:39:40
问题 I am pretty new to Django. I want the name of my models to be displayed in Chinese, so i used verbose_name in my meta class of my model, codes below: #this models.py file is encoded in unicode class TS_zone(models.Model): index = models.IntegerField() zone_name = models.CharField(max_length=50); zone_icon = models.ImageField(upload_to='zone_icon', null=True) is_active = models.NullBooleanField(blank=True, null=True) status = models.CharField(max_length=7,choices=SETTING_STATUS_CHOICES) class

Django's manage.py shows old commands

断了今生、忘了曾经 提交于 2019-12-11 01:59:43
问题 I am coding my own whl-package and after creating some new management-commands and deleting some old ones I was pretty happy with myself. Except after building my wheel-package (with setup.py bdist_wheel ) and installing it on my test server (with pip install -U project-2.0b3-py2.py3-none-any.whl ), I noticed that the help of manage.py still show the old commands. It will even try to run the old commands, so there is some old stuff there, but I was not quite sure why or how. I tried

cannot open manage.py after installing django

狂风中的少年 提交于 2019-12-09 06:03:58
问题 I have a problem in setting up django. My situation: I have Anaconda Python 2.7 in my Windows 8 computer. On the Anaconda command prompt window, I type: pip install django . This is successful. Then I create a folder named "newproject". On the command prompt I went to the folder "newproject". Then django-admin.py startproject newproject . This is successful. Then I run python manage.py runserver . It tells me "...can't open file 'manage.py': [Errno 2] No such file or directory" I checked out