Skip to main content

Posts

Showing posts with the label create

Syncdb without creating a superuser in Django

I believe you have various situations when you require your syncdb command to be executed without creating a superuser, or prompting anything. Most obvious example is a scripting of some kind. E.g. custom deployment script. For this you have a --noinput option. You can then populate your db from json or someth. Like the one that is made with --dumpdata option. To run your syncdb without propting for creation of a superuser you need to run: python manage . py syncdb --noinput

Django: Virtualenv with Eclipse befrending

Hi! Many people use Virtualenv. It has become common pattern now days. I like Virtualenv but it has no debugger. You can run ' python manage.py runserver ' but it will newer help you see somthing like runtime variables and code flow. I like PyDev  debugger. It helps me a lot. Anyway I faced a problem recently. My employer wants me to run code at virtualenv. I needed to download and run project. I made it creating New virtualenv called 'venv' inside a project folder. Command is: virtualenv - - no - site - packages venv It will create dir 'venv' inside current directory. So you should be at where you need to store your virtualenv (your project directory for e.g.). --no-site-packeges  parameter says that your new virtual environment will not have packages installed in system. It's a must if you want to avoid collisions with newer versions of code. Now we have a dir inside your project called venv  containing our separated python environment. Lets activ...