django-manage.py

GSWD Heroku Django manage.py issue

匆匆过客 提交于 2020-01-13 18:02:06
问题 I worked my way through a great django tutorial online, but am having an issue with the final heroku deployment. Here is the django tutorial: http://gettingstartedwithdjango.com/en/lessons/introduction-and-launch/ The issue I have is with the last call to heroku: heroku python manage.py syncdb Here is the error I get: (blog-venv)vagrant@precise64:/vagrant/projects/microblog$ heroku run python manage.py syncdb Running `python manage.py syncdb` attached to terminal... up, run.2530 Traceback

GSWD Heroku Django manage.py issue

牧云@^-^@ 提交于 2020-01-13 18:00:58
问题 I worked my way through a great django tutorial online, but am having an issue with the final heroku deployment. Here is the django tutorial: http://gettingstartedwithdjango.com/en/lessons/introduction-and-launch/ The issue I have is with the last call to heroku: heroku python manage.py syncdb Here is the error I get: (blog-venv)vagrant@precise64:/vagrant/projects/microblog$ heroku run python manage.py syncdb Running `python manage.py syncdb` attached to terminal... up, run.2530 Traceback

Django - disable one of system checks

五迷三道 提交于 2020-01-03 14:59:14
问题 Is it possible to permamently disable only ONE (not all) of the system checks (for example E301)? Is it possible to change project settings.py to skip this system check for all ./manage.py commands? 回答1: Yes you can use SILENCED_SYSTEM_CHECKS to silence specific checks e.g. settings.py SILENCED_SYSTEM_CHECKS = ["models.W001"] 回答2: To disable a check (or many checks) under certain conditions only, you can create a settings constant, and in this case I am getting the information from an

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 get alter table commands for a module

微笑、不失礼 提交于 2019-12-24 19:33:39
问题 I have added a new field to my models .From django manage.py how can i print the migration(alter table statement).In the following is_tag is my new field When i do sqlall i get the following output.How can i get the alter table commands root@rajeev-laptop:/opt/labs/labs_site# python manage.py sqlall content BEGIN; CREATE TABLE `content_content` ( `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, `name` varchar(255) NOT NULL, `uploaded_by_id` integer NOT NULL, `is_local` integer NOT NULL,

Why is django manage.py syncdb failing to create new columns on my development server?

China☆狼群 提交于 2019-12-24 00:52:12
问题 I am trying to create a development server from a production server from which I can test out new ideas. I created a duplicate of my production server's database by dumping it using Postgres' db_dump and then imported the dump into a new database. I then copied my production django directory and altered all .py files to refer to server_debug. rather than server in my import statements. Using the admin interface to alter some data works in that only the development server has its data altered.

Django manage.py: Migration applied before its dependency

别等时光非礼了梦想. 提交于 2019-12-23 06:48:09
问题 When running python manage.py migrate I encounter this error: django.db.migrations.exceptions.InconsistentMigrationHistory: Migration <appname>.0016_auto_<date2>_<time2> is applied before its dependency <appname>.0001_squashed_0015_auto_<date1>_<time1> running showmigrations returns: <appname> [X] 0001_squashed_0015_auto_<date1>_<time1> (15 squashed migrations) [X] 0016_auto_<date2>_<time2> [ ] 0017_<modelname>_squashed_0019_auto_<date3>_<time3> (3 squashed migrations) I was trying out django

custom django-admin commands - AttributeError: 'Command' object has no attribute 'stdout'

南楼画角 提交于 2019-12-22 18:20:50
问题 Following the example of writing a custom django-admin command here, I've created the following custom command: from django.core.management.base import BaseCommand, CommandError class Command(BaseCommand): args = '' help = 'Test command' def handle(self, *args, **options): self.stdout.write("Hello World!") Surprisingly, I receive the following stack trace: Traceback (most recent call last): File "D:\My Documents\Dev\MyProject\svn\trunk\dj_project\manage.py", line 11, in <module> execute

custom django-admin commands - AttributeError: 'Command' object has no attribute 'stdout'

限于喜欢 提交于 2019-12-22 18:17:04
问题 Following the example of writing a custom django-admin command here, I've created the following custom command: from django.core.management.base import BaseCommand, CommandError class Command(BaseCommand): args = '' help = 'Test command' def handle(self, *args, **options): self.stdout.write("Hello World!") Surprisingly, I receive the following stack trace: Traceback (most recent call last): File "D:\My Documents\Dev\MyProject\svn\trunk\dj_project\manage.py", line 11, in <module> execute

How do I preload imports into Django's manage.py shell command?

喜夏-厌秋 提交于 2019-12-22 03:57:05
问题 When I run manage.py shell on my Django project to take a peek at something there are common imports that I always want to run at the start of the shell (e.g. I always want to import my model files.) How can I have these run automatically everytime I run the shell command? 2nd related question, when I hit the up arrow I get the "^A" character instead of the previously run command in the manage.py shell (and in my regular python shell), how can I fix this so it loads the previous command like